44import static com .somemore .global .exception .ExceptionMessage .UNAUTHORIZED_RECRUIT_BOARD ;
55import static com .somemore .global .exception .ExceptionMessage .VOLUNTEER_APPLY_LIST_MISMATCH ;
66
7+ import com .somemore .facade .event .VolunteerReviewRequestEvent ;
8+ import com .somemore .global .common .event .ServerEventPublisher ;
9+ import com .somemore .global .common .event .ServerEventType ;
710import com .somemore .global .exception .BadRequestException ;
11+ import com .somemore .notification .domain .NotificationSubType ;
812import com .somemore .recruitboard .domain .RecruitBoard ;
913import com .somemore .recruitboard .usecase .query .RecruitBoardQueryUseCase ;
1014import com .somemore .volunteer .usecase .UpdateVolunteerUseCase ;
@@ -25,6 +29,7 @@ public class SettleVolunteerApplyFacadeService implements SettleVolunteerApplyFa
2529 private final VolunteerApplyQueryUseCase volunteerApplyQueryUseCase ;
2630 private final RecruitBoardQueryUseCase recruitBoardQueryUseCase ;
2731 private final UpdateVolunteerUseCase updateVolunteerUseCase ;
32+ private final ServerEventPublisher serverEventPublisher ;
2833
2934 @ Override
3035 public void settleVolunteerApplies (VolunteerApplySettleRequestDto dto , UUID centerId ) {
@@ -41,6 +46,7 @@ public void settleVolunteerApplies(VolunteerApplySettleRequestDto dto, UUID cent
4146 applies .forEach (apply -> {
4247 apply .changeAttended (true );
4348 updateVolunteerUseCase .updateVolunteerStats (apply .getVolunteerId (), hours );
49+ publishVolunteerReviewRequestEvent (apply , recruitBoard );
4450 });
4551
4652 }
@@ -68,4 +74,17 @@ private void validateRecruitBoardConsistency(List<VolunteerApply> applies,
6874 throw new BadRequestException (RECRUIT_BOARD_ID_MISMATCH );
6975 }
7076 }
77+
78+ private void publishVolunteerReviewRequestEvent (VolunteerApply apply , RecruitBoard recruitBoard ) {
79+ VolunteerReviewRequestEvent event = VolunteerReviewRequestEvent .builder ()
80+ .type (ServerEventType .NOTIFICATION )
81+ .subType (NotificationSubType .VOLUNTEER_REVIEW_REQUEST )
82+ .volunteerId (apply .getVolunteerId ())
83+ .volunteerApplyId (apply .getId ())
84+ .centerId (recruitBoard .getCenterId ())
85+ .recruitBoardId (recruitBoard .getId ())
86+ .build ();
87+
88+ serverEventPublisher .publish (event );
89+ }
7190}
0 commit comments