Taskana / taskana

Lightweight library for general purpose task management
https://taskana.pro
Apache License 2.0
96 stars 101 forks source link

Enable working day calculation instead of working time calculation #2347

Closed arolfes closed 1 year ago

arolfes commented 1 year ago

Our customer wants the old behaviour to calculate the dueDate from before version 6.0.0 back

Example: actual: ServiceLevel=3 Tage PlanedDate=30.07.2023 (Sunday) -> 31.07.2023 (Monday) DueDate=02.08.2023 (Wednesday)

expected: ServiceLevel=3 Tage PlanedDate=30.07.2023 (Sunday) -> 31.07.2023 (Monday) DueDate=03.08.2023 (Thursday)

affected Version 6.0.2 and following

arolfes commented 1 year ago

To fulfil the needs of other customers we decided to make the behaviour configurable.

You can decide if you want to have precise WorkingTime calculation based on milliseconds or if you want the calculation based on the Day.

arolfes commented 1 year ago

New configuarion property

taskana.workingTime.useWorkingTimeCalculation=true

default value true

When this property is set to true, the Working*Time*CalculatorImpl is used. When this property is false, the Working*Day*CalculatorImpl is used.

The WorkingDayCalculator is a new class and implements the interface WorkingTimeCalculator

We also implement at least the following 3 testcases:

Beispiel 1: ServiceLevel=3 Days PlanedDate=30.07.2023 (Sunday) -> 31.07.2023 (Monday) DueDate=03.08.2023 (Thursday)

Beispiel 2: ServiceLevel=2 Tage PlanedDate=29.03.2024 (Good Friday) -> 02.04.2024 (Tuesday) DueDate=04.04.2024 (Thursday)

Beispiel 3: ServiceLevel=13 Tage PlanedDate=29.03.2024 (Good Friday) -> 02.04.2024 (Tuesday) DueDate=19.04.2024 (Friday one week later)