Absence durations

The system stores absences in both minutes and days. These values are not directly related as they are calculated by the state of the employee's working pattern at the point of the absence creation.

1. Customer sets both days and minutes

Copy
POST /hr/v2/absencedays
 
Copy
{
   "AbsenceId": "0000-0000-0000-0000-0000",
   "Date": "2022-09-20",
   "DurationDays": 1,
   "DurationMinutes": 480,
   "DayPart": "FullDay"
}

The customer sets both the DurationDays and DurationMinutes.

Pros:

  • Flexibility

  • Business Logic Simplicity

Cons:

  • To match IRIS Cascade, the calculation to convert days to minutes is complicated using the employee's working pattern. See Appendix 2.

2. Customer sets both days and minutes but non-active value is ignored and calculated

When creating or modifying the absence, the user only needs to provide the value required. See Appendix 1 to work out the value needed. The other value is calculated based on the employee's working pattern. See Appendix 2.

Copy
POST /hr/v2/absencedays
 
Copy
{
   "AbsenceId": "0000-0000-0000-0000-0000",
   "Date": "2022-09-20",
   "DurationDays": 1,
   "DurationMinutes": 480,
   "DayPart": "FullDay"
}

The customer sets both the DurationDays and DurationMinutes. The non-active value (see Appendix 1) is ignored and calculated based on the active value.

Pros:

  • Alternate value does not need calculating

Cons:

  • Not obvious which value is needed

Appendix 1 - show in days vs show in minutes

In IRIS Cascade, you can switch an Absence record from displaying in days to minutes and vice versa.

To work out if you should show the Absence in hours for the employee:

Appendix 2 - how IRIS Cascade translates minutes and days

Get working pattern for employee.

Getting minutes from days

Copy
Absence Duration Minutes = Absence Duration Days x Working Pattern Day Duration Minutes

Getting days from minutes