Skip to content

Conversation

@baekjaehyuk
Copy link
Collaborator

📌 작업 개요

  • 프론트측의 요구사항에 따라 카테고리별 지출 비율을 반환하는 것이 아닌 카테고리별 총 지출금액을 반환

✅ 작업 내용

  1. 카테고리별 총 지출금액을 반환하도록 로직 구현
  2. 변경된 로직에 따라 명확한 네이밍 정의
  3. 화이트리스트 경로 추가
  4. 기존 API 엔드포인트 변경
  5. CORS 경로 추가

📂 리뷰 요구사항

  • 기존 작업된 이슈에 부수적인 작업도 추가되었습니다. 추후엔 분리하여 작업하겠습니다.

@baekjaehyuk baekjaehyuk self-assigned this May 16, 2025
@baekjaehyuk baekjaehyuk requested review from Copilot and tiemo0708 May 16, 2025 17:21
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 updates the receipt APIs to return total expense amounts by category and by month instead of ratios.

  • Replaced ratio-based logic with sum-based expense calculations in ReceiptEditor
  • Renamed/added result DTOs and response classes to reflect “expense” terminology
  • Updated service, controller, API definitions, security whitelist, and CORS origins accordingly

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
receipt/domain/service/ReceiptEditor.java Switched from ratio to total expense aggregation
receipt/domain/ReceiptCategoryExpenseResult.java Added DTO for category expense results
receipt/domain/ReceiptMonthlyExpenseResult.java Renamed and repurposed monthly expense DTO
receipt/domain/DetailCategoryResult.java Removed obsolete ratio-based result class
receipt/application/service/FindReceiptService.java Updated method names and return types for expense
receipt/application/port/in/FindReceiptUseCase.java Adjusted use-case interface signatures
receipt/adapter/in/web/dto/response/ReceiptCategoryExpenseResponse.java Added response record for category expense
receipt/adapter/in/web/dto/response/ReceiptMonthlyExpenseResponse.java Renamed and adapted monthly expense response record
receipt/adapter/in/web/dto/response/ReceiptCategoryResponse.java Removed obsolete ratio response
receipt/adapter/in/web/api/FindReceiptApi.java Updated endpoint definitions and descriptions
receipt/adapter/in/web/FindReceiptController.java Renamed mappings to /category-expense & /monthly-expense
core/config/WebConfig.java Added production CORS origin
core/config/SecurityConfig.java Whitelisted new expense endpoints
Comments suppressed due to low confidence (2)

src/main/java/com/ClubAccount_BE/receipt/domain/service/ReceiptEditor.java:38

  • Consider adding unit tests for calculateCategoryExpense to verify correct aggregation of receipt amounts per category, including edge cases like an empty list and mixed categories.
public ReceiptCategoryExpenseResult calculateCategoryExpense(List<Receipt> receipts) {

src/main/java/com/ClubAccount_BE/receipt/domain/service/ReceiptEditor.java:58

  • Add unit tests for calculateMonthlyExpense to ensure monthly grouping and default zero values are correct for all 12 months.
public List<ReceiptMonthlyExpenseResult> calculateMonthlyExpense(

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

@baekjaehyuk baekjaehyuk merged commit 1a2c3b6 into develop May 16, 2025
2 of 3 checks passed
@baekjaehyuk baekjaehyuk deleted the TB-30 branch May 16, 2025 17:41
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.

고생하셨습니다

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