1 package fr.tiogars.chat.client;
2
3 import java.time.Instant;
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 public record Task(
19 Long id,
20 String code,
21 String label,
22 String description,
23 Instant createdDate,
24 Instant lastModifiedDate,
25 String createdBy,
26 String lastModifiedBy,
27 TaskStatus status,
28 TaskPriority priority,
29 java.time.LocalDate dueDate,
30 String assignedTo,
31 java.util.List<Long> tagIds,
32 Long nomenclatureId
33 ) {
34 public Task {
35 status = status == null ? TaskStatus.TODO : status;
36 priority = priority == null ? TaskPriority.NORMAL : priority;
37 tagIds = tagIds == null ? java.util.List.of() : java.util.List.copyOf(tagIds);
38 }
39
40 public Task(Long id, String code, String label, String description,
41 Instant createdDate, Instant lastModifiedDate, String createdBy, String lastModifiedBy) {
42 this(id, code, label, description, createdDate, lastModifiedDate, createdBy, lastModifiedBy,
43 TaskStatus.TODO, TaskPriority.NORMAL, null, null, java.util.List.of(), null);
44 }
45
46
47
48
49
50
51
52
53
54
55 public Task(Long id, String code, String label, String description,
56 Instant createdDate, Instant lastModifiedDate) {
57 this(id, code, label, description, createdDate, lastModifiedDate, null, null);
58 }
59 }