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

StoryTitleStatus
E1 — Platform foundation & multi-tenancy
US-001Tenant isolation on every row
1 test title
packages/db/test/rls.test.ts — cross-tenant isolation (US-001 AC3)
tested
US-002Double-booking impossibility at the database level
2 test titles
packages/core/test/bookings.int.test.ts — DOUBLE-BOOKING RACE (US-002 AC3): two concurrent creates → exactly one 201, one 409 room_unavailable
packages/core/test/bookings.int.test.ts — half-open ranges: back-to-back stays share the boundary day (US-002 AC5)
tested
US-003Data-model seams for the OTA fast-followbuilt · no direct test citation
US-004Event log as the audit trail
1 test title
packages/db/test/rls.test.ts — event_log is append-only by grants (US-004 AC2)
tested
US-005Rates resolved per-night at quote time
2 test titles
packages/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-006Admin and housekeeping rolesbuilt · no direct test citation
E2 — Public API core
US-007Scoped API keys (test + live)
1 test title
apps/api/test/api.int.test.ts — auth (US-007)
tested
US-008Availability search endpoint
2 test titles
apps/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-009Quote endpoint with expiry and idempotency
3 test titles
apps/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-010Booking creation consuming a quote
3 test titles
apps/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-011Bookings read, modify, cancel over the API
3 test titles
packages/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-012Rooms, blocks, and policies over the API
3 test titles
apps/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-013Deterministic errors and structured policy semantics
1 test title
packages/core/test/settings-guests-daysheet.int.test.ts — policies + settings (US-013 · US-038)
tested
US-014Published OpenAPI spec, versioning, and rate limits
2 test titles
apps/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-015Webhook registration, delivery, and retry
3 test titles
apps/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-016Hosted MCP server with the five booking tools
3 test titles
apps/api/test/api.int.test.ts — MCP surface (US-016/US-017) — real client over Streamable HTTP
apps/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-017MCP authentication scoped like API keys
2 test titles
apps/api/test/api.int.test.ts — MCP surface (US-016/US-017) — real client over Streamable HTTP
packages/core/test/bookings.int.test.ts — bookings created by an MCP actor record source: agent (US-017)
tested
US-018Always-free sandbox with test-mode property mirrorbuilt · no direct test citation
US-019Realistic seeded sandbox inventorybuilt · no direct test citation
US-020llms.txt and schema.org markup per propertybuilt · no direct test citation
E4 — Guest booking surface
US-021Date-range availability search with calendarbuilt · no direct test citation
US-022Room list with photos and itemized totalbuilt · no direct test citation
US-023Three-click checkoutbuilt · no direct test citation
US-024Confirmation email with reference and cancellation link
1 test title
packages/core/test/notifications.int.test.ts — confirmation email on booking.created (US-024)
tested
US-025Self-serve cancellation honoring policy
2 test titles
packages/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-026Native embeddable components with token inheritance
1 test title
apps/api/test/admin.int.test.ts — secret-vs-publishable boundary (§4.2 · US-026 AC3)
tested
US-027Hosted fallback booking pagebuilt · no direct test citation
US-028Mobile-first forms with no sub-16px inputsbuilt · no direct test citation
E5 — Payments (Stripe Connect)
US-029Stripe Connect onboardingnot built yet
US-030Per-property payment mode: full, deposit, or card-on-filenot built yet
US-031Off-session balance and card-on-file chargingnot built yet
US-032Refunds via Stripe
1 test title
packages/core/test/bookings-admin.int.test.ts — cancelBooking — policy snapshot + refund (US-011/US-025/US-032)
tested
US-033Pricing tiers wired through Stripe feesnot built yet
E6 — Admin
US-034Bookings calendar (month/week)built · no direct test citation
US-035Manual bookings and date blocks
2 test titles
apps/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-036Booking detail: modify, cancel, resend
1 test title
apps/api/test/admin.int.test.ts — manual booking → detail drawer flow (US-035/US-036)
tested
US-037Rooms and rates management
4 test titles
apps/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-038Policies, taxes, and property settings
3 test titles
packages/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-039Owner notifications: email and webhookbuilt · no direct test citation
US-040Bookings CSV exportbuilt · no direct test citation
US-049Guest lookup
4 test titles
apps/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-041Read-only day-sheet
1 test title
packages/core/test/settings-guests-daysheet.int.test.ts — day-sheet (US-041/042/043)
tested
US-042Late check-out/check-in flagsbuilt · no direct test citation
US-043Role-boundary enforcement for housekeeping
3 test titles
apps/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-044M1: Taylor books a room end-to-end in sandboxnot built yet
US-045CSGH data migration out of WebRezPronot built yet
US-046Replace WebRezPro link-outs with embedded bookingnot built yet
US-047Taylor on production MCPnot built yet
US-048M4: first live booking and cutover verificationnot built yet