This PR introduces support for calculating the remuneration of on-call employees considering their timezones.
It is now possible to have a single more complex schedule with engineers located in different parts of the world and exclude the work schedule based on their timezones.
This featured required to add a new parameter (defaultUserTimezone) to define the default user timezone when not found in the PagerDuty API. This is to cover an edge case when there is a user listed in a PagerDuty schedule but for some reason was removed from the PagerDuty (i.e. left the company).
Proof of Work
To exemplify one schedule will be created having the following parameters/configurations:
Price per weekday: £16 (£1 per hour) | weekend/holiday: £32 (£2 per hour)
UK based engineer working from 09:00BST to 17:00BST
Canadian based engineer working from 17:00BST (12:00EDT UTC -4) to 22:00BST (17:00EDT UTC -4)
The report will be generated for 2 weeks, from 12th of September until 23rd of September, having the following schedule:
From the previous version without the timezone feature, the report generated will look like the image below:
The new version of the generated report:
Extra mile
Small refactoring removing the API package dependency completely
Fix known issue regarding users list command using pagination
This was required to avoid hundreds/thousands of API calls to fetch the user timezone, storing the user data in memory cache
Fixed a silent bug in the schedules list pagination that appears only after having 50+ schedules.
Context
This PR introduces support for calculating the remuneration of on-call employees considering their timezones.
It is now possible to have a single more complex schedule with engineers located in different parts of the world and exclude the work schedule based on their timezones.
This featured required to add a new parameter (
defaultUserTimezone
) to define the default user timezone when not found in the PagerDuty API. This is to cover an edge case when there is a user listed in a PagerDuty schedule but for some reason was removed from the PagerDuty (i.e. left the company).Proof of Work
To exemplify one schedule will be created having the following parameters/configurations:
From the previous version without the timezone feature, the report generated will look like the image below:
The new version of the generated report:
Extra mile