[ Bug ] - 정산 기간 계산이 공휴일/주말 근무를 놓치는 문제 수정 (#195) - #196
Merged
Conversation
- DAILY: workDate 하루만 조회하던 걸 다음 영업일 직전까지로 확장 (공휴일/주말 연속 근무도 같은 정산일로 매칭되도록) - WEEKLY: periodEnd 경계일이 공휴일이어도 기간 유지되게 보정 - WEEKLY: settlement_day_of_week 기준으로 예정 정산 요일 역산하도록 변경 (쿠팡이츠처럼 화~금 사이 공휴일로 정산일이 다음주로 밀려도 기간이 안 흔들림) - 관련 테스트 추가, 전체 테스트/컴파일 통과 확인
hanjyoon01
requested review from
KSBoscoKim,
Kimd0ng,
SOOsuhyuncho,
bigwaveBigwave and
shinh09
August 20, 2026 06:27
KSBoscoKim
approved these changes
Aug 20, 2026
shinh09
approved these changes
Aug 20, 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.
관련 이슈
작업 사항
SettlementPeriodCalculator.dailyPeriod:workDate하루만 조회하던 걸workDate ~ 다음 영업일 직전까지로 기간 확장BUSINESS_DAY오프셋 플랫폼(배민커넥트 등)은 순방향으로 보면 다음 영업일직전까지의 비영업일(주말/공휴일) 근무가 전부 같은 입금일로 수렴하는데,
workDate하루만 조회하면 그 구간의 다른 날 근무일지를 놓침extendThroughTrailingNonBusinessDays헬퍼 추가 (CALENDAR_DAY는 그대로 통과)SettlementPeriodCalculator.weeklyPeriod:periodEnd경계일 자체가 공휴일이면 그 전 영업일로 밀려서 경계일이 기간밖으로 빠지던 문제를 같은 헬퍼로 보정
PLATFORM.settlement_day_of_week(쿠팡이츠=FRI, 스키마엔 있었지만 로직에서미사용이던 필드)를 활용해, 실제 입금일이 아니라 원래 예정된 정산 요일
기준으로 오프셋을 역산하도록 변경
금 사이에 공휴일이 껴서 실제 입금이 다음 영업일(보통 다음주 월요일)로금주 화) 자체는 흔들리지 않게 됨밀려도, 정산 기간(전주 수
settlement_day_of_week가 없는 플랫폼은 기존 동작 그대로(하위호환)SettlementPeriodCalculatorTest: 금·토·일 연속근무, 8/17 대체공휴일 실사례,WEEKLY 경계일 공휴일 케이스, 쿠팡이츠 화~금 사이 공휴일로 정산일이
다음주로 밀리는 케이스 테스트 추가
SettlementServiceTest: 기존 공휴일 테스트를 새 동작(공휴일에 일한근무일지도 같은 정산 기간에 매칭돼
COMPLETED로 갱신됨)에 맞게 갱신SettlementBatchCommandClient/LocalSettlementBatchCommandClient/SettlementTestController—/internal/test/settlement/run으로 정산 배치를특정 사용자·날짜로 수동 실행해볼 수 있는 디버그 엔드포인트. 검증 끝나면
같이 지워도 됨(컨트롤러 상단 주석에 정리 대상 명시해둠)
참고 사항
실측 확인 전 - 지금 로직은 며칠이 밀리든 상관없이 항상 예정 요일(FRI) 기준으로
고정 계산하는데, 이게 실제 관찰한 동작과 맞는지 추가 확인 필요
work-service전체 테스트 + 전 모듈 컴파일BUILD SUCCESSFUL확인함