Skip to content

[FIX/#114] 목표 거래내역 API 동기화 로직 제거#117

Open
kkeunii wants to merge 3 commits intomainfrom
fix/#114-goal-rmsync
Open

[FIX/#114] 목표 거래내역 API 동기화 로직 제거#117
kkeunii wants to merge 3 commits intomainfrom
fix/#114-goal-rmsync

Conversation

@kkeunii
Copy link
Collaborator

@kkeunii kkeunii commented Feb 18, 2026

🔗 Related Issue

📝 Summary

목표 달성 로직 변경

  • 목표 달성 기준을 현재 잔액 >= 목표 금액으로 변경했습니다.
  • Goal 엔티티에서 startAmount 필드를 삭제했습니다.

동기화 로직 제거

  • 목표 관련 모든 서비스에서 실시간 잔액 동기화 로직(기존 AssetBalanceService 호출하던 거)을 제거했습니다.
  • 모든 잔액 조회는 DB에 저장된 BankAccount의 balanceAmount를 직접 사용합니다.

코드 단순화 및 리팩토링:

  • 기존 동기화 역할을 하던 GoalLedgerFacade를 삭제하고, GoalController가 GoalLedgerQueryService를 직접 호출하도록 변경했습니다.
  • GoalConverter 및 관련 DTO에서 startAmount 관련 로직을 제거하고 필드명을 currentBalance로 통일했습니다.

🔄 Changes

  • API 변경 (추가/수정)
  • 데이터 및 도메인 변경 (DB, 비즈니스 로직)
  • 설정 또는 인프라 관련 변경
  • 리팩토링

💬 Questions & Review Points

📸 API Test Results (Swagger)

✅ Checklist

  • API 테스트 완료
  • 테스트 결과 사진 첨부
  • 빌드 성공 확인 (./gradlew build)

@kkeunii kkeunii linked an issue Feb 18, 2026 that may be closed by this pull request
1 task
@gemini-code-assist
Copy link

Summary of Changes

Hello @kkeunii, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 Pull Request는 목표 관리 시스템의 복잡성을 줄이고 데이터 일관성을 향상시키기 위해 실시간 잔액 동기화 로직을 제거하고 목표 달성 기준을 단순화합니다. 기존에는 목표 생성 시점의 잔액(startAmount)을 기준으로 달성률을 계산하고 실시간으로 자산 잔액을 동기화했지만, 이제는 Goal 엔티티에서 startAmount 필드를 제거하고 BankAccount에 저장된 현재 잔액을 직접 사용하여 목표 달성 여부와 진행률을 판단합니다. 이를 통해 불필요한 동기화 오버헤드를 없애고 코드 구조를 간소화했습니다.

Highlights

  • 목표 달성 로직 변경: 목표 달성 기준을 현재 잔액 >= 목표 금액으로 변경했습니다.
  • Goal 엔티티 필드 삭제: Goal 엔티티에서 startAmount 필드를 삭제했습니다.
  • 실시간 잔액 동기화 로직 제거: 목표 관련 모든 서비스에서 실시간 잔액 동기화 로직(기존 AssetBalanceService 호출)을 제거했습니다.
  • 잔액 조회 방식 변경: 모든 잔액 조회는 DB에 저장된 BankAccount의 balanceAmount를 직접 사용하도록 변경했습니다.
  • 코드 단순화 및 리팩토링: 기존 동기화 역할을 하던 GoalLedgerFacade를 삭제하고, GoalController가 GoalLedgerQueryService를 직접 호출하도록 변경했습니다.
  • DTO 및 Converter 업데이트: GoalConverter 및 관련 DTO에서 startAmount 관련 로직을 제거하고 필드명을 currentBalance로 통일했습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/main/java/org/umc/valuedi/domain/asset/service/AssetBalanceService.java
    • 제거됨.
  • src/main/java/org/umc/valuedi/domain/asset/service/command/AssetFetchService.java
    • 파일 끝에 누락된 개행 문자가 추가됨.
  • src/main/java/org/umc/valuedi/domain/goal/controller/GoalController.java
    • GoalLedgerFacade 의존성이 GoalLedgerQueryService로 대체되었고, getGoalLedgers 메서드에서 GoalLedgerQueryService를 직접 호출하도록 변경됨.
  • src/main/java/org/umc/valuedi/domain/goal/converter/GoalConverter.java
    • toEntity 메서드에서 startAmount 매개변수가 제거되었고, toCreateDto에서 startAmount 필드가 제거됨.
    • toSummaryDto 및 toDetailDto 메서드에서 savedAmount 매개변수 및 관련 필드명이 currentBalance로 변경됨.
  • src/main/java/org/umc/valuedi/domain/goal/dto/response/GoalCreateResponseDto.java
    • startAmount 필드가 제거됨.
  • src/main/java/org/umc/valuedi/domain/goal/dto/response/GoalDetailResponseDto.java
    • savedAmount 필드명이 currentBalance로 변경됨.
  • src/main/java/org/umc/valuedi/domain/goal/dto/response/GoalListResponseDto.java
    • GoalSummaryDto 내부의 savedAmount 필드명이 currentBalance로 변경됨.
  • src/main/java/org/umc/valuedi/domain/goal/entity/Goal.java
    • startAmount 필드와 해당 setter 메서드가 제거됨.
  • src/main/java/org/umc/valuedi/domain/goal/service/GoalAchievementRateService.java
    • calculateRate 메서드의 savedAmount 매개변수 이름이 currentBalance로 변경됨.
  • src/main/java/org/umc/valuedi/domain/goal/service/GoalLedgerFacade.java
    • 제거됨.
  • src/main/java/org/umc/valuedi/domain/goal/service/GoalStatusChangeService.java
    • AssetBalanceService 의존성이 제거되었고, refreshGoalStatuses 및 checkAndUpdateStatus 메서드에서 account.getBalanceAmount()를 직접 사용하여 현재 잔액을 가져오고 목표 달성 여부를 확인하도록 로직이 변경됨.
  • src/main/java/org/umc/valuedi/domain/goal/service/command/GoalCommandService.java
    • AssetBalanceService 의존성이 제거되었고, createGoal 메서드에서 startAmount를 계산하고 GoalConverter에 전달하는 로직이 제거됨.
  • src/main/java/org/umc/valuedi/domain/goal/service/query/GoalLedgerQueryService.java
    • getGoalLedgerTransactions 메서드에서 거래내역 조회 시작 시간을 goal.getCreatedAt() 대신 goal.getStartDate()로 설정하도록 변경됨.
  • src/main/java/org/umc/valuedi/domain/goal/service/query/GoalListQueryService.java
    • AssetBalanceService 의존성이 제거되었고, findGoals 메서드의 조건문이 switch에서 if-else로 변경됨.
    • toSummaryDtos 메서드에서 account.getBalanceAmount()를 직접 사용하여 currentBalance를 계산하고 GoalConverter에 전달하도록 로직이 변경됨.
    • stream().toList() 호출이 stream().collect(Collectors.toList())로 변경됨.
  • src/main/java/org/umc/valuedi/domain/goal/service/query/GoalQueryService.java
    • AssetBalanceService 의존성이 제거되었고, getGoalDetail 메서드에서 account.getBalanceAmount()를 직접 사용하여 currentBalance를 계산하고 GoalConverter에 전달하도록 로직이 변경됨.
Activity
  • 이 Pull Request에는 현재까지 리뷰 코멘트나 추가적인 활동 내역이 없습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

이 Pull Request는 목표 관리 로직을 크게 개선했습니다. 실시간 잔액 동기화 로직(AssetBalanceService)과 GoalLedgerFacade를 제거하고, BankAccount 엔티티에 저장된 balanceAmount를 직접 사용하여 모든 잔액 조회를 처리하도록 변경했습니다. 또한, 목표 달성 기준을 현재 잔액이 목표 금액 이상인 경우로 단순화하고, Goal 엔티티에서 startAmount 필드를 제거했습니다. 전반적으로 코드 단순화 및 리팩토링이 잘 이루어졌습니다.

}

// 시작 시간: 목표의 시작일(startDate)
LocalDateTime from = goal.getStartDate().atStartOfDay();

Choose a reason for hiding this comment

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

medium

이전 로직에서는 from 날짜를 goal.getCreatedAt()goal.getStartDate().atStartOfDay() 중 더 늦은 날짜로 설정했습니다. 현재는 goal.getStartDate().atStartOfDay()로 고정되어 있습니다. 만약 목표가 startDate 이후에 생성되었다면, 이전 로직은 목표 생성 시점부터 거래 내역을 조회했지만, 현재 로직은 startDate부터 조회하게 되어 목표 생성 이전의 거래 내역이 포함될 수 있습니다. 이 변경이 의도된 동작인지 확인이 필요합니다.

@seamooll seamooll changed the title Fix/#114 goal rmsync [FIX/#114] 목표 거래내역 API 동기화 로직 제거 Feb 18, 2026
@seamooll seamooll assigned kkeunii and unassigned kkeunii Feb 18, 2026
@seamooll seamooll added 🔧 enhancement 기존 기능 개선 가은 가은 labels Feb 18, 2026
@@ -1,3 +1,3 @@
package org.umc.valuedi.domain.goal.service;

import jakarta.transaction.Transactional;
Copy link
Contributor

@seamooll seamooll Feb 18, 2026

Choose a reason for hiding this comment

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

현재 GoalStatusChangeServicejakarta 패키지를 사용 중인데, readOnly 같은 스프링의 최적화 기능 활용을 위해 import org.springframework.transaction.annotation.Transactional;로 변경하는 게 좋을 것 같습니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

가은 가은 🔧 enhancement 기존 기능 개선

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FIX] 목표 거래내역 api 동기화 로직 제거

2 participants

Comments