| | |
| | | import com.tourguide.modules.finance.dto.WithdrawalProcessRequest; |
| | | import com.tourguide.modules.finance.dto.WithdrawalResponse; |
| | | import com.tourguide.modules.finance.service.AdminFinanceService; |
| | | import com.tourguide.security.AppUserPrincipal; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.springframework.security.core.Authentication; |
| | | import org.springframework.security.core.annotation.AuthenticationPrincipal; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | |
| | | @PutMapping("/withdrawals/{id}/process") |
| | | public ApiResponse<WithdrawalResponse> processWithdrawal(@PathVariable Long id, |
| | | @Valid @RequestBody WithdrawalProcessRequest request, |
| | | Authentication authentication) { |
| | | return ApiResponse.success(financeService.processWithdrawal(id, request, authentication.getName())); |
| | | @AuthenticationPrincipal AppUserPrincipal principal) { |
| | | return ApiResponse.success(financeService.processWithdrawal(id, request, principal.getUsername())); |
| | | } |
| | | } |