Bank Holidays Sync Job
Bank Holidays Sync Job
Overview
The Direct Debit service relies on accurate UK bank holiday data to power its BACS working-day engine. This engine determines correct collection dates and receipt dates for every mandate — getting them wrong would mean submitting BACS instructions on non-banking days, causing failed or delayed collections.
To keep this data current without manual effort, the service includes an automated bank holidays sync job that runs on a monthly schedule.
How It Works
- Scheduled trigger — An Inngest cron job fires once a month.
- Fetch — The job calls the public gov.uk Bank Holidays API to retrieve the latest holiday data.
- Upsert — Each holiday record is upserted into the
bank_holidaystable. Existing entries are updated if changed; new entries are inserted. No duplicates are created. - Division coverage — All three UK divisions are processed:
- England & Wales
- Scotland
- Northern Ireland
Schedule
| Trigger | Frequency |
|---|---|
| Inngest cron | Monthly |
The monthly cadence ensures the table is always stocked with upcoming holidays well in advance, since the gov.uk API publishes data for multiple years ahead.
Data Source
| Property | Value |
|---|---|
| Provider | UK Government (gov.uk) |
| Endpoint | https://www.gov.uk/bank-holidays.json |
| Format | JSON |
| Licence | Open Government Licence |
Why This Matters for BACS
The BACS payment scheme only processes on UK banking working days — weekends and bank holidays are excluded. The working-day engine uses the bank_holidays table to:
- Calculate collection dates — Advance a requested date to the next valid working day if it falls on a holiday or weekend.
- Calculate receipt dates — Add the standard BACS processing lag (in working days) to derive when funds will arrive.
- Display date pairs on the mandate form — Show tenants exactly when funds will leave their account vs. when they will be received.
Without up-to-date holiday data, these calculations would produce incorrect dates, potentially causing BACS submission failures or misleading tenants about payment timing.
Division Handling
The UK has three separate bank holiday schedules. The sync job processes all three independently and tags each record with its division. The BACS working-day engine can therefore apply the correct holiday set depending on the jurisdiction relevant to a given collection.
| Division | Region |
|---|---|
england-and-wales | England and Wales |
scotland | Scotland |
northern-ireland | Northern Ireland |
No Manual Seeding Required
Prior to this job, bank holiday data required manual database seeding. This job removes that operational burden entirely. When the UK government announces new or amended bank holidays, the next monthly sync will automatically pick up the changes.