section-2
Version:
A library for calculating unsocial hours entitlements under the NHS agenda for change's section 2
22 lines • 1.65 kB
TypeScript
import { AdditionalHours, AdditionalHoursParams, Section2Shift } from "../types/section2";
export declare const calculateCumulativeAdditionalHours: (from: Date, shifts?: Section2Shift[], id?: string | number, employment_id?: string | number) => number;
/**
* Calculates Additional hours object containing calculated additional in ms
*
* @param shift - shift parameters for calculating
* @param shift.id - the unique identifier of the shift, optional
* @param shift.from - the Date object representing the start of the shift
* @param shift.planned_to - the Date object representing of the planned end of the shift
* @param shift.actual_to - the Date object representing of the actual end of the shift
* @param shift.employment_id - the unique identifier of the shift's employment, defaults to `undefined`
* @param shift.type - the type of shift, defaults to `"Normal"`
* @param shift.overrun_type - the type of overrun, defaults to `"OT"`
* @param shift.break_override - the duration of the shift's break in ms to override the default of 30mins every 6hrs, defaults to `null`
* @param shift.weekly_hours - the weekly hours contracted in ms
* @param shifts - an array of shifts, used to calculate cumulative additional hours for crossing the 37.5hrs/wk threshold
*
* @returns AdditionalHours
* @returns 0 for all fields if invalid Dates are passed
*/
export declare const calculateAdditionalHours: ({ id, from, planned_to, actual_to, employment_id, type, overrun_type, weekly_hours, break_override, break_from_higher, }: AdditionalHoursParams, shifts: Section2Shift[]) => AdditionalHours;
//# sourceMappingURL=additionalHours.d.ts.map