Built with stubsTypeScriptdomainserver

Desk Booking

src/features/booking2

Members reserve a desk for a day; admins approve or cancel.

Brick

  • __tests__/

  • domain/

  • host/

  • server/

  • testing/

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 { Booking, BookingStatus, BookDeskInput, CancelDeskInput, ISODateTime } from './types';
7export { Booking2Error, NotImplemented } from './errors';
8export type { Booking2ErrorCode } from './errors';
9export { initialBookingStatus, canBooking, transitionBooking, availableBookingEvents } from './lifecycle';
10export type { BookingEvent } from './lifecycle';
11

Requirements

  • ✓

    REQ-1A desk can be booked once per day.

    ✓ [REQ-1] A desk can be booked once per day. #1

  • ✓

    REQ-2A desk cannot be double-booked.

    ✓ [REQ-2] A desk cannot be double-booked. #1

  • !

    REQ-3A desk booking can be cancelled.

    … [REQ-3] A desk booking can be cancelled. #1 (not implemented: slot cancelDesk) · cancelDesk was not implemented within budget.

  • ✓

    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)

    10 passing

  • ✓

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

    8 generated lifecycle tests

Built 29/10/2026, 14:22:49 by Ada Lovelace · 10 tests passing · operations by openrouter