Friday, June 21, 2024
1 change · master
Enhancements to existing features
This change removes shared leave and allocation records for multiple employees and moves those flows to wizard-based creation. It improves accuracy for employees with different schedules, time zones, or local rules by generating individual records instead of forcing one shared request.
Original PR description
Purpose ======= Right now it's possible to take company-, department-, or multi employee leaves in addition to the most often occurring case of single employee leaves. This doesn't really work,…
Purpose ======= Right now it's possible to take company-, department-, or multi employee leaves in addition to the most often occurring case of single employee leaves. This doesn't really work, because stuff like time zones, durations and in the case of exotic localizations even the end date. For example if two employees work different schedules, for example one works part-time while the other one doesn't, giving them both a 1-week vacation results in different durations for the leave, which we currently simply can't handle. This means to support the case of multi-employee leaves, we need a new 'super' model, where you can use a wizard to create a leave 'batch' which will trigger an individual leave per employee. We can add a new menu-item where these batches can be edited after creation (or new employees added for example) but the exact flow of that needs to be discussed. The case for getting rid of multi-employee leaves (which include leaves per company, department or just where multiple people are assigned to the same leave): Currently these multi-employee leaves can't really work because properties like duration that are associated with a leave, can be different for different employees (in the case employees have different work schedules). It complicates the flows of the model. In every method you write, you have to think about the different forms these leaves can be (company/department, multi-employee, single-employee) which makes the code more error-prone. Finally, what is the benefit? When do you ever create leaves for multiple people at the same time? We already have public holidays that you can do per company or per department. And in the relatively rare cases where it could potentially happen, can't they just create individual leaves for each employee (like they are already doing 99% of the time anyway). Leaves are different from allocations, which do in fact get assigned to whole groups of employees and companies regularly or even almost exclusively. With leaves this is probably just not the case. Alternatively, we can still create a wizard that allows you to create a leave for multiple employees at the same time but under the hood, we would then just create individual leaves for each employee. TLDR: multi-employee leaves make the code complex, don't work and don't really have a strong use case that can't already be achieved through other means Specification ============= Move all the multi-employee stuff into specific wizards TaskID: 3323139