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)eventTypeId→EventTypeuserId→User(organizer)title,description,customInputs(JSON of legacy inputs)responses(JSON of new-style booking-fields responses)startTime,endTimestatusenum (ACCEPTED,PENDING,CANCELLED,REJECTED,AWAITING_HOST)paid,paymentrelationlocation,metadata(JSON)recurringEventId,iCalUIDcreatedAt,updatedAt,cancellationReason,rejectionReasonrescheduledFromUid— link to the previous booking when this is a rescheduleattendees(relation),references(relation),seatsReferences(relation)creationSourceenum (API_V1,API_V2,WEBAPP)noShowHostbooleanassignmentReason(relation, captures why this host got the booking)
Related models
Attendee— non-organizer participants. HasbookingId,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.
- Calendars —
BookingReferenceis how Cal.diy remembers which third-party event to update or cancel. - API v2
bookings/2024-08-13module.
Related pages
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.