Skip to content

Commit 1fda805

Browse files
authored
Merge pull request #564 from TaskFlow-CLAP/CLAP-431
CLAP-431 작업 상태 변경 알림 내용 수정 및 알림 대상자 검증 logic 추가
2 parents 8be4f9c + 7f8a698 commit 1fda805

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

src/main/java/clap/server/application/service/task/ApprovalTaskService.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
import org.springframework.transaction.annotation.Transactional;
2727

2828
import java.util.List;
29+
import java.util.stream.Collectors;
30+
import java.util.stream.Stream;
2931

3032
@ApplicationService
3133
@RequiredArgsConstructor
@@ -59,7 +61,9 @@ public ApprovalTaskResponse approvalTaskByReviewer(Long reviewerId, Long taskId,
5961
TaskHistory taskHistory = TaskHistory.createTaskHistory(TaskHistoryType.PROCESSOR_ASSIGNED, task, null, processor, null);
6062
commandTaskHistoryPort.save(taskHistory);
6163

62-
List<Member> receivers = List.of(task.getRequester(), processor);
64+
List<Member> receivers = Stream.of(task.getRequester(), processor)
65+
.distinct()
66+
.collect(Collectors.toList());
6367
String processorName = processor.getNickname();
6468
publishNotification(receivers, task, processorName);
6569

src/main/java/clap/server/application/service/task/TerminateTaskService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public void terminateTask(Long memberId, Long taskId, String reason) {
3434
TaskHistory taskHistory = TaskHistory.createTaskHistory(TaskHistoryType.TASK_TERMINATED, task, reason, null, null);
3535
commandTaskHistoryPort.save(taskHistory);
3636

37-
publishNotification(task.getRequester(), task, String.valueOf(task.getTaskStatus()), reason);
37+
publishNotification(task.getRequester(), task, task.getTaskStatus().getDescription(), reason);
3838

3939
}
4040

src/main/java/clap/server/application/service/task/UpdateTaskOrderAndStstusService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public void updateTaskOrderAndStatus(Long processorId, UpdateTaskOrderRequest re
8383

8484
TaskHistory taskHistory = TaskHistory.createTaskHistory(TaskHistoryType.STATUS_SWITCHED, updatedTask, targetStatus.getDescription(), null,null);
8585
commandTaskHistoryPort.save(taskHistory);
86-
publishNotification(targetTask, NotificationType.STATUS_SWITCHED, String.valueOf(updatedTask.getTaskStatus()));
86+
publishNotification(targetTask, NotificationType.STATUS_SWITCHED, updatedTask.getDescription());
8787
}
8888

8989
/**

src/main/java/clap/server/application/service/task/UpdateTaskService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public void updateTaskStatus(Long memberId, Long taskId, TaskStatus targetTaskSt
5555
saveTaskHistory(TaskHistory.createTaskHistory(TaskHistoryType.STATUS_SWITCHED, task, targetTaskStatus.getDescription(), null, null));
5656

5757
List<Member> receivers = List.of(task.getRequester());
58-
publishNotification(receivers, updatedTask, NotificationType.STATUS_SWITCHED, String.valueOf(updatedTask.getTaskStatus()));
58+
publishNotification(receivers, updatedTask, NotificationType.STATUS_SWITCHED, targetTaskStatus.getDescription());
5959
}
6060
}
6161

0 commit comments

Comments
 (0)