feat: holiday-calendar blackouts for distribution scheduler (#664) - #795
Open
Bug00Joe wants to merge 1 commit into
Open
feat: holiday-calendar blackouts for distribution scheduler (#664)#795Bug00Joe wants to merge 1 commit into
Bug00Joe wants to merge 1 commit into
Conversation
…g#664) Add HolidayCalendarService that loads a signed static calendar (HMAC-SHA256, fail-closed), applies per-jurisdiction overrides, and shifts distribution windows to the previous/next settleable business day. Overlapping holidays across jurisdictions apply the strictest shift. Emits scheduler.blackout.shift and persists the calendar hash in a holiday_calendar.load audit event.
|
@Bug00Joe Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Overview
This PR adds jurisdiction-aware bank-holiday blackouts for the distribution scheduler. Distribution windows skip blackout days so investor bank rails receive funds on a settleable business day. The calendar is loaded from a signed static file (HMAC-SHA256, fail-closed) with per-jurisdiction overrides and a configurable previous/next shift policy.
Related Issue
Closes #664
Changes
📅 Holiday calendar service
[MODIFY]
src/services/holidayCalendarService.ts{ payload, signature }static file; validates HMAC-SHA256 withtimingSafeEqualbefore applying the calendar.getShiftedDate()shifts to the previous/next settleable business day.scheduler.blackout.shiftand persists the calendar hash in aholiday_calendar.loadaudit event.[MODIFY]
src/services/holidayCalendarService.test.ts— comprehensive unit coverage (36 tests).[MODIFY]
src/services/distributionScheduler.test.ts— metric name + overlap fixture window-key fix.[MODIFY]
docs/holiday-calendar-service.md— security model, shift semantics, env vars, abuse paths.Verification Results
timingSafeEqualbefore decodeoverridesaugment base setholiday_calendar.loadscheduler.blackout.shiftper shiftdirection+jurisdiction_countTimeline