Skip to content

[ Feature ] - 건당정산(PER_TASK) 잡 방어모드 예상 손실소득 계산 - #181

Merged
hanjyoon01 merged 2 commits into
developfrom
feature/#180
Aug 19, 2026
Merged

[ Feature ] - 건당정산(PER_TASK) 잡 방어모드 예상 손실소득 계산#181
hanjyoon01 merged 2 commits into
developfrom
feature/#180

Conversation

@hanjyoon01

Copy link
Copy Markdown
Contributor

관련 이슈

작업 사항

  • SettlementMapper: 잡별 벌크 조회(findByJobIdInAndDepositDateRangeAndStatus) 추가
  • LocalExpectedIncomeLossQueryClient: monthly_expected_income이 없는 잡(PER_TASK,
    비정기 HOURLY 등)은 조회 시점 기준 최근 3개월(이번 달 제외, 완료된 달만) MATCHED
    정산 평균으로 방어모드 예상 손실소득을 계산하도록 변경
    • 분기 조건은 SettlementType이 아니라 job.getMonthlyExpectedIncome() == null
      일반화함 — "등록 시점에 계산 근거가 있는가"가 실제 기준이라 PER_TASK뿐 아니라
      비정기 HOURLY 잡도 함께 커버됨
    • 데이터가 있는 달만으로 평균 계산 (예: 1개월치만 있으면 그 1개월로 평균)
    • 최근 3개월 정산 이력이 전혀 없으면 기존과 동일하게 손실액 null(계산 불가)
    • JOB.monthly_expected_income 컬럼 자체는 변경 없음 — 등록/수정 로직 그대로,
      조회 시점에만 동적으로 계산 (PER_TASK 실적은 매달 바뀌는데 등록 시점 스냅샷으로
      저장하면 잡을 안 건드리는 한 값이 stale해지기 때문)
  • LocalExpectedIncomeLossQueryClientTest: PER_TASK / 비정기 HOURLY / 혼합 정산방식 /
    스냅샷 우선순위 케이스 테스트 추가

참고 사항

  • 이번 달 정산은 아직 진행 중이라 평균 계산 대상(최근 3개월)에서 제외

JaeYoon added 2 commits August 19, 2026 14:00
- SettlementMapper에 잡별 벌크 조회(findByJobIdInAndDepositDateRangeAndStatus) 추가
- LocalExpectedIncomeLossQueryClient: PER_TASK 잡은 조회 시점 기준 최근 3개월
  (이번 달 제외) MATCHED 정산 평균으로 방어모드 예상 손실소득 계산
  - 데이터 있는 달만으로 평균, 3개월 이력이 전혀 없으면 기존과 동일하게 null
  - JOB.monthly_expected_income 컬럼 자체는 변경 없음 (조회 시점 동적 계산)
- LocalExpectedIncomeLossQueryClient: monthly_expected_income이 없는 잡
  (PER_TASK, 비정기 HOURLY 등)은 조회 시점 기준 최근 3개월(이번 달 제외)
  MATCHED 정산 평균으로 방어모드 예상 손실소득 계산
  - 분기 조건을 SettlementType이 아니라 job.getMonthlyExpectedIncome() == null로
    일반화 (등록 시점에 계산 근거가 있는지가 진짜 기준)
  - 데이터 있는 달만으로 평균, 3개월 이력이 전혀 없으면 기존과 동일하게 null
  - JOB.monthly_expected_income 컬럼 자체는 변경 없음 (조회 시점 동적 계산)
@hanjyoon01
hanjyoon01 merged commit f67da5a into develop Aug 19, 2026
2 checks passed
@hanjyoon01
hanjyoon01 deleted the feature/#180 branch August 19, 2026 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feature 기능 개발

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ Feature ] - 건당정산(PER_TASK) 잡 방어모드 예상 손실소득 계산

3 participants