Verified buildTypeScriptdomainuiserver

Appointment Booking

src/features/appointment-booking

Patients choose a provider, date, and time slot to reserve an appointment; staff can view, edit, or cancel bookings.

Brick

  • __tests__/

  • domain/

  • host/

  • server/

  • testing/

  • ui/

Host adapter (not part of the brick)

domain/index.ts
1/**
2 * The pure entrypoint: types and logic with no React and no I/O. Importable
3 * from both server and client code.
4 */
5
6export type { Appointment, Provider, Patient, TimeSlot, WaitingListEntry, AppointmentStatus, WaitingListEntryStatus, BookAppointmentInput, GetAppointmentsInput, UpdateAppointmentInput, ISODateTime } from './types';
7export { AppointmentBookingError, NotImplemented } from './errors';
8export type { AppointmentBookingErrorCode } from './errors';
9export { initialAppointmentStatus, canAppointment, transitionAppointment, availableAppointmentEvents, initialWaitingListEntryStatus, canWaitingListEntry, transitionWaitingListEntry, availableWaitingListEntryEvents } from './lifecycle';
10export type { AppointmentEvent, WaitingListEntryEvent } from './lifecycle';
11

Requirements

  • ✓

    REQ-1Successfully books an appointment when provider, patient, and time slot exist and the slot is available

    ✓ [REQ-1] Successfully books an appointment when provider, patient, and time slot exist and the slot is available #1

  • ✓

    REQ-2Rejects booking when the time slot is not available

    ✓ [REQ-2] Rejects booking when the time slot is not available #1

  • ✓

    REQ-3Rejects booking when provider does not exist

    ✓ [REQ-3] Rejects booking when provider does not exist #1

  • ✓

    REQ-4Rejects booking when patient does not exist

    ✓ [REQ-4] Rejects booking when patient does not exist #1

  • ✓

    REQ-5Returns appointments filtered by providerId

    ✓ [REQ-5] Returns appointments filtered by providerId #1

  • ✓

    REQ-6Successfully updates the time slot for an existing appointment

    ✓ [REQ-6] Successfully updates the time slot for an existing appointment #1

  • ✓

    REQ-7Rejects update when the appointment ID does not exist

    ✓ [REQ-7] Rejects update when the appointment ID does not exist #1

  • ✓

    GATE-PORTABLESelf-contained: relative imports only, nothing escapes the brick (R1–R6)

    brick-lint + builder harness

  • ✓

    GATE-CONTRACTVendored host contract is byte-identical (R8)

    sha-256 comparison

  • ✓

    GATE-TYPESTypechecks under the strictest-superset tsconfig

    in-process tsc

  • ✓

    GATE-TESTSShips its own tests and they pass (R12)

    43 passing

  • ✓

    GATE-LIFECYCLE-APPOINTMENTAppointment.status only changes through declared transitions

    22 generated lifecycle tests

  • ✓

    GATE-LIFECYCLE-WAITINGLISTENTRYWaitingListEntry.status only changes through declared transitions

    14 generated lifecycle tests

Built 29/10/2026, 14:41:00 by Ada Lovelace · 43 tests passing · operations by openrouter