Seat & Group Bookings
Seat bookings enable event types with multiple attendees per time slot — yoga classes, workshops, group sessions.
Seat availability
Section titled “Seat availability”import { computeSeatAvailability, isGroupEvent } from "@thebookingkit/core";
// Check if an event type supports group bookingsisGroupEvent({ maxSeats: 20 }); // trueisGroupEvent({ maxSeats: 1 }); // false
// Compute remaining capacityconst availability = computeSeatAvailability( 20, // maxSeats existingAttendees // SeatAttendee[]);
// Returns: SeatAvailability// { maxSeats: 20, bookedSeats: 12, availableSeats: 8, isFull: false }Reserving seats
Section titled “Reserving seats”import { canReserveSeat, validateSeatReservation, SeatError } from "@thebookingkit/core";
// Quick checkcanReserveSeat(20, existingAttendees, 3); // true if 3+ seats remain
// Full validation (throws SeatError if invalid)validateSeatReservation( 20, // maxSeats existingAttendees, // current attendees "attendee@example.com" // attendee email to validate);Group event summary
Section titled “Group event summary”import { computeGroupEventSummary, formatSeatCount } from "@thebookingkit/core";
const summary = computeGroupEventSummary( "booking-123", // bookingId new Date("2026-03-10T14:00:00Z"), // startsAt new Date("2026-03-10T15:00:00Z"), // endsAt 20, // maxSeats existingAttendees // attendees);
// Returns: GroupEventSummary// { bookingId, startsAt, endsAt, maxSeats, attendees, confirmedCount, cancelledCount }
formatSeatCount(8, 20); // "8 / 20 seats booked"UI component
Section titled “UI component”import { SeatsPicker } from "./components/seats-picker";
<SeatsPicker maxSeats={availability.remainingSeats} selectedSeats={seatCount} onSeatsChange={setSeatCount} pricePerSeat={eventType.priceCents}/>