feat(vacation): 이월연차 만료 시스템 + 대시보드 합산 개선
- createBalance/bulkUpsert에서 CARRY_OVER expires_at 자동 설정 (carry_over_expiry_month 설정 기반, 기본값 2월말) - deductByPriority/deductDays 쿼리에 만료 필터 추가 (expires_at >= CURDATE() 조건, 만료된 이월 차감 제외) - 대시보드 합산에서 만료된 잔액 제외 - DB 보정 완료: CARRY_OVER 8건 expires_at 설정, 황인용/최광욱 소급 재계산 (이월 우선 차감 반영) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -223,6 +223,7 @@ const vacationBalanceModel = {
|
||||
INNER JOIN vacation_types vt ON svb.vacation_type_id = vt.id
|
||||
WHERE svb.user_id = ? AND svb.year = ?
|
||||
AND (svb.total_days - svb.used_days) > 0
|
||||
AND (svb.expires_at IS NULL OR svb.expires_at >= CURDATE())
|
||||
ORDER BY vt.priority ASC, FIELD(svb.balance_type, 'CARRY_OVER', 'AUTO', 'MANUAL', 'LONG_SERVICE', 'COMPANY_GRANT')
|
||||
FOR UPDATE
|
||||
`, [userId, year]);
|
||||
|
||||
Reference in New Issue
Block a user