staywire · spec coverage
237 test titles scanned against 49 user stories (companies/Staywire/02_DEFINE/USER_STORIES.md). Machine-readable: coverage.json · API reference: /docs
26
stories tested
14
built, no citation
9
not built yet
9
GAPs referenced
Measured code coverage (vitest v8, % of functions / lines executed by the suite)
93%
@staywire/corefunctions · 92% lines
73%
@staywire/dbfunctions · 92% lines
46%
@staywire/bookingfunctions · 56% lines
93%
@staywire/emailsfunctions · 100% lines
97%
@staywire/apifunctions · 90% lines
46%
@staywire/adminfunctions · 53% lines
60%
@staywire/bookfunctions · 57% lines
Spec traceability
| Story | Title | Status |
|---|---|---|
| E1 — Platform foundation & multi-tenancy | ||
| US-001 | Tenant isolation on every row1 test titlepackages/db/test/rls.test.ts — cross-tenant isolation (US-001 AC3) | tested |
| US-002 | Double-booking impossibility at the database level2 test titlespackages/core/test/bookings.int.test.ts — DOUBLE-BOOKING RACE (US-002 AC3): two concurrent creates → exactly one 201, one 409 room_unavailablepackages/core/test/bookings.int.test.ts — half-open ranges: back-to-back stays share the boundary day (US-002 AC5) | tested |
| US-003 | Data-model seams for the OTA fast-follow | built · no direct test citation |
| US-004 | Event log as the audit trail1 test titlepackages/db/test/rls.test.ts — event_log is append-only by grants (US-004 AC2) | tested |
| US-005 | Rates resolved per-night at quote time2 test titlespackages/core/test/pricing.test.ts — resolveNightlyRates — per-night resolution at quote time (US-005)packages/core/test/pricing.test.ts — prices each night at its own rate across a seasonal boundary (US-005 AC2 exact values) | tested |
| US-006 | Admin and housekeeping roles | built · no direct test citation |
| E2 — Public API core | ||
| US-007 | Scoped API keys (test + live)1 test titleapps/api/test/api.int.test.ts — auth (US-007) | tested |
| US-008 | Availability search endpoint2 test titlesapps/api/test/api.int.test.ts — blocked room surfaces reason blocked (bookings ∪ blocks — US-008 AC2)packages/core/test/availability.int.test.ts — getAvailability (US-008) | tested |
| US-009 | Quote endpoint with expiry and idempotency3 test titlesapps/api/test/api.int.test.ts — quote → booking → fetch, with Idempotency-Key replay semantics (US-009/US-010)packages/core/test/pricing.test.ts — computeTaxLines — itemized, integer cents (US-009 AC5)packages/core/test/quotes.int.test.ts — createQuote (US-009) | tested |
| US-010 | Booking creation consuming a quote3 test titlesapps/api/test/api.int.test.ts — quote → booking → fetch, with Idempotency-Key replay semantics (US-009/US-010)packages/core/test/bookings.int.test.ts — createBooking (US-010)packages/core/test/bookings.int.test.ts — replays with the same Idempotency-Key return the SAME booking (US-010 AC2) | tested |
| US-011 | Bookings read, modify, cancel over the API3 test titlespackages/core/test/bookings-admin.int.test.ts — listBookings — filters + cursor pagination (US-011/US-049)packages/core/test/bookings-admin.int.test.ts — cancelBooking — policy snapshot + refund (US-011/US-025/US-032)packages/core/test/policies.test.ts — computeRefundCents — policy SNAPSHOT refund math (US-011 AC3) | tested |
| US-012 | Rooms, blocks, and policies over the API3 test titlesapps/api/test/admin.int.test.ts — rooms & blocks CRUD over REST (US-012/US-037/GAP-11)packages/core/test/rooms-blocks.int.test.ts — rooms CRUD (US-012 · US-037)packages/core/test/rooms-blocks.int.test.ts — blocks CRUD (US-012 · US-035 · GAP-11) | tested |
| US-013 | Deterministic errors and structured policy semantics1 test titlepackages/core/test/settings-guests-daysheet.int.test.ts — policies + settings (US-013 · US-038) | tested |
| US-014 | Published OpenAPI spec, versioning, and rate limits2 test titlesapps/api/test/admin.int.test.ts — openapi.json includes the new admin-lane paths (US-014)apps/api/test/api.int.test.ts — serves /openapi.json publicly with all M1 paths (US-014) | tested |
| US-015 | Webhook registration, delivery, and retry3 test titlesapps/api/test/admin.int.test.ts — webhook endpoint management surface (US-015)packages/core/test/notifications.int.test.ts — post-commit webhook fan-out (US-015)packages/core/test/webhooks.test.ts — event fan-out (US-015 catalog) | tested |
| E3 — MCP server & agent surface | ||
| US-016 | Hosted MCP server with the five booking tools3 test titlesapps/api/test/api.int.test.ts — MCP surface (US-016/US-017) — real client over Streamable HTTPapps/api/test/api.int.test.ts — exposes exactly the six tools with schemas + descriptions (US-016 + GAP-14)apps/api/test/api.int.test.ts — REST/MCP parity: identical error codes for the same invalid request (US-016 AC2) | tested |
| US-017 | MCP authentication scoped like API keys2 test titlesapps/api/test/api.int.test.ts — MCP surface (US-016/US-017) — real client over Streamable HTTPpackages/core/test/bookings.int.test.ts — bookings created by an MCP actor record source: agent (US-017) | tested |
| US-018 | Always-free sandbox with test-mode property mirror | built · no direct test citation |
| US-019 | Realistic seeded sandbox inventory | built · no direct test citation |
| US-020 | llms.txt and schema.org markup per property | built · no direct test citation |
| E4 — Guest booking surface | ||
| US-021 | Date-range availability search with calendar | built · no direct test citation |
| US-022 | Room list with photos and itemized total | built · no direct test citation |
| US-023 | Three-click checkout | built · no direct test citation |
| US-024 | Confirmation email with reference and cancellation link1 test titlepackages/core/test/notifications.int.test.ts — confirmation email on booking.created (US-024) | tested |
| US-025 | Self-serve cancellation honoring policy2 test titlespackages/core/test/bookings-admin.int.test.ts — cancelBooking — policy snapshot + refund (US-011/US-025/US-032)packages/core/test/notifications.int.test.ts — cancellation notice on cancel (US-025) | tested |
| US-026 | Native embeddable components with token inheritance1 test titleapps/api/test/admin.int.test.ts — secret-vs-publishable boundary (§4.2 · US-026 AC3) | tested |
| US-027 | Hosted fallback booking page | built · no direct test citation |
| US-028 | Mobile-first forms with no sub-16px inputs | built · no direct test citation |
| E5 — Payments (Stripe Connect) | ||
| US-029 | Stripe Connect onboarding | not built yet |
| US-030 | Per-property payment mode: full, deposit, or card-on-file | not built yet |
| US-031 | Off-session balance and card-on-file charging | not built yet |
| US-032 | Refunds via Stripe1 test titlepackages/core/test/bookings-admin.int.test.ts — cancelBooking — policy snapshot + refund (US-011/US-025/US-032) | tested |
| US-033 | Pricing tiers wired through Stripe fees | not built yet |
| E6 — Admin | ||
| US-034 | Bookings calendar (month/week) | built · no direct test citation |
| US-035 | Manual bookings and date blocks2 test titlesapps/api/test/admin.int.test.ts — manual booking → detail drawer flow (US-035/US-036)packages/core/test/rooms-blocks.int.test.ts — blocks CRUD (US-012 · US-035 · GAP-11) | tested |
| US-036 | Booking detail: modify, cancel, resend1 test titleapps/api/test/admin.int.test.ts — manual booking → detail drawer flow (US-035/US-036) | tested |
| US-037 | Rooms and rates management4 test titlesapps/api/test/admin.int.test.ts — rooms & blocks CRUD over REST (US-012/US-037/GAP-11)packages/core/test/rooms-blocks.int.test.ts — rooms CRUD (US-012 · US-037)packages/core/test/rooms-blocks.int.test.ts — rejects overlapping seasonal ranges with a clear message (US-037 AC2)packages/core/test/rooms-blocks.int.test.ts — rate changes affect FUTURE pricing only — snapshots stay (US-037 AC3) | tested |
| US-038 | Policies, taxes, and property settings3 test titlespackages/core/test/policies.test.ts — POLICY_TEMPLATES (US-038 — exactly three)packages/core/test/settings-guests-daysheet.int.test.ts — policies + settings (US-013 · US-038)packages/core/test/settings-guests-daysheet.int.test.ts — policy change applies to FUTURE quotes only (US-038 AC5) | tested |
| US-039 | Owner notifications: email and webhook | built · no direct test citation |
| US-040 | Bookings CSV export | built · no direct test citation |
| US-049 | Guest lookup4 test titlesapps/admin/test/lib.test.ts — search box → API filter mapping (US-049)apps/api/test/admin.int.test.ts — guest search + detail with booking history (US-049)packages/core/test/bookings-admin.int.test.ts — listBookings — filters + cursor pagination (US-011/US-049)packages/core/test/settings-guests-daysheet.int.test.ts — guest lookup (US-049) | tested |
| E7 — Housekeeping day-sheet & roles | ||
| US-041 | Read-only day-sheet1 test titlepackages/core/test/settings-guests-daysheet.int.test.ts — day-sheet (US-041/042/043) | tested |
| US-042 | Late check-out/check-in flags | built · no direct test citation |
| US-043 | Role-boundary enforcement for housekeeping3 test titlesapps/admin/test/proxy-policy.test.ts — housekeeping role boundary (US-043)apps/api/test/admin.int.test.ts — day-sheet projects the day and leaks no money/contact fields (US-043)packages/core/test/settings-guests-daysheet.int.test.ts — PHYSICALLY excludes rates, totals, payment refs, and guest contact (US-043 AC2) | tested |
| E8 — CSGH cutover & agent-bookability demo | ||
| US-044 | M1: Taylor books a room end-to-end in sandbox | not built yet |
| US-045 | CSGH data migration out of WebRezPro | not built yet |
| US-046 | Replace WebRezPro link-outs with embedded booking | not built yet |
| US-047 | Taylor on production MCP | not built yet |
| US-048 | M4: first live booking and cutover verification | not built yet |