Skip to content

Commit 58f496b

Browse files
committed
feat(volunteer-apply): 봉사 활동 지원 정산 기능 API
1 parent bf29515 commit 58f496b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/main/java/com/somemore/volunteerapply/controller/CenterVolunteerApplyCommandApiController.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
package com.somemore.volunteerapply.controller;
22

33
import com.somemore.auth.annotation.CurrentUser;
4+
import com.somemore.facade.volunteerapply.SettleVolunteerApplyFacadeUseCase;
45
import com.somemore.global.common.response.ApiResponse;
6+
import com.somemore.volunteerapply.dto.request.VolunteerApplySettleRequestDto;
57
import com.somemore.volunteerapply.usecase.ApproveVolunteerApplyUseCase;
68
import com.somemore.volunteerapply.usecase.RejectVolunteerApplyUseCase;
79
import io.swagger.v3.oas.annotations.Operation;
810
import io.swagger.v3.oas.annotations.tags.Tag;
11+
import jakarta.validation.Valid;
912
import java.util.UUID;
1013
import lombok.RequiredArgsConstructor;
1114
import org.springframework.security.access.annotation.Secured;
1215
import org.springframework.web.bind.annotation.PatchMapping;
1316
import org.springframework.web.bind.annotation.PathVariable;
17+
import org.springframework.web.bind.annotation.PostMapping;
18+
import org.springframework.web.bind.annotation.RequestBody;
1419
import org.springframework.web.bind.annotation.RequestMapping;
1520
import 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

Comments
 (0)