v1.2.0 — Conflicts/Opportunities Split + First Unit-Test Suite
🏠 StayOps — v1.2.0
Reclassifies reconciliation flags by business meaning — urgent conflicts isolated from revenue opportunities — and ships the project's first unit-test suite.
What's included
Reconciliation engine reclassification
| Category | Flag types | UI treatment |
|---|---|---|
| Conflicts | duplicate, double_book, price_mismatch |
Top section, severity-ordered (double-book first) |
| Opportunities | gap (2–3 nights) |
Second section, per-row ~$ estimate |
| Orphan nights | orphan_night (1 night, unsellable) |
Transparency footnote count only |
| Intentional vacancy | 4+ night gap | Not flagged |
Dollar-value opportunity estimates
estimated_valuecolumn added toreconciliation_flags(Drizzle migration applied)- Engine computes
gap × base_ratefor each opportunity; page header sums to "~$X recoverable" - Drizzle numeric-string footgun guarded:
Number(estimatedValue)before summing
Dashboard fix
- "Open Flags" card → "Conflicts" card using new
getOpenConflictCountquery - Card is green when zero real conflicts exist (gaps/orphan nights never redden the dashboard)
First unit-test suite
| Fixture | Tests |
|---|---|
double_book overlap |
1 |
duplicate from two channels |
1 |
1-night orphan (no estimatedValue) |
1 |
2-night gap with correct estimatedValue |
1 |
| 4-night gap → no flag (boundary pin) | 1 |
| Multi-property opportunity sum (numeric-string guard) | 1 |
price_mismatch >25% deviation |
1 |
| Back-to-back clean bookings → no flags | 1 |
CI
- New parallel
Unit Testsjob in.github/workflows/ci.yml - Both
Lint & TypecheckandUnit Testsrequired green on every push
Pure classifyBookings refactor
- Detection logic extracted from
runReconciliationinto a pure function (bookings in → flags out, no I/O) runReconciliationis now a thin orchestrator: fetch → classify → filter (idempotency) → insert
Roadmap
v2.0.0— AI agent layer: Claude tool-calling reconciliation agent, weekly ops summary → Slack, turnover auto-generation via Cronv3.0.0— Growth surface: direct-booking landing page, PostHog funnel analytics, lead capture