Skip to content

[refactor] LifeExpectancyPolicy의 미사용 minRemainingLife 필드 제거 - #70

Merged
gihhyeon merged 2 commits into
developfrom
chore/remove-min-remaining-life
Sep 7, 2026
Merged

gihhyeon merged 2 commits into
developfrom
chore/remove-min-remaining-life

Conversation

@gihhyeon

@gihhyeon gihhyeon commented Sep 7, 2026

Copy link
Copy Markdown
Member

📌 개요 (why, what)

  • LifeExpectancyPolicy.minRemainingLife(DB 컬럼 min_remaining_life)는 어디에서도 읽지 않는 죽은 코드였습니다.
    • getMinRemainingLife() 호출부가 없고, LifeExpectancyPolicy를 소비하는 유일한 지점인 ResultService.createResult()는 maleExpectancy/femaleExpectancy만 사용합니다.
  • 예상수명 하한선은 이미 ResultService.calculateExpectedLife()에서 입력 나이 + 5년(FLOOR_YEARS_ABOVE_INPUT_AGE = 5)으로 계산되고 있어, 이 필드가 담당하는 역할이 없습니다.
  • 미사용 필드/컬럼을 제거해 정책 엔티티를 실제 로직과 일치시킵니다.

🛠️ 구현 방법 (how)

  • LifeExpectancyPolicy 엔티티에서 min_remaining_life 컬럼 매핑, 필드, Builder 파라미터/대입을 제거했습니다.
  • ResultControllerTest 픽스처에서 .minRemainingLife(...) 를 제거했습니다.
  • 계산 로직 변경은 없으며, ResultControllerTest(9건) 통과를 확인했습니다.
  • ⚠️ DB 컬럼 DROP은 이 PR 범위 밖입니다. ddl-auto: update는 컬럼을 삭제하지 않으므로 dev/prod에 직접 실행이 필요합니다.
    ALTER TABLE life_expectancy_policy DROP COLUMN min_remaining_life;

🤔 검토한 대안과 선택 이유 (trade-off)

대안 장점 단점 선택 여부
필드/컬럼 제거 실제 로직과 스키마 일치, 혼란 제거 DB 컬럼 수동 DROP 필요 ✅
유지 후 하한선 로직을 이 컬럼 기반으로 변경 정책값을 DB에서 관리 현재 요구사항(나이 + 5) 초과, 불필요한 복잡도 ❌

💭 리뷰 포인트

파일/영역 검토 내용 리뷰 요청 사항
LifeExpectancyPolicy 미사용 필드 제거 후 Builder 사용처 영향 없음 다른 사용처 누락 없는지 확인
DB 스키마 dev/prod 컬럼 DROP 필요 배포 시 DROP SQL 실행 주체/시점 합의

📚 Reference (Optional)

🤖 Generated with Claude Code

https://claude.ai/code/session_011grnE3mcEJDkQS3TdDUs4n

예상수명 하한선은 ResultService에서 입력 나이 + 5년으로 계산되어
minRemainingLife 필드/컬럼은 어디서도 읽지 않는 죽은 코드였다.
@gihhyeon
gihhyeon requested a review from kyer5 as a code owner September 7, 2026 09:41
@coderabbitai

coderabbitai Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: 74139b63-20d3-4518-9d15-092a99905eb1


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gihhyeon gihhyeon self-assigned this Sep 7, 2026
@gihhyeon gihhyeon added the ♻️ refactor 리펙터링 이슈 label Sep 7, 2026
@gihhyeon gihhyeon changed the title [chore] LifeExpectancyPolicy의 미사용 minRemainingLife 필드 제거 [refactor] LifeExpectancyPolicy의 미사용 minRemainingLife 필드 제거 Sep 7, 2026
@gihhyeon
gihhyeon merged commit d0274fe into develop Sep 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

♻️ refactor 리펙터링 이슈

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[chore] LifeExpectancyPolicy의 미사용 minRemainingLife 필드/컬럼 제거

2 participants