Creates a new OnCallUser instance.
PagerDuty user ID
User's display name
Array of on-call periods for this user
Unique identifier for the user from PagerDuty.
Display name of the user.
Adds a single on-call period to the user's schedule.
The on-call period to add
Adds multiple on-call periods to the user's schedule.
Array of on-call periods to add
Calculates the total number of out-of-hours weekdays (Monday-Thursday).
Sums up all OOH weekdays across all on-call periods for this user. Each qualifying OOH day on Mon-Thu counts as one unit at £50 compensation.
Total count of OOH weekdays
Calculates the total number of out-of-hours weekend days (Friday-Sunday).
Sums up all OOH weekend days across all on-call periods for this user. Each qualifying OOH day on Fri-Sun counts as one unit at £75 compensation.
Total count of OOH weekend days
Returns a human-readable string representation of the user and their on-call schedule.
Formatted string with user details and all on-call periods
Represents a user and their on-call duty periods with calculated compensation metrics.
This class is the primary data structure for tracking a user's on-call assignments and computing their out-of-hours (OOH) work. It aggregates multiple on-call periods and provides summary statistics for weekday and weekend OOH shifts.
Remarks
The class distinguishes between:
An OOH day is counted when a shift:
Example