← Insights

API · 4 min read ·

Calendar provider abstraction for bookings

  • booking
  • providers
  • abstraction

Problem

Booking UIs often pretend to sync with Google before credentials exist, which breaks trust.

Approach

Define CalendarProvider with getAvailability + createBooking. Default to a mock provider with weekday slots, validation, and duplicate-slot prevention. Swap providers via env later.

Result

Implemented at /book and /api/booking with CALENDAR_PROVIDER=mock.

What I learned

Honest mock providers beat fake “synced” calendars. Generate Google/Outlook links from the confirmed booking only.

Related insights

Keep exploring

Ask the grounded assistant about this decision, or open the lab playground.