calcom/cal.com
Event types
Active contributors: Hariom, Pedro, Sean
Purpose
An event type is the basic unit of "something I can be booked for." Every event type is a row in the EventType Prisma model with a slug, a length, scheduling rules, locations, custom fields, and a list of hosts. The dashboard's biggest editor screen is the event-type editor; the public booking page rendering is driven entirely by event-type configuration.
Where it lives
- Schema:
packages/prisma/schema.prisma— theEventTypemodel is one of the largest in the file (dozens of columns plus self-relationparentIdfor managed event types) - Domain code:
packages/features/eventtypes/(lib, services, repositories, di, components) - Repository interface:
packages/features/eventtypes/eventtypes.repository.interface.ts - UI:
apps/web/modules/event-types/andapps/web/app/(use-page-wrapper)/(main-nav)/event-types/ - Custom fields / form-builder:
packages/features/form-builder/ - Translations on event-type strings:
packages/features/eventTypeTranslation/ - App opt-in per event type:
packages/features/feature-opt-in/
Key abstractions
| Concept | Where |
|---|---|
EventType model |
packages/prisma/schema.prisma |
SchedulingType enum (ROUND_ROBIN, COLLECTIVE, MANAGED) |
same file |
PeriodType enum (UNLIMITED, ROLLING, ROLLING_WINDOW, RANGE) |
same file |
| Booking fields (custom inputs) | packages/features/eventtypes/lib/getBookingFields.ts (referenced from many places) |
| Locations (Zoom URL, Google Meet, in-person, ...) | packages/app-store/locations.ts |
| Cal Video settings (recording, transcription) | CalVideoSettings model + packages/features/calVideoSettings |
| Hosts | Host, HostGroup, HostLocation models + packages/features/host |
Important behaviors
- Managed event types. A parent
EventTypepropagates configuration to children for team members. TheparentIdself-relation is the schema mechanism;packages/features/eventtypes/lib/has the propagation logic. - Round-robin / collective.
SchedulingTypecontrols how a booking is assigned to hosts. Round-robin draws fromHost.priorityandHost.weightplus availability; collective books all hosts simultaneously. - Period types. Restrict how far in advance a booking is allowed (
UNLIMITED,ROLLING,ROLLING_WINDOW,RANGE). - Booking fields. Default fields (name, email) plus custom inputs configured by the form-builder. The schema column
bookingFieldsstores Zod-validated JSON. - Locations. A JSON array of allowed locations (e.g., Google Meet, in-person + address, phone). The
packages/app-store/locations.tsmodule is the canonical mapping from location type to user-facing label and to the booking-time logic. - Booking limits.
bookingLimits,durationLimits, andintervalLimitscolumns; checked bypackages/features/bookings/lib/checkBookingLimits.tsandcheckDurationLimits.ts.
Editor UI
The event-type editor is split across apps/web/modules/event-types/ and per-tab components. Tabs include:
- Setup — title, slug, length, description
- Availability — schedule selection, date overrides
- Limits — booking and duration limits
- Advanced — locations, custom inputs, redirects, theming
- Recurring — recurrence rule
- Apps — per-event-type app cards (rendered from
apps.browser.generated.tsx) - Workflows — workflow attachments (legacy EE; being deprecated)
- Webhooks — per-event-type outbound webhooks
Each tab persists via tRPC procedures in packages/trpc/server/routers/viewer/eventTypes/.
Integration points
- Bookings read every relevant field at booking time (length, period, limits, hosts, locations, booking fields, requires-confirmation flag, ...).
- Slots consume schedules and date overrides referenced by the event type.
- Calendars are pulled in two ways: read (from
SelectedCalendar) and write (fromDestinationCalendar). - App store apps register per-event-type cards via
eventTypeAppCardZod.ts.
Entry points for modification
- New column on EventType: edit
packages/prisma/schema.prisma, create a migration, regenerate, update repositories + services, then UI. - New scheduling type: extend the
SchedulingTypeenum, update assignment logic inpackages/features/bookings/lib/getLuckyUser, add UI in the event-type editor. - New per-event-type app card: implement in the app's
components/EventTypeAppCard.tsx, update Zod schema, runyarn app-store:build.
Related pages
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.