-
Notifications
You must be signed in to change notification settings - Fork 4
Applying business days and public holidays
When we send emails to visitors. we let them know how long it should take to review their booking request. To do this effectively, we need to take into account working days and also public holidays.
We use a yml file to configure the business days that the service support in lib/calendars which is based on GitHub - gocardless/business: Ruby business day calculations.
The corresponding yml file https://github.com/ministryofjustice/prison-visits-2/blob/feature/upgrade-to-rails-7.1.2/lib/calendars/bacs.yml
This yml file currently supports bank holidays up to 2027 and it could be further modified for each calendar year as needed.
Here is the definition of which yml file the gem will use https://github.com/ministryofjustice/prison-visits-2/blob/main/config/initializers/calendar.rb
This is where the calendar object is been used https://github.com/ministryofjustice/prison-visits-2/blob/main/app/models/prison.rb#L109
Other information may also be found in the PVB Public application wiki