Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updating
  • Loading branch information
DiegoGalante committed Jul 17, 2021
commit 8b085c42d2af279b95e109d545eef3090cb2bd2c
1 change: 0 additions & 1 deletion AzureDevopsStateTracker/Adapters/WorkItemAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ public TimeByStateDTO ToTimeByStateDTO(TimeByState workItemStatusTime)
return new TimeByStateDTO()
{
CreatedAt = workItemStatusTime.CreatedAt,
UpdatedAt = workItemStatusTime.UpdatedAt,
State = workItemStatusTime.State,
TotalTime = ToStringTime(new DateTime(workItemStatusTime.TotalTime).TimeOfDay),
TotalWorkedTime = ToStringTime(new DateTime(workItemStatusTime.TotalWorkedTime).TimeOfDay)
Expand Down
8 changes: 7 additions & 1 deletion AzureDevopsStateTracker/Data/DataBaseConfig.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
namespace AzureDevopsStateTracker.Data
using AzureDevopsStateTracker.Extensions;
using System;

namespace AzureDevopsStateTracker.Data
{
public class DataBaseConfig
{
public DataBaseConfig(string connectionsString, string schemaName = "dbo")
{
if (connectionsString.IsNullOrEmpty())
throw new ArgumentException("The ConnectionsString is required");

ConnectionsString = connectionsString;
SchemaName = schemaName;
}
Expand Down
9 changes: 0 additions & 9 deletions AzureDevopsStateTracker/Entities/TimeByState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ namespace AzureDevopsStateTracker.Entities
{
public class TimeByState : Entity
{
public DateTime UpdatedAt { get; private set; }
public string WorkItemId { get; private set; }
public string State { get; private set; }
public long TotalTime { get; private set; }
Expand All @@ -20,18 +19,10 @@ public TimeByState(string workItemId, string state, long totalTime, long totalWo
State = state;
TotalTime = totalTime;
TotalWorkedTime = totalWorkedTime;
UpdatedAt = CreatedAt;

Validate();
}

public void Update(long totalTime, long totalWorkedTime)
{
TotalTime = totalTime;
TotalWorkedTime = totalWorkedTime;
UpdatedAt = DateTime.UtcNow;
}

public void Validate()
{
if (WorkItemId.IsNullOrEmpty() || Convert.ToInt64(WorkItemId) <= 0)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ protected override void Up(MigrationBuilder migrationBuilder)
{
Id = table.Column<string>(type: "varchar(200)", nullable: false),
CreatedAt = table.Column<DateTime>(nullable: false),
UpdatedAt = table.Column<DateTime>(nullable: false),
WorkItemId = table.Column<string>(type: "varchar(200)", nullable: true),
State = table.Column<string>(type: "varchar(200)", nullable: true),
TotalTime = table.Column<long>(nullable: false),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Property<long>("TotalWorkedTime")
.HasColumnType("bigint");

b.Property<DateTime>("UpdatedAt")
.HasColumnType("datetime2");

b.Property<string>("WorkItemId")
.HasColumnType("varchar(200)");

Expand Down