[ Refactor ] - 미분석 거래 일간 소비 분류 배치 구현 - #148
Merged
Merged
Conversation
bigwaveBigwave
requested review from
KSBoscoKim,
Kimd0ng,
SOOsuhyuncho,
hanjyoon01 and
shinh09
August 13, 2026 16:46
22 tasks
hanjyoon01
approved these changes
Aug 14, 2026
shinh09
approved these changes
Aug 14, 2026
This was referenced Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
관련 이슈
작업 사항
미분석 거래 일간 소비 분류 배치 구현
DailyTransactionClassificationScheduler추가TXN_ANALYSIS가 없는 미분석 거래를 최대 500건씩 반복 조회거래 유형별 분석 대상 조회
ORDINARYout_amount > 0INSTALLMENTin_amount > 0LOANout_amount > 0TXN_ANALYSIS가 존재하는 거래는 조회 대상에서 제외Spring 결정적 사전 분류 구현
FastAPI를 호출하기 전에 거래 유형과 명확한 키워드로 결과를 확정하도록
TransactionPreClassificationService를 추가했습니다.LOAN정상 상환TRUEFINANCEFIXEDLOAN신규·실행·증액FALSENULLNULLINSTALLMENT납입TRUEFINANCEFIXEDFALSENULLNULLTRUEETCVARIABLETRUEETCVARIABLETRUEINSURANCEFIXED금융 목적이 명확한 다음 키워드는 비소비 거래 판정에 사용합니다.
다음 표현은 거래 방식이므로 해당 키워드만으로 비소비 처리하지 않습니다.
FastAPI 소비 분류 연동
ORDINARY출금만 FastAPI에 전달desc3 → desc1 → desc2 → desc4순서로 활용할 수 있도록 원본 필드 전달FastAPI 요청 예시:
{ "transactions": [ { "transactionId": 101, "amount": 65000, "transactionCategory": "ORDINARY", "organizationCode": "0004", "desc1": null, "desc2": "FBS출금", "desc3": "KT통신요금", "desc4": "강남지점" } ] }FastAPI 응답 검증 및 fallback
transactionId응답 제외transactionId가 중복 반환되면 해당 결과를 신뢰하지 않고 fallbackcategory,expenseType이 모두 존재하는지 검증category,expenseType이 모두NULL인지 검증TXN_ANALYSIS 저장 계약 확장
account_transaction_id기준 일괄 upsertTXN_ANALYSIS가 생성되지 않은 거래는 다음 배치에서 다시 조회transactionId검증1~500으로 제한참고 사항
ETC는 미분석 상태가 아니라 세부 카테고리를 특정하지 못한 최종 소비 분류 결과입니다.TXN_ANALYSIS가 없는 모든 분석 대상 거래를 처리합니다..idea등 IntelliJ 개인 설정 파일은 커밋 대상에서 제외했습니다.테스트
다음 테스트를 추가하거나 수정했습니다.
TXN_ANALYSIS일괄 upsert SQL 계약 테스트검증 명령:
검증 결과:
추가로 로컬에서 애플리케이션을 실행하여 다음 항목을 확인했습니다.