feat: to enable optimized slots (#16579)

* feature to enable optimized slots

* type check (was not caught running locally)

* update for typechecks

* update for type checks

* initialize form

* update slots test for showOptimizedSlots

* added some more tests

* handled edge case

* added test for edge case

* generalized condition

* refactored instead of ternary and added comments

* update condition

* Update apps/web/public/static/locales/en/common.json

Co-authored-by: Carina Wollendorfer <[email protected]>

* moved showOptimizedSlots setting to advanced tab

* updated to always move to next 15min if not possible to next interval

* correct after merge

* chore

* fix typecheck after latest merges

* remove workinghours when dateRanges input

* refactor: extract to fn

* chore

* remove unrelated changes

* remove unrealted change

* updated tests

* unrelated format changes no-verify

* unrelated format changes no-verify

* handle current day booking cases, to show roundedoff minutes

* remove unrelated format changes in openapi.json

* add test for new condition

* remove unrelated auto-format changes

* remove unrelated auto-format changes

* update after merge

* For current day bookings, normalizing the seconds to zero to avoid issues with time calculations

* Update packages/platform/atoms/event-types/hooks/useEventTypeForm.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* update for typecheck due to latest changes

* resolve merge conflicts

* Smaller description

* Minor style change to prefer early return

---------

Co-authored-by: Carina Wollendorfer <[email protected]>
Co-authored-by: Anik Dhabal Babu <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: CarinaWolli <[email protected]>
Co-authored-by: Devanshu Sharma <[email protected]>
Co-authored-by: Volnei Munhoz <[email protected]>
Co-authored-by: Keith Williams <[email protected]>
Co-authored-by: Alex van Andel <[email protected]>
This commit is contained in:
15 files changed
+548 -4

No files matched your search

@@ -1155,6 +1155,7 @@ export class AvailableSlotsService {
minimumBookingNotice: eventType.minimumBookingNotice,
frequency: eventType.slotInterval || input.duration || eventType.length,
datesOutOfOffice: !isTeamEvent ? allUsersAvailability[0]?.datesOutOfOffice : undefined,
showOptimizedSlots: eventType.showOptimizedSlots,
});
let availableTimeSlots: typeof timeSlots = [];