-
Notifications
You must be signed in to change notification settings - Fork 0
Optimize booking workflow and slot reservation pipeline #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -44,7 +44,7 @@ function _isSlotPresentInSchedule({ | |||||
| // Timezones can't be more than 1 day apart, so we can safely assume that previous and next day covers all the dates where a time slot can be present | ||||||
| // We don't want to look up for a slot over all the dates in the schedule data unnecessarily for performance reasons | ||||||
| const dateBefore = dayjs(dateInGMT).subtract(1, "day").format("YYYY-MM-DD"); | ||||||
| const dateAfter = dayjs(dateInGMT).add(1, "day").format("YYYY-MM-DD"); | ||||||
| const dateAfter = dayjs(dateInGMT).add(2, "day").format("YYYY-MM-DD"); | ||||||
|
|
||||||
| // No matter what timezone the booker is in, the slot has to be in one of these three dates | ||||||
| const slotsInIsoForDate = scheduleData.slots[dateInGMT] as Maybe<SlotsInIso>; | ||||||
|
|
@@ -81,7 +81,7 @@ export const isTimeSlotAvailable = ({ | |||||
| const isUnavailableAsPerQuickCheck = | ||||||
| quickAvailabilityChecks && | ||||||
| quickAvailabilityChecks.some( | ||||||
| (slot) => slot.utcStartIso === slotToCheckInIso && slot.status !== "available" | ||||||
| (slot) => slot.utcStartIso === slotToCheckInIso && slot.status === "available" | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. correctness: 🟢 [Standard Reviewer] 🤖 AI Agent Prompt for Cursor/Windsurf
📝 Committable Code Suggestion
Suggested change
|
||||||
| ); | ||||||
|
|
||||||
| if (isUnavailableAsPerQuickCheck) return false; | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correctness: 🟢 [Standard Reviewer]
dateAfteris set to two days afterdateInGMT, causing the slot lookup to miss the correct adjacent day and potentially return false negatives for valid slots.🤖 AI Agent Prompt for Cursor/Windsurf
📝 Committable Code Suggestion