Documentation

Absence Stiching Rules

How Biings stiches absences together upon sychronisation.


Foreword

The absence linking algorithm runs every time Biings synchronises with an absence data source. The different cases where absences are consolidated (merged) or linked together are described below.


🔑 : explains how Biings is able to merge or link both absences (A, B) together.


Case 1

Same cause - an open absence overlaps a closed one.

variant 1

			A    |----------------------- ...
			B                        |-------------|

			variant 2

			A    |----------------------- ...
			B                        |-------------------- ...

🔑   Same rate : B is deleted and a correction message is added to report.

Different rate : B is deleted and an error message is added to report.


Case 2

Different cause - an open absence overlaps a closed one.
variant 1

			A    |----------------------- ...
			B                        |-------------|

			variant 2

			A    |----------------------- ...
			B                        |-------------------- ...

B is deleted and an error message is added to report.


Case 3

Same cause - a closed absence starts before or the same day as another one ends.
variant 1

			A    |------------------|
			B                |--------------|

			variant 2 ( B starts the SAME day as A ends)

			A    |------------|
			B                 |--------------|

🔑   Same rate : B is merged and a correction message is added to report.

Different rate : B’s start date is updated to A’s end date and an error message is added to the report.


Case 4

Different cause - a closed absence starts before or the same day as another one ends.
variant 1

			A    |------------------|
			B                |--------------|

			variant 2 ( B starts the SAME day as A ends)

			A    |------------|
			B                 |--------------|

B’s start date is updated to A’s end date and an error message is added to the report.


Case 5

Same cause - an open absence starts before or the same day as another closed one ends.
variant 1

			A    |------------------|
			B                 |-------------- ... 

			variant 2 ( B starts the SAME day as A ends)

			A    |------------------|
			B                       |-------------- ... 

🔑   Same rate : B is merged and a correction message is added to report.

Different rate : B’s start date is updated to A’s end date and an error message is added to the report.


Case 6

Different cause - an open absence starts before or the same day as another closed one ends.
variant 1

			A    |------------------|
			B                 |-------------- ... 

			variant 2 (B starts the SAME day as A ends)

			A    |------------------|
			B                       |-------------- ... 

B’s start date is updated to A’s end date and an error message is added to the report.


Case 7

Same cause - a closed absence starts exactly one day after another one ends.
A    |------------------|
			B                        |--------------| 

🔑   Same rate :
B is merged into A if consolidate-one-day is enabled.
B is linked to A if link-one-day is enabled.
B is merged into A if both consolidate-one-day and link-one-day are enabled.

Different rate : B is linked to A if auto-linking is enabled otherwise nothing is done.


Case 8

Same cause - an open absence starts exactly one day after another one ends.
A    |------------------|
			B                        |-------------- ... 

🔑   Same rate : A is re-open, B is deleted and a correction message is added to report.

Different rate : B is linked to A if auto-linking is enabled otherwise nothing is done.


Case 9

Same cause - a closed absence is contained into another closed one.
variant 1

			A    |-------------------|
			B         |---------| 

			variant 2

			A    |------------------|
			B    |--------| 

			variant 3

			A    |------------------|
			B             |---------| 

			variant 4

			A    |------------------|
			B    |------------------|

🔑   Same rate : B is merged into A and then deleted and a correction message is added to report.

Different rate : B is deleted and an error message is added to report.


Case 10

Different cause - a closed absence is contained into another closed one.
variant 1

			A    |-------------------|
			B         |---------| 

			variant 2

			A    |------------------|
			B    |--------| 

			variant 3

			A    |------------------|
			B             |---------| 

			variant 4

			A    |------------------|
			B    |------------------|

B is deleted and an error message is added to report.


Case 11

Same cause - a closed absence starts exactly two days after another one ends and these days are Saturday and Sunday (weekend).

Resolves absences that are « cut » during the weekend !

A    |------------------|
			B                          |--------------| 

🔑   Same rate : If consolidate-weekends are enabled, B is merged into A and then deleted and a correction message is added to report otherwise (if consolidate-weekends are NOT enabled) nothing is done.

Different rate : B is linked to A if auto-linking and consolidate-weekends are enabled otherwise nothing is done.