-
Notifications
You must be signed in to change notification settings - Fork 0
[TB-33] 영수증 삭제 API 기능 구현 #37
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements the receipt deletion functionality by adding a service, controller, and API interface while also updating related components for image upload and error handling.
- Implements deletion of receipts along with associated images from the S3 bucket.
- Introduces a new DeleteReceiptService and corresponding UseCase, API, and Controller.
- Updates existing CreateReceiptService and its tests to use the new UploadReceiptImagePort and refines error codes.
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| CreateReceiptServiceTest.java | Updated import to use UploadReceiptImagePort for consistency in receipt image uploads. |
| ReceiptEditor.java | Added a method to generate the list of receipt image URLs to delete, skipping the default image. |
| DeleteReceiptService.java | Introduces logic to delete receipts and their images by integrating with the editor and the deletion ports. |
| CreateReceiptService.java | Updated to use UploadReceiptImagePort for handling receipt image uploads. |
| DeleteReceiptUseCase.java | Added an interface for deleting receipts. |
| DeleteReceiptApi.java | Defines the API for receipt deletion with proper documentation annotations. |
| DeleteReceiptController.java | Implements the deletion endpoint but may lead to redundant endpoint URLs. |
| LoginUser.java | Updated with hidden Swagger parameter annotation. |
| ErrorCode.java | Added a new error code for failure to delete receipts. |
src/main/java/com/ClubAccount_BE/receipt/adapter/in/web/DeleteReceiptController.java
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is 📢 Thoughts on this report? Let us know! |
tiemo0708
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
잘하신거 같습니다 고생하셨습니다!!
src/main/java/com/ClubAccount_BE/receipt/application/port/out/DeleteReceiptPort.java
Outdated
Show resolved
Hide resolved
|



📌 작업 개요
✅ 작업 내용
📂 리뷰 요구사항
orphanRemoval = true로 정의가 되어 있습니다. 여러 개의 영수증 객체를 삭제해야 하기에deleteAllByIdInBatch로 처리하고자 하였으나 영속성 컨텍스트의 상태와 동기화 문제가 생길 수 있기에 개별적으로 삭제를 처리하는 로직으로 구현했습니다.