135 lines
5.1 KiB
C#
135 lines
5.1 KiB
C#
using System;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace Adaptation.FileHandlers.json.WorkItems;
|
|
|
|
public class WorkItem
|
|
{
|
|
|
|
#nullable enable
|
|
|
|
[JsonConstructor]
|
|
public WorkItem(DateTime? activatedDate,
|
|
string areaPath,
|
|
string? assignedTo,
|
|
long? businessValue,
|
|
DateTime changedDate,
|
|
DateTime? closedDate,
|
|
int commentCount,
|
|
DateTime createdDate,
|
|
string description,
|
|
long? effort,
|
|
int id,
|
|
string iterationPath,
|
|
int? parent,
|
|
int? priority,
|
|
Relation[]? relations,
|
|
string? requester,
|
|
DateTime? resolvedDate,
|
|
int revision,
|
|
long? riskReductionMinusOpportunityEnablement,
|
|
DateTime? startDate,
|
|
string state,
|
|
string tags,
|
|
DateTime? targetDate,
|
|
long? timeCriticality,
|
|
string title,
|
|
string? violation,
|
|
long? weightedShortestJobFirst,
|
|
string workItemType)
|
|
{
|
|
ActivatedDate = activatedDate;
|
|
AreaPath = areaPath;
|
|
AssignedTo = assignedTo;
|
|
BusinessValue = businessValue;
|
|
ChangedDate = changedDate;
|
|
ClosedDate = closedDate;
|
|
CommentCount = commentCount;
|
|
CreatedDate = createdDate;
|
|
Description = description;
|
|
Effort = effort;
|
|
Id = id;
|
|
IterationPath = iterationPath;
|
|
Parent = parent;
|
|
Priority = priority;
|
|
Relations = relations;
|
|
Requester = requester;
|
|
ResolvedDate = resolvedDate;
|
|
Revision = revision;
|
|
RiskReductionMinusOpportunityEnablement = riskReductionMinusOpportunityEnablement;
|
|
StartDate = startDate;
|
|
State = state;
|
|
Tags = tags;
|
|
TargetDate = targetDate;
|
|
TimeCriticality = timeCriticality;
|
|
Title = title;
|
|
Violation = violation;
|
|
WeightedShortestJobFirst = weightedShortestJobFirst;
|
|
WorkItemType = workItemType;
|
|
}
|
|
|
|
public override string ToString() => $"{Id} - {WorkItemType} - {Title}";
|
|
|
|
public static WorkItem Get(WorkItem workItem, string? violation)
|
|
{
|
|
WorkItem result = new(workItem.ActivatedDate,
|
|
workItem.AreaPath,
|
|
workItem.AssignedTo,
|
|
workItem.BusinessValue,
|
|
workItem.ChangedDate,
|
|
workItem.ClosedDate,
|
|
workItem.CommentCount,
|
|
workItem.CreatedDate,
|
|
workItem.Description,
|
|
workItem.Effort,
|
|
workItem.Id,
|
|
workItem.IterationPath,
|
|
workItem.Parent,
|
|
workItem.Priority,
|
|
workItem.Relations,
|
|
workItem.Requester,
|
|
workItem.ResolvedDate,
|
|
workItem.Revision,
|
|
workItem.RiskReductionMinusOpportunityEnablement,
|
|
workItem.StartDate,
|
|
workItem.State,
|
|
workItem.Tags,
|
|
workItem.TargetDate,
|
|
workItem.TimeCriticality,
|
|
workItem.Title,
|
|
workItem.Violation is null ? violation : workItem.Violation,
|
|
workItem.WeightedShortestJobFirst,
|
|
workItem.WorkItemType);
|
|
return result;
|
|
}
|
|
|
|
public DateTime? ActivatedDate { get; set; }
|
|
public string AreaPath { get; set; }
|
|
public string? AssignedTo { get; set; }
|
|
public long? BusinessValue { get; set; }
|
|
public DateTime ChangedDate { get; set; }
|
|
public DateTime? ClosedDate { get; set; }
|
|
public int CommentCount { get; set; }
|
|
public DateTime CreatedDate { get; set; }
|
|
public string Description { get; set; }
|
|
public long? Effort { get; set; }
|
|
public int Id { get; set; }
|
|
public string IterationPath { get; set; }
|
|
public int? Parent { get; set; }
|
|
public int? Priority { get; set; }
|
|
public Relation[]? Relations { get; set; }
|
|
public string? Requester { get; set; }
|
|
public DateTime? ResolvedDate { get; set; }
|
|
public int Revision { get; set; }
|
|
public long? RiskReductionMinusOpportunityEnablement { get; set; }
|
|
public DateTime? StartDate { get; set; }
|
|
public string State { get; set; }
|
|
public string Tags { get; set; }
|
|
public DateTime? TargetDate { get; set; }
|
|
public long? TimeCriticality { get; set; }
|
|
public string Title { get; set; }
|
|
public string? Violation { get; set; }
|
|
public string WorkItemType { get; set; }
|
|
public long? WeightedShortestJobFirst { get; set; }
|
|
|
|
} |