Fix/Round Robin (#6121)
* Identify owner for a timeslot and check busyness against his schedule only * Fix TS errors * Fix flatmap * Fix xisting unit tests * Prevent duplicate slots by merging, userId -> userIds (multi) * Small fix to potential undefined * Moved duplicate prevention to buildSlots function * Apply date override on a per user basis * Prevent -1 being added to computedLocalAvailability * Removed console.log * Apply override properly on COLLECTIVE * Default timeZone to UTC when undefined * isSame doesn't work when the day shifts, isBetween instead * Iterate over all slot.userIds schedules to identify the first user schedule that matches * add round-robin test Co-authored-by: Alex van Andel <[email protected]> Co-authored-by: Peer Richelsen <[email protected]>
This commit is contained in:
10 files changed
+221
-87
No files matched your search
Vendored
+2
@@ -1,4 +1,5 @@
|
||||
export type TimeRange = {
|
||||
userId?: number | null;
|
||||
start: Date;
|
||||
end: Date;
|
||||
};
|
||||
@@ -15,4 +16,5 @@ export type WorkingHours = {
|
||||
days: number[];
|
||||
startTime: number;
|
||||
endTime: number;
|
||||
userId?: number | null;
|
||||
};
|
||||
Reference in new issue
Block a user