Skip to content

Commit ee8fa01

Browse files
authored
Merge pull request #546 from TaskFlow-CLAP/CLAP-418
CLAP-418 작업 승인시 작업 코드 설정
2 parents 6f9b6ae + a8fa56c commit ee8fa01

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/main/java/clap/server/domain/model/task/Task.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,19 @@ public void approveTask(Member reviewer, Member processor, LocalDateTime dueDate
100100
this.dueDate = dueDate;
101101
this.category = category;
102102
this.label = label;
103+
this.taskCode = toTaskCodeWithApproval(category);
103104
this.taskStatus = TaskStatus.IN_PROGRESS;
104105
}
105106

106107
private static String toTaskCode(Category category) {
107108
return category.getMainCategory().getCode() + category.getCode() + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyMMddHHmm"));
108109
}
109110

111+
private String toTaskCodeWithApproval(Category category) {
112+
return category.getMainCategory().getCode() + category.getCode() + super.getCreatedAt().format(DateTimeFormatter.ofPattern("yyMMddHHmm"));
113+
}
114+
115+
110116
public void updateProcessorOrder(long newProcessorOrder) {
111117
this.processorOrder = newProcessorOrder;
112118
}

src/test/java/clap/server/TestDataFactory.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ public static Task createTask(Long id, String taskCode, String title, TaskStatus
194194
.requester(createUser())
195195
.processor(processor)
196196
.label(createLabel())
197+
.createdAt(LocalDateTime.now())
197198
.build();
198199
}
199200

0 commit comments

Comments
 (0)