Repository navigation
Expand file tree
/
Copy pathCard.cs
More file actions
221 lines (195 loc) · 7.55 KB
/
Copy pathCard.cs
File metadata and controls
221 lines (195 loc) · 7.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
//------------------------------------------------------------------------------
// <copyright company="LeanKit Inc.">
// Copyright (c) LeanKit Inc. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using LeanKit.API.Client.Library.Validation;
namespace LeanKit.API.Client.Library.TransferObjects
{
public enum PriorityType
{
Low,
Normal,
High,
Critical
}
public class Card
{
public long Id { get; set; }
[DomainIdentityValidation]
public long LaneId { get; set; }
[Required(ErrorMessage = "Title may not be empty")]
[StringLength(255, ErrorMessage = "Title may have 255 symbols only")]
public string Title { get; set; }
[StringLength(20000, ErrorMessage = "Description may not exceed 20000 characters")]
public string Description { get; set; }
public string CreatedOn { get; set; }
public string TypeName { get; set; }
[DomainIdentityValidation]
public long TypeId { get; set; }
public int Priority { get; set; }
public int Size { get; set; }
public bool Active { get; set; }
public string Color { get; set; }
public long Version { get; set; }
public bool IsBlocked { get; set; }
public string BlockReason { get; set; }
public int Index { get; set; }
public string StartDate { get; set; }
public string DueDate { get; set; }
public string UserWipOverrideComment { get; set; }
public string ExternalSystemName { get; set; }
[StringLength(2000, ErrorMessage = "External System Url may have 2000 symbols only")]
public string ExternalSystemUrl { get; set; }
public string Tags { get; set; }
[DomainIdentityValidation]
public long? ClassOfServiceId { get; set; }
[StringLength(50, ErrorMessage = "Card ID may have 50 symbols only")]
public string ExternalCardID { get; set; }
public string ExternalCardIdPrefix { get; set; }
[DomainIdentityValidation]
public long[] AssignedUserIds { get; set; }
public string LastMove { get; set; }
public string LastActivity { get; set; }
public string DateArchived { get; set; }
public string LastComment { get; set; }
public int CommentsCount { get; set; }
public List<Comment> Comments { get; set; }
public List<CardEvent> HistoryEvents { get; set; }
public List<CardContextView> CardContexts { get; set; }
public long? ParentCardId { get; set; }
public long? ParentBoardId { get; set; }
public string ActualFinishDate { get; set; }
public string ActualStartDate { get; set; }
public string AssignedUserName { get; set; }
public string BlockStateChangeDate { get; set; }
public long BoardId { get; set; }
public string BoardTitle { get; set; }
public string CardTypeIconColor { get; set; }
public string CardTypeIconName { get; set; }
public string ClassOfServiceCustomIconColor { get; set; }
public string ClassOfServiceCustomIconName { get; set; }
public string CreateDate { get; set; }
public string CurrentContext { get; set; }
public long? CurrentTaskBoardId { get; set; }
public int? DrillThroughCompletionPercent { get; set; }
public int? DrillThroughProgressTotal { get; set; }
public int? DrillThroughProgressComplete { get; set; }
public int? DrillThroughProgressSizeComplete { get; set; }
public int? DrillThroughProgressSizeTotal { get; set; }
public string GravatarLink { get; set; }
public string Icon { get; set; }
public bool IsOlderThanXDays { get; set; }
public string LaneTitle { get; set; }
public long? ParentTaskboardId { get; set; }
public string SmallGravatarLink { get; set; }
public int? TaskBoardCompletionPercent { get; set; }
public int TaskBoardCompletedCardCount { get; set; }
public int TaskBoardCompletedCardSize { get; set; }
public int? TaskBoardTotalCards { get; set; }
public int? TaskBoardTotalSize { get; set; }
public CardView ToCardView()
{
var cardView = new CardView();
cardView.Id = Id;
cardView.Active = Active;
cardView.ClassOfServiceId = ClassOfServiceId;
cardView.BlockReason = BlockReason;
cardView.Description = Description;
cardView.StartDate = StartDate;
cardView.DueDate = DueDate;
cardView.ExternalCardID = ExternalCardID;
cardView.ExternalSystemName = ExternalSystemName;
cardView.ExternalCardIdPrefix = ExternalCardIdPrefix;
cardView.Index = Index;
cardView.IsBlocked = IsBlocked;
cardView.LaneId = LaneId;
cardView.Priority = (PriorityType) Priority;
cardView.Size = Size;
cardView.Tags = Tags;
cardView.Title = Title;
cardView.TypeId = TypeId;
cardView.Version = Version;
//cardView.AssignedUsers = this.AssignedUserIds
cardView.Comments = Comments;
cardView.HistoryEvents = HistoryEvents;
cardView.LastMove = LastMove;
cardView.LastActivity = LastActivity;
cardView.LastComment = LastComment;
cardView.DateArchived = DateArchived;
cardView.ParentBoardId = ParentBoardId;
cardView.ParentCardId = ParentCardId;
cardView.ActualFinishDate = ActualFinishDate;
cardView.ActualStartDate = ActualStartDate;
cardView.AssignedUserName = AssignedUserName;
cardView.BlockStateChangeDate = BlockStateChangeDate;
cardView.BoardId = BoardId;
cardView.BoardTitle = BoardTitle;
cardView.CardContexts = CardContexts;
cardView.CardTypeIconColor = CardTypeIconColor;
cardView.CardTypeIconName = CardTypeIconName;
cardView.ClassOfServiceCustomIconColor = ClassOfServiceCustomIconColor;
cardView.ClassOfServiceCustomIconName = ClassOfServiceCustomIconName;
cardView.CreateDate = CreateDate;
cardView.CurrentContext = CurrentContext;
cardView.CurrentTaskBoardId = CurrentTaskBoardId;
cardView.DrillThroughCompletionPercent = DrillThroughCompletionPercent;
cardView.DrillThroughProgressTotal = DrillThroughProgressTotal;
cardView.DrillThroughProgressComplete = DrillThroughProgressComplete;
cardView.DrillThroughProgressSizeComplete = DrillThroughProgressSizeComplete;
cardView.DrillThroughProgressSizeTotal = DrillThroughProgressSizeTotal;
cardView.GravatarLink = GravatarLink;
cardView.Icon = Icon;
cardView.IsOlderThanXDays = IsOlderThanXDays;
cardView.LaneTitle = LaneTitle;
cardView.ParentTaskboardId = ParentTaskboardId;
cardView.SmallGravatarLink = SmallGravatarLink;
cardView.TaskBoardCompletionPercent = TaskBoardCompletionPercent;
cardView.TaskBoardCompletedCardCount = TaskBoardCompletedCardCount;
cardView.TaskBoardCompletedCardSize = TaskBoardCompletedCardSize;
cardView.TaskBoardTotalCards = TaskBoardTotalCards;
cardView.TaskBoardTotalSize = TaskBoardTotalSize;
return cardView;
}
}
public class CardUpdateResult
{
public long BoardVersion { get; set; }
public CardView CardDTO { get; set; }
}
public class CardAddResult
{
public long BoardVersion { get; set; }
public Lane Lane { get; set; }
public long CardId { get; set; }
}
public class CardMoveResult
{
public long BoardVersion { get; set; }
}
public class CardMoveBetweenBoardsResult
{
public long BoardVersion { get; set; }
public string DestinationLaneName { get; set; }
public long DestinationLaneId { get; set; }
public long SourceBoardId { get; set; }
public long DestinationBoardId { get; set; }
}
public class CardsUpdateResult
{
public int UpdatedCardsCount { get; set; }
}
public class CardsDeleteResult
{
public long BoardVersion { get; set; }
}
public class CardDelegationResult
{
public long ParentBoardId { get; set; }
public long DelegationCardId { get; set; }
public long DestinationLaneId { get; set; }
public string DestinationLaneName { get; set; }
}
}