Skip to content

v1.2.0 — Conflicts/Opportunities Split + First Unit-Test Suite

Choose a tag to compare

@deepan-mehta-analytics deepan-mehta-analytics released this 30 May 14:09

🏠 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_value column added to reconciliation_flags (Drizzle migration applied)
  • Engine computes gap × base_rate for 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 getOpenConflictCount query
  • 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 Tests job in .github/workflows/ci.yml
  • Both Lint & Typecheck and Unit Tests required green on every push

Pure classifyBookings refactor

  • Detection logic extracted from runReconciliation into a pure function (bookings in → flags out, no I/O)
  • runReconciliation is 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 Cron
  • v3.0.0 — Growth surface: direct-booking landing page, PostHog funnel analytics, lead capture