11package com .somemore .volunteerapply .controller ;
22
33import com .somemore .auth .annotation .CurrentUser ;
4+ import com .somemore .facade .volunteerapply .SettleVolunteerApplyFacadeUseCase ;
45import com .somemore .global .common .response .ApiResponse ;
6+ import com .somemore .volunteerapply .dto .request .VolunteerApplySettleRequestDto ;
57import com .somemore .volunteerapply .usecase .ApproveVolunteerApplyUseCase ;
68import com .somemore .volunteerapply .usecase .RejectVolunteerApplyUseCase ;
79import io .swagger .v3 .oas .annotations .Operation ;
810import io .swagger .v3 .oas .annotations .tags .Tag ;
11+ import jakarta .validation .Valid ;
912import java .util .UUID ;
1013import lombok .RequiredArgsConstructor ;
1114import org .springframework .security .access .annotation .Secured ;
1215import org .springframework .web .bind .annotation .PatchMapping ;
1316import org .springframework .web .bind .annotation .PathVariable ;
17+ import org .springframework .web .bind .annotation .PostMapping ;
18+ import org .springframework .web .bind .annotation .RequestBody ;
1419import org .springframework .web .bind .annotation .RequestMapping ;
1520import org .springframework .web .bind .annotation .RestController ;
1621
@@ -22,6 +27,7 @@ public class CenterVolunteerApplyCommandApiController {
2227
2328 private final ApproveVolunteerApplyUseCase approveVolunteerApplyUseCase ;
2429 private final RejectVolunteerApplyUseCase rejectVolunteerApplyUseCase ;
30+ private final SettleVolunteerApplyFacadeUseCase settleVolunteerApplyFacadeUseCase ;
2531
2632 @ Secured ("ROLE_CENTER" )
2733 @ Operation (summary = "봉사 활동 지원 승인" , description = "봉사 활동 지원을 승인합니다." )
@@ -47,4 +53,15 @@ public ApiResponse<String> reject(
4753 return ApiResponse .ok ("봉사 활동 지원 거절 성공" );
4854 }
4955
56+ @ Secured ("ROLE_CENTER" )
57+ @ Operation (summary = "봉사 활동 지원 정산" , description = "봉사 활동 지원을 정산(참석 처리, 봉사 시간 부여)합니다." )
58+ @ PostMapping ("/volunteer-applies/settle" )
59+ public ApiResponse <String > settle (
60+ @ CurrentUser UUID centerId ,
61+ @ Valid @ RequestBody VolunteerApplySettleRequestDto requestDto
62+ ) {
63+ settleVolunteerApplyFacadeUseCase .settleVolunteerApplies (requestDto , centerId );
64+ return ApiResponse .ok ("봉사 활동 지원 정산 성공" );
65+ }
66+
5067}
0 commit comments