Open-Source Wikis

/

Cal.com

/

Primitives

/

Booking

calcom/cal.com

Booking

A confirmed (or pending) reservation against an EventType. The Booking Prisma model in packages/prisma/schema.prisma is the pipeline's terminal record — by the time a row exists, the calendar event has been created and the attendees have been notified.

Schema highlights

  • id, uid (public-facing UUID, used in URLs)
  • eventTypeIdEventType
  • userIdUser (organizer)
  • title, description, customInputs (JSON of legacy inputs)
  • responses (JSON of new-style booking-fields responses)
  • startTime, endTime
  • status enum (ACCEPTED, PENDING, CANCELLED, REJECTED, AWAITING_HOST)
  • paid, payment relation
  • location, metadata (JSON)
  • recurringEventId, iCalUID
  • createdAt, updatedAt, cancellationReason, rejectionReason
  • rescheduledFromUid — link to the previous booking when this is a reschedule
  • attendees (relation), references (relation), seatsReferences (relation)
  • creationSource enum (API_V1, API_V2, WEBAPP)
  • noShowHost boolean
  • assignmentReason (relation, captures why this host got the booking)
  • Attendee — non-organizer participants. Has bookingId, email, name, timeZone, locale, phoneNumber.
  • BookingReference — third-party event identifiers (integration: "google_calendar", meetingId, meetingUrl, ...). One per external system the booking touches.
  • BookingSeat — used when the event type allows multiple seats per slot.
  • Payment — paid bookings link here for Stripe / PayPal / HitPay receipts.
  • HashedLink — booking made through a private/one-time URL.

Status transitions

stateDiagram-v2
    [*] --> PENDING: requiresConfirmation = true
    [*] --> ACCEPTED: requiresConfirmation = false
    PENDING --> ACCEPTED: organizer confirms
    PENDING --> REJECTED: organizer rejects
    ACCEPTED --> CANCELLED: cancelled by booker or organizer
    AWAITING_HOST --> ACCEPTED: host accepts (round robin)

Where it lives in code

Concern File
Repository packages/features/bookings/repositories/BookingRepository.ts (2,140 lines)
Pipeline orchestrator packages/features/bookings/lib/service/RegularBookingService.ts
Handler entry packages/features/bookings/lib/handleNewBooking/
Cancellation packages/features/bookings/lib/handleCancelBooking/
Confirmation packages/features/bookings/lib/handleConfirmation/
Seat handling packages/features/bookings/lib/handleSeats/
Audit log packages/features/booking-audit/
Bookings list UI apps/web/modules/bookings/, packages/features/bookings/components/

How it's created

See the sequence diagram in features/bookings.

Consumers

  • Bookings feature
  • Webhooks and tasker — every status transition emits at least one webhook + zero or more tasker jobs.
  • CalendarsBookingReference is how Cal.diy remembers which third-party event to update or cancel.
  • API v2 bookings/2024-08-13 module.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Booking – Cal.com wiki | Factory