Skip to content

Conversation

@baekjaehyuk
Copy link
Collaborator

@baekjaehyuk baekjaehyuk commented May 11, 2025

📌 작업 개요

  • 영수증에 기재된 금액과 영수증 구매 내역 리스트의 가격 총합을 비교하여 일치하는 지에 대한 로직 추가

✅ 작업 내용

  1. Receipt 엔티티 필드 추가
  2. 비즈니스 도메인 서비스단에서 금액 검증 로직 (영수증 등록과 수정할 경우)
  3. 영수증 조회 시에 일치하는 지에 대한 여부 반환

📂 리뷰 요구사항

  • 현재 설계된 아키텍쳐 흐름 상 비교 로직에 대해 적절하게 구현되었는지 리뷰 부탁드립니다.

영수증 수정할 경우에도 적용, 영수증 조회 시에 boolean 값으로 반환
@baekjaehyuk baekjaehyuk requested review from Copilot and tiemo0708 May 11, 2025 12:49
@baekjaehyuk baekjaehyuk self-assigned this May 11, 2025
Copy link

Copilot AI left a 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 introduces a new receipt amount validation logic by comparing the receipt’s total price with the sum of its items, and reflects the result through the new isAmountMatched field.

  • Added the isAmountMatched field to the Receipt domain, mapper, and response DTOs.
  • Implemented a check in ReceiptEditor to verify the amount match and updated both create and update services accordingly.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/main/java/com/ClubAccount_BE/receipt/mapper/ReceiptMapper.java Added mapping for the new isAmountMatched field.
src/main/java/com/ClubAccount_BE/receipt/domain/service/ReceiptEditor.java Introduced checkAmountMatch method to validate receipt amounts.
src/main/java/com/ClubAccount_BE/receipt/domain/Receipt.java Extended the domain model with the isAmountMatched field and its setter.
src/main/java/com/ClubAccount_BE/receipt/application/service/UpdateReceiptService.java Updated receipt amount verification logic in the update flow.
src/main/java/com/ClubAccount_BE/receipt/application/service/CreateReceiptService.java Updated receipt amount verification logic in the create flow.
src/main/java/com/ClubAccount_BE/receipt/adapter/in/web/dto/response/ReceiptResponse.java Updated DTO to include the isAmountMatched field.
src/main/java/com/ClubAccount_BE/receipt/adapter/in/web/dto/response/ReceiptDetailResponse.java Updated detailed DTO to include the isAmountMatched field.
Comments suppressed due to low confidence (1)

src/main/java/com/ClubAccount_BE/receipt/domain/Receipt.java:90

  • [nitpick] The method name 'checkAmountMatched' is used to set the match status, which could be misleading. Consider renaming it to 'setAmountMatched' for better clarity.
public void checkAmountMatched(boolean isAmountMatched) {

Copy link
Member

@tiemo0708 tiemo0708 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!
리뷰단거만 한번 확인해주세요

@sonarqubecloud
Copy link

@baekjaehyuk baekjaehyuk merged commit 865374d into develop May 11, 2025
3 checks passed
@baekjaehyuk baekjaehyuk deleted the TB-27 branch May 11, 2025 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants