Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLAP-431 작업 상태 변경 알림 내용 수정 및 알림 대상자 검증 logic 추가 #564

Merged
merged 4 commits into from
Feb 14, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

@ApplicationService
@RequiredArgsConstructor
Expand Down Expand Up @@ -59,7 +61,9 @@ public ApprovalTaskResponse approvalTaskByReviewer(Long reviewerId, Long taskId,
TaskHistory taskHistory = TaskHistory.createTaskHistory(TaskHistoryType.PROCESSOR_ASSIGNED, task, null, processor, null);
commandTaskHistoryPort.save(taskHistory);

List<Member> receivers = List.of(task.getRequester(), processor);
List<Member> receivers = Stream.of(task.getRequester(), processor)
.distinct()
.collect(Collectors.toList());
String processorName = processor.getNickname();
publishNotification(receivers, task, processorName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void terminateTask(Long memberId, Long taskId, String reason) {
TaskHistory taskHistory = TaskHistory.createTaskHistory(TaskHistoryType.TASK_TERMINATED, task, reason, null, null);
commandTaskHistoryPort.save(taskHistory);

publishNotification(task.getRequester(), task, String.valueOf(task.getTaskStatus()), reason);
publishNotification(task.getRequester(), task, task.getTaskStatus().getDescription(), reason);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void updateTaskOrderAndStatus(Long processorId, UpdateTaskOrderRequest re

TaskHistory taskHistory = TaskHistory.createTaskHistory(TaskHistoryType.STATUS_SWITCHED, updatedTask, targetStatus.getDescription(), null,null);
commandTaskHistoryPort.save(taskHistory);
publishNotification(targetTask, NotificationType.STATUS_SWITCHED, String.valueOf(updatedTask.getTaskStatus()));
publishNotification(targetTask, NotificationType.STATUS_SWITCHED, updatedTask.getDescription());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void updateTaskStatus(Long memberId, Long taskId, TaskStatus targetTaskSt
saveTaskHistory(TaskHistory.createTaskHistory(TaskHistoryType.STATUS_SWITCHED, task, targetTaskStatus.getDescription(), null, null));

List<Member> receivers = List.of(task.getRequester());
publishNotification(receivers, updatedTask, NotificationType.STATUS_SWITCHED, String.valueOf(updatedTask.getTaskStatus()));
publishNotification(receivers, updatedTask, NotificationType.STATUS_SWITCHED, targetTaskStatus.getDescription());
}
}

Expand Down