# Tasks — Add @suaveplan/booking ## 1. Spec authoring - [x] 1.1 Read `../suaveplan/enterprise/booking.md` end-to-end - [x] 1.2 Read `openspec/specs/booking/spec.md` (does not exist — new package) - [x] 1.3 Read `openspec/AGENTS.md` Sections 13 and 14 - [x] 1.4 Draft `proposal.md` from `openspec/templates/proposal.md` - [x] 1.5 Fill in `## Source mapping` table - [x] 1.6 Draft `specs/booking/spec.md` from `openspec/templates/spec-delta.md` - [x] 1.7 Every requirement in the spec delta carries a `**Verified by:**` line naming concrete `it(...)` titles ## 2. Implementation - [x] 2.1 Scaffold `packages/security/booking/` (package.json, tsconfig.lib.json, vite.config.ts, vitest.config.ts, tests/setup/polyfills.ts) - [x] 2.2 Implement `src/error-codes/` — `BOOKING_CODES` registry + `BookingError` class with discriminants - [x] 2.3 Implement `src/types/` — every public type module verbatim (bookable, booking, booking-hooks, capacity, config, events, layout, pricing, rules, temporal) - [x] 2.4 Implement `src/hooks/` — in-package `Hooks` with sync/async/result variants + types - [x] 2.5 Implement `src/utils/` and `src/constants/` - [x] 2.6 Implement `src/temporal/` — windows, recurrence, slots - [x] 2.7 Implement `src/conflict/` — detector registry + 4 built-ins - [x] 2.8 Implement `src/pricing/` — calculator, seasonal, dynamic - [x] 2.9 Implement `src/rules/` — evaluator + condition factories - [x] 2.10 Implement `src/availability/` — resolver registry + 3 strategies - [x] 2.11 Implement `src/domains/` — base + 6 preset factories - [x] 2.12 Implement `src/schemas/` — Zod schemas for entities + config - [x] 2.13 Implement `src/core/` — engine, state-machine, event-bus - [x] 2.14 Write root `src/index.ts` with explicit named re-exports - [x] 2.15 Write per-feature `index.ts` barrels with explicit named re-exports ## 3. Tests - [x] 3.1 Unit tests per feature module covering every scenario in the spec delta - [x] 3.2 Spec-conformance: `src/conformance.spec-conformance.test.ts` pinning barrel + subpath + tier-purity invariants - [x] 3.3 Every `it(...)` carries `{ timeout: 5000 }` - [x] 3.4 Every test imports runner primitives from `@suaveplan/testing/runner` ## 4. Documentation - [x] 4.1 Sibling `.md` for every implementation `.ts` (≥200 words, basic + advanced examples, full API reference) - [x] 4.2 README at package root linking every co-located `.md` under `## Modules` - [x] 4.3 Update root `STATUS.md`, `MANIFEST.md`, `MISSING.yml`, `SUMMARY.md` for `@suaveplan/booking` ## 5. Pre-archive verification (5-gate triple) - [x] 5.1 `bun run check` / `bunx biome check` - [x] 5.2 `bunx turbo lint typecheck test --filter=@suaveplan/booking` - [x] 5.3 `bunx turbo test:coverage --filter=@suaveplan/booking` — 100/100/100/100 - [x] 5.4 Spec-conformance: every requirement in spec.md has a real test that pins it - [x] 5.5 `bunx turbo build --filter=@suaveplan/booking` ## 6. Pre-archive 9-row checklist - [x] 6.1 Generics threaded (`BookingEngine`, `Hooks`) - [x] 6.2 Zod schemas wired at every declared boundary - [x] 6.3 Every error code in `BOOKING_CODES` thrown by at least one production path - [x] 6.4 N/A — no strict-mode toggle in this package - [x] 6.5 N/A — OTel observability surface deferred per Out of Scope - [x] 6.6 N/A — no lifecycle dedup primitives in this surface - [x] 6.7 No retroactive tick — every box reflects work done in this change - [x] 6.8 No `export *` in any feature-module barrel - [x] 6.9 No direct `vitest` / `bun:test` imports in test files ## 7. Archive - [x] 7.1 Fold spec delta into `openspec/specs/booking/spec.md` - [x] 7.2 Move `openspec/changes/add-booking/` → `openspec/archive/2026-05-17-add-booking/` - [x] 7.3 Refresh `MANIFEST.md` via `bun scripts/folder-reorg/generate-manifest.ts` - [x] 7.4 Refresh `MISSING.yml` via `bun scripts/generate-missing.ts`