Closed AzizPatel786 closed 4 months ago
Ok, I think I should give some background on how all the dates work on stripe:
We have booking_slots
which refer to the date and has a max_bookings
. The way we calculate the availability is:
bookings
collection - which refers to individual bookings made, no date data is stored in there, instead it has a field that refers to an id
of a booking_slot
booking_slot
is: the max_bookings
minus the amount of bookings
pointing to a booking_slot
booking_slot
's id in its metadataThe way we use this with stripe is when we create a checkout session we add an array of dates pointing to the booking_slot
id (serialised as a string with JSON.stringify
) to the metadata.
You will have to get the checkout session and JSON.parse
the metadata to find the relevant checkout session ids that include the now fully booked dates.
Good job,pretty much the right logic,
Visit the preview URL for this PR (updated for commit 11ed293):
https://uasc-ceebc--pr556-530-expire-checkout-6ndmlu9a.web.app
(expires Thu, 11 Jul 2024 22:01:16 GMT)
🔥 via Firebase Hosting GitHub Action 🌎
Sign: 36296ceaed1d43e92e7d5e81a72a7bd987560bfa