Repository navigation
feat : PRD A1~A3 반영 (해커톤 레포 이관) 및 리뷰 후속 정리 - #41
Merged
Merged
Conversation
PNU-2026-AI-Hackathon/pnuai-c-07-finfin2#42 (33a2b2c)의 backend/, database/ 변경을 Fin-BE 경로로 옮겼다. - backend/ → 루트, database/db/migration → src/main/resources/db/migration - 충돌 해결: SearchRequestPolicy import (#33의 미사용 List 대신 Set) - 모노레포 전용 변경(.gitignore, api/)은 제외
#32에서 예금 한도가 min/max_deposit_amount로 분리되었는데 PRD A1~A3 이관분은 min_monthly_limit만 비교하고 있었다. - 예금: 예치 원금(단기 예치액, 목돈 월저축액×기간) vs min_deposit_amount - 적금: 월 납입액(단기 예치액÷기간, 목돈 월저축액) vs min_monthly_limit - 파킹: 예치액 vs min_deposit_amount (V8 기준 예금·파킹 공용)
#35의 V8이 먼저 적용된 DB에서 Flyway가 out-of-order 검증으로 기동에 실패하는 문제를 수정한다.
- ProductProperty에 V8 컬럼(max_rate_applicable_min/max_amount, interest_payment_method) 매핑 - 최고금리 적용 한도: 적금 전용 max_monthly_limit 대신 적용 범위 하한/상한으로 응답 - 적용 범위가 없을 때 표시할 최대 예치한도(max_deposit_amount) 함께 응답 - 이자지급방식: "매일" 고정값 대신 공시 원문 사용
- SearchService 정렬 메서드를 package-private static으로 열고 SearchServiceSortingTest에서 직접 호출 (복사한 로직을 검증하던 ShortTermSortingTest 대체, collapseToBestPerProduct와 같은 방식) - 호출처 없는 sortedByAchievableRate와 그 복사본 테스트(탭D) 제거. 파킹 정렬은 ParkingProductServiceTest가 검증 - LongTermSortingIntegrationTest: searchUnified 결과로 탭B 은행(실수령액순)·정부(기여금총액순) 정렬 검증
- MatchScoreService.isGovBankConditionExcluded (PMD UnusedPrivateMethod) - SearchRequestDto/DetailedOptionsDto.effectiveAmount, SearchRequestDto.isShortTerm/isLongTerm(keywords) - ProductCategoryEnum.fromKeyword, KeywordValueEnum.isShortTerm/isLongTerm 실제 대분류 결정은 SearchService.determineCategory(fromSaveTrm(getSaveTrm(keywords)))만 쓰므로 CategoryRoutingTest도 그 경로로 검증하도록 바꿨다.
기존 테스트는 12개월 선택(24·10개월 상품)만, 그것도 "0 초과 20 미만"으로만 확인했다. 1·3·6·12·24·36개월 각각에 대해 바로 앞뒤 구간은 정확 매칭의 정확히 절반, 그 외는 0점인지 검증한다.
distributeWeights(V2)와 distributeTop3Weights가 같은 재분배 로직(미선택 축 가중치를 활성 축에 비례 배분)을 복사해 쓰고 있었다(CPD 27줄 중복). redistributeInactive로 합쳤다. TOP3 재분배는 직접 검증하는 테스트가 없어 리팩터링 전에 특성화 테스트를 추가했다.
This was referenced Oct 26, 2026
Backend Code Health ReportCommit:
Attention
|
yuyeol3
marked this pull request as draft
October 26, 2026 09:06
yuyeol3
marked this pull request as ready for review
November 1, 2026 11:24
Collaborator
|
수고하셨습니다! |
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.
변경점 👍
해커톤 모노레포에서 머지된 PRD A1~A3 작업(PNU-2026-AI-Hackathon/pnuai-c-07-finfin2#42)을 Fin-BE로 옮기고, 원본 PR 리뷰에서 남은 항목까지 이 PR에서 함께 처리했습니다. 후속 PR로 올렸던 #42는 이 PR에 합쳤습니다.
1. PRD A1~A3 이관 (
27c0717)backend/,database/변경을 Fin-BE 경로로 옮겼습니다. 커밋 작성자는 원저자로 유지했습니다.SearchRequestPolicy의 import 한 줄뿐이었습니다. #33에서 추가된List는 쓰이지 않아Set만 남겼습니다..gitignore,api/)은 제외했습니다.2. 저축기간 옵션 마이그레이션 번호 V7 → V9 (
7f525c2)Detected resolved migration not applied to database: 7.(outOfOrder=false기본값)ALTER만 하므로 빈 DB에서category_optionID는 V7일 때와 같습니다.3. 파킹 카드 필드를 V8 컬럼과 연결 (
f12559b)ProductProperty에maxRateApplicableMinAmount,maxRateApplicableMaxAmount,interestPaymentMethod를 매핑했습니다.ParkingProductDto응답 필드 변경 (Fin-FE에는 아직 쓰는 곳이 없습니다)applicableLimitmax_monthly_limit을 읽고 있었음maxRateApplicableMinAmount/MaxAmountmaxDepositAmountinterestPaymentMethod"매일"고정값 대신 공시 원문4. 정렬 테스트 정리 (
b5888aa)ShortTermSortingTest는SearchService의 private 정렬 로직을 테스트 안에 복사해 두고 그 복사본을 검증했습니다. 탭B 은행 정렬의reversed()버그가 다시 생겨도 통과하는 상태였습니다.collapseToBestPerProduct와 같은 방식),SearchServiceSortingTest에서 실제 메서드를 호출합니다.sortedByAchievableRate와 그 복사본을 검증하던 탭D 테스트 3개를 삭제했습니다. 실제 파킹 정렬은ParkingProductServiceTest가 검증합니다.LongTermSortingIntegrationTest를 추가해searchUnified결과로 탭B 정렬을 검증합니다.5. 코드 품질 정리 (
ecc4e99,06b9942,e794334)MatchScoreService.isGovBankConditionExcluded,effectiveAmount2개SearchRequestDto.isShortTerm/isLongTerm(keywords),ProductCategoryEnum.fromKeyword,KeywordValueEnum.isShortTerm/isLongTermfromSaveTrm(getSaveTrm(keywords))경로만 쓰므로CategoryRoutingTest도 이 경로를 검증하도록 바꿨습니다.isAdjacentPeriod분기 29개 중 23개 미검증)MatchScoreService의 V2·TOP3 가중치 재분배 로직이 27줄 그대로 중복돼 있어redistributeInactive로 합쳤습니다. 리팩터링 전에 TOP3 재분배 특성화 테스트 2개를 먼저 추가했습니다.버그 해결 💊
금액 하한 검증을 분리된 예치 한도 컬럼 기준으로 수정 (
0c42380)min_monthly_limit을 같이 쓰던 시점 기준으로 작성됐습니다. #32에서 예금 한도가min/max_deposit_amount로 분리된 뒤로 하한 검증이 잘못 동작했습니다.min_monthly_limit이 null이라 하한 검사가 사실상 꺼져 있었음min_deposit_amount대신min_monthly_limit과 비교normalizedMonthlyDeposit/normalizedDepositPrincipal로 정규화합니다.min_deposit_amountmin_monthly_limitmin_deposit_amountmin_deposit_amount로 검증됩니다. fix : 예적금별 한도 컬럼 분리 #32 이후로 검증되지 않던 부분입니다.단기예치 상품 수에서 파킹통장 중복 집계 수정 (
70e0237)parkingProducts.size())로 세고 있어서 옵션이 여러 개인 상품이 중복 집계됐습니다.distinct해서 셉니다.테스트 💻
./gradlew test(367개),./gradlew integrationTest(125개) 모두 통과합니다.EligibilityBoundaryIntegrationTest예치금 하한 경계 케이스 5개 중 3개 (단기 예금, 단기 적금, 목돈 예금)reversed()버그나 "정부상품을 환산수익률 우선으로 정렬"을 넣으면SearchServiceSortingTest2개,LongTermSortingIntegrationTest2개 실패ddl-auto: validate로 V8 스키마와 일치하는 것을 확인했습니다.bootRunCurrent version: 8 → v9로 적용된 뒤 정상 기동스크린샷 🖼
V8까지 적용된 로컬 DB 복사본으로 서버를 띄우고(V9 적용) Swagger에서
POST /search/products를 호출했습니다. 비로그인 상태라 실수령액 탭(B, C)은 비활성입니다.단기예치 (3개월, 예치액 1천만 원)
category가SHORT_TERM으로 라우팅되고 파킹통장 탭(D)이 활성화됩니다.maxRateApplicableMaxAmount: 300000)월지급목돈만들기 (1년, 월 50만 원)
category가LONG_TERM으로 라우팅되고 적합도순 탭(A)에 정부·은행 상품이 나옵니다.비고 ✏
궁금한 점 있으시면 편하게 질문 주세요!