Skip to content

feat: 통화(Currency) 도메인 API 및 외부 환율 연동 배치 구현 (#50)#52

Open
hyun7586 wants to merge 1 commit into
developfrom
feat/#50-currency-domain
Open

feat: 통화(Currency) 도메인 API 및 외부 환율 연동 배치 구현 (#50)#52
hyun7586 wants to merge 1 commit into
developfrom
feat/#50-currency-domain

Conversation

@hyun7586

Copy link
Copy Markdown
Contributor

Related Issues


Type of Change

  • Code / Feature / Bugfix
  • Infrastructure / CI / Build
  • Documentation

Change Summary

Describe what you changed and why in 2-3 lines.

  • Currency, ExchangeRateHistory 핵심 도메인 Entity와 Repository 인터페이스를 구현했습니다.
  • 통화 목록, 단건 상세, 환율 이력 조회, AI 추천용 엔드포인트가 포함된 CurrencyController와 관련 클라이언트 응답용 DTO를 작성했습니다.
  • 외부 API를 연동하여 매일 자정 환율 정보를 자동 갱신하는 @Scheduled 배치 서비스(CurrencySyncService)를 구축했습니다.

Decisions

The reason for choosing this approach. If there is an alternative you considered but discarded, list it with a one-line explanation.

  • 테이블 설계 단순화: 잦은 Join 연산을 피하고 데이터베이스 구조를 최적화하기 위해, Currency 테이블을 단일 통화 코드 기준(암묵적 KRW Base)으로 설계했습니다. (GitHub Discussion 참고)
  • 컨트롤러 캡슐화 엄수: Controller 계층이 순수 라우팅 역할만 하도록 API 요청 처리 로직을 Service로 위임하고 반환 규격을 맞췄습니다.
  • 버그 픽스: BusinessErrorCode 내에 중복 선언되어 컴파일 에러를 유발하던 BRANCH_NOT_FOUND (C106) 코드를 제거했습니다.

Review Points

Areas the reviewer should focus on. Please explain any code or design whose intent is not self-evident here.

  • CurrencySyncService의 매일 자정 스케줄러가 외부 환율 API를 호출할 때 타임아웃(5초)이나 실패 시 기존 데이터를 안전하게 롤백/유지하는지 중점적으로 리뷰해 주시면 좋겠습니다.
  • 인증/인가가 필요 없는 환율 조회 엔드포인트들이므로 명시적으로 모두 @PublicApi 어노테이션을 부착해 두었습니다.

- Currency, ExchangeRateHistory 엔티티 및 Repository 구현

- 프레젠테이션 계층 DTO (CurrencySummary, Detail 등) 작성

- 외부 API 통신용 RestTemplateConfig 및 CurrencySyncService 스케줄러 구축

- 검색, 단건, 히스토리, 추천 API 엔드포인트를 제공하는 CurrencyController 연동

- BusinessErrorCode의 BRANCH_NOT_FOUND 중복 선언 버그 픽스
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.

[Feature] 통화(Currency) 도메인 API 및 외부 환율 연동 배치 구현

1 participant