Skip to content

refactor: Money VO 도입 / #127#128

Merged
JayongLee merged 4 commits intomainfrom
refactor/#127
Feb 23, 2026
Merged

refactor: Money VO 도입 / #127#128
JayongLee merged 4 commits intomainfrom
refactor/#127

Conversation

@JayongLee
Copy link
Member

@JayongLee JayongLee commented Feb 22, 2026

🗞️ 연관된 이슈

🔥 이슈번호

✅ 작업 내용

  • Money VO 도입을 통한 값 안정성 확보 및 에러 감소 효과 기대

📸 스크린샷 (선택)

체크리스트 ✅

  • 코드가 정상적으로 컴파일되나요?
  • merge할 브랜치의 위치를 확인했나요?
  • 테스트 코드를 작성하셨나요?

기타

@JayongLee JayongLee self-assigned this Feb 22, 2026
@JayongLee JayongLee changed the title Refactor: Money VO 도입 / #127 refactor: Money VO 도입 / #127 Feb 22, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @JayongLee, 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는 Money 값 객체(Value Object)를 도입하여 금융 거래의 안정성을 높이고 오류 발생 가능성을 줄이는 것을 목표로 합니다. 이 값 객체는 금액과 통화 관련 로직을 캡슐화하여, 원시 BigDecimal 사용 시 발생할 수 있는 일반적인 문제들을 방지하고 코드의 견고성을 향상시킵니다. 이를 통해 계좌 잔액 관리 및 송금 처리 로직의 안전성과 유지보수성이 개선되었습니다.

Highlights

  • Money 값 객체 도입: 금액과 통화를 캡슐화하는 Money 값 객체(VO)를 새로 추가했습니다. 이 객체는 금액의 유효성 검사, 통화 일치 확인, 그리고 안전한 산술 연산(더하기, 빼기, 비교)을 제공합니다.
  • Account 엔티티 리팩토링: Account 엔티티의 deposit, withdraw, checkSufficientBalance 메서드를 BigDecimal 대신 Money VO를 사용하도록 변경하여, 잔액 관리의 안정성과 일관성을 높였습니다.
  • 금융 거래 로직 업데이트: 입금, 출금, 수수료, 환전 등 다양한 금융 거래 전략 클래스(DepositStrategy, ExchangeStrategy, FeeStrategy, WithdrawalStrategy)와 RemittanceProcessorService에서 Money VO를 활용하도록 로직을 수정했습니다.
  • 단위 테스트 추가: 새로 도입된 Money VO의 기능과 정확성을 검증하기 위한 단위 테스트를 추가하여, 값 객체의 올바른 동작을 보장합니다.
Changelog
  • src/main/java/org/creditto/core_banking/common/vo/Money.java
    • 금액, 통화 및 연산(더하기, 빼기, 이상 여부 확인, 정규화)을 포함하는 Money 값 객체를 추가했습니다.
  • src/main/java/org/creditto/core_banking/domain/account/entity/Account.java
    • Account 엔티티가 deposit, withdraw, checkSufficientBalance 메서드에서 Money VO를 사용하도록 수정했습니다.
    • ACCOUNT_CURRENCY 상수를 추가하고 currentBalance() 헬퍼 메서드를 도입했습니다.
  • src/main/java/org/creditto/core_banking/domain/account/service/strategy/DepositStrategy.java
    • 입금 처리 시 Money 값 객체를 사용하도록 process 메서드를 업데이트했습니다.
  • src/main/java/org/creditto/core_banking/domain/account/service/strategy/ExchangeStrategy.java
    • 출금 처리 시 Money 값 객체를 사용하도록 process 메서드를 업데이트했습니다.
  • src/main/java/org/creditto/core_banking/domain/account/service/strategy/FeeStrategy.java
    • 수수료 처리 시 Money 값 객체를 사용하도록 process 메서드를 업데이트했습니다.
  • src/main/java/org/creditto/core_banking/domain/account/service/strategy/WithdrawalStrategy.java
    • 출금 처리 시 Money 값 객체를 사용하도록 process 메서드를 업데이트했습니다.
  • src/main/java/org/creditto/core_banking/domain/overseasremittance/service/RemittanceProcessorService.java
    • 송금 로직을 리팩토링하여 모든 금액 계산 및 잔액 확인에 Money 값 객체를 통합했습니다.
  • src/test/java/org/creditto/core_banking/common/vo/MoneyTest.java
    • Money 값 객체의 기능과 정확성을 검증하기 위한 단위 테스트를 추가했습니다.
Activity
  • 이 Pull Request는 이슈 #127을 해결합니다.
  • 작성자가 제공한 체크리스트 외에 추가적인 인간 활동(예: 댓글, 리뷰)은 기록되지 않았습니다.
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.

@JayongLee JayongLee linked an issue Feb 22, 2026 that may be closed by this pull request
2 tasks
Copy link
Contributor

@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

The pull request introduces a Money Value Object (VO) to enhance type safety and reduce errors related to monetary operations. This refactoring correctly encapsulates BigDecimal and CurrencyCode within the Money object, ensuring that all monetary calculations are performed with currency awareness and proper scaling. The changes propagate the use of this new VO throughout the Account entity and related transaction strategies, which is a good step towards a more robust domain model. Unit tests for the Money VO have also been added, covering basic arithmetic operations and currency validation.

Copy link
Contributor

@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

The pull request introduces a Money Value Object (VO) to enhance type safety and reduce errors related to monetary operations. This is a good architectural decision. The Money VO correctly handles currency and amount, including normalization for KRW. The changes also integrate this new VO into the Account entity and various transaction strategies, ensuring that monetary operations are now performed using the Money VO instead of raw BigDecimal values. This improves the robustness and clarity of the financial logic.

@JayongLee JayongLee merged commit f7b36ed into main Feb 23, 2026
1 check failed
@JayongLee JayongLee deleted the refactor/#127 branch February 23, 2026 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: Money VO 객체 도입을 통한 값 처리

1 participant