Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 6 additions & 0 deletions src/main/java/clap/server/domain/model/task/Task.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,19 @@ public void approveTask(Member reviewer, Member processor, LocalDateTime dueDate
this.dueDate = dueDate;
this.category = category;
this.label = label;
this.taskCode = toTaskCodeWithApproval(category);
this.taskStatus = TaskStatus.IN_PROGRESS;
}

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

private String toTaskCodeWithApproval(Category category) {
return category.getMainCategory().getCode() + category.getCode() + super.getCreatedAt().format(DateTimeFormatter.ofPattern("yyMMddHHmm"));
}


public void updateProcessorOrder(long newProcessorOrder) {
this.processorOrder = newProcessorOrder;
}
Expand Down
1 change: 1 addition & 0 deletions src/test/java/clap/server/TestDataFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ public static Task createTask(Long id, String taskCode, String title, TaskStatus
.requester(createUser())
.processor(processor)
.label(createLabel())
.createdAt(LocalDateTime.now())
.build();
}

Expand Down