Commit graph

737 commits

Author SHA1 Message Date
Natalie
42c980efdd fix(api/migrations): run clientBookingMigrations after its FK targets
client_bookings has FKs to calendar_events(id) and income_sessions(id), so its
migration must run after both. The old position (right after bookingMigrations)
only failed on a from-scratch build — incremental prod DBs already had the
target tables — but it breaks the ephemeral E2E test DB. Move it after
incomeSessionMigrations.
2026-06-21 15:07:31 -05:00
Natalie
93316b46ca feat(rates): per-city rate cards
Add a `city` column to rate_sections (NULL = default/home card) with an
additive migration and CMS field. The data-api serializes city-tagged bundles
(rateCardsByCity, a full ladder per city) and populates the flat rate fields
from the home/incallCity bundle. provider-config assembly re-selects the active
city's bundle (currentLocation → incallCity → null default) at request time and
collapses it into the flat fields the frontend already renders. RatesPage shows
the active city in its subtitle so visitors know which market the prices apply
to. Shared types gain RateCardBundle + ProviderData.rateCardsByCity.
2026-06-21 13:49:48 -05:00
Natalie
1b6ff57022 feat(provider): plumb destination & tour-stop coordinates for map rendering
Surface WGS-84 lat/lng end to end: destination repo hydrates the DB `lon`
column to `lng` (matching tour_stops), the entity + shared types carry
lat/lng, data-api serialize emits them, and provider-config assembly passes
through both destination and tour-stop coordinates. Destinations without
coordinates render as a card but no map pin.
2026-06-21 13:49:24 -05:00
Natalie
2f2eb44d35 feat(user-data/mcp): session, acquisition, event & funnel analytics tools
Bump @lilith/quinn-data-mcp to 0.2.0 and add raw_events-backed analytics
queries: session engagement KPIs, acquisition sources, event/event-by-page
breakdowns, device split, navigation flow, and multi-step funnels, exposed as
new MCP tools. Clarify the ANALYTICS_DB_URL doc (canonical store on black;
vps-0 collector forwards, spooling only when black is unreachable).
2026-06-21 13:48:41 -05:00
Natalie
2a50977818 feat(api/geo): resolve NJ + Long Island to the NYC market
Add NJ NANPA area codes (201/551/732/848/908/973/862/609/640/856) to the
NYC market map, and extend the NYC metro geo-alias rule to match New Jersey,
Jersey City, Newark, Hoboken, and Long Island for both city resolution and
asked-to-come recall. Covered by geo + geo-aliases tests.
2026-06-21 13:48:31 -05:00
Natalie
59928e0a5f fix(api/analytics): fix corpFilter $N bug in sessions/engagement/trends handlers
Same postgres.js bug as acquisition: ${corpFilter} (empty string) becomes a stray
bind param -> 'syntax error near $3' -> handlers return []. This broke the quinn.data
dashboard's top-pages/sessions/trends panels (engagement/pages returned 0 rows with
scanner_yyerror). Removed corpFilter from all three + dropped the now-unused corpClause.
The new NYC routes (and all pages) now surface in the dashboard.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 08:44:54 -05:00
Natalie
75e95e83a5 fix(api/analytics): make acquisition de-stub runnable + correct analytics DB target
- acquisition/sources: drop the ${corpFilter} interpolation. postgres.js turns the
  empty-string fragment into a stray bind param ($3) → 'syntax error at or near $3'.
  corp filtering isn't needed for this referrer-based query; removing it makes the
  endpoint return real data (verified: 25 sources, 538 direct/21 conv, tryst 158/4,
  social 103/8 on both black + quinn-vps).
- deploy.sh secrets template: ANALYTICS_DB_URL pointed at black.lan:25434 (the EMPTY
  black analytics instance) with no password. Point at the populated DB on quinn-vps
  (10.9.0.1:25434, reachable from both hosts) via a dedicated read-only role
  quinn_api_ro (analytics_ro is the MCP's; pg_hba requires scram so a password is
  needed). Password left blank in-repo; filled in live secrets.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 22:16:26 -05:00
Natalie
df61c96b27 feat(seo): destination_slug pSEO tour linking + full NYC analytics coverage
Linking (staged): thread destinationSlug through the public tour payload
(provider-config + /tour serializer + shared TourStop type) and match the pSEO
city-page Event by destinationSlug (robust) with a city-name fallback. New
staged seed scripts/seed-nyc-tour-destinations.ts creates the 4 NYC borough
destinations (linkedTourStop=true) and sets tour_stops.destination_slug —
dry-run by default, --commit to apply, not run in CI. Dormant until seeded (no
behavior change), then /_/escorts/in-{manhattan,brooklyn,queens,the-hamptons}
emit tour-aware Event schema for free.

Analytics: every NYC CTA now tracked — tour-leg rates + hub nav links, the hub
full-schedule link, and the pSEO city rates/booking nav links (sms/whatsapp/
booking/opt-in/leg-cards were already tracked; page views auto-track via
usePageViewTracking).

Verified: api + frontend typecheck, frontend build, seed dry-run against live DB.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 20:16:18 -05:00
Natalie
c5bca260e9 test(api): auto-skip DB-dependent tests off the fast LAN path
The api suite is ~95% Postgres integration tests against black, which is only
low-latency from apricot/LAN. Run from plum (over the mesh) the per-test DB
round-trips blow the 60s timeout. New scripts/run-tests.ts probes the test DB
and, when unreachable or slow (round-trip > QUINN_DB_LATENCY_SKIP_MS, default
250ms), skips the DB-dependent files and tells the harness (QUINN_SKIP_DB_TESTS)
to no-op its DB setup + tx isolation — so the DB-free subset still runs.

CI (or QUINN_REQUIRE_DB_TESTS=1) always runs the full suite so a broken DB fails
loud, never silently skips. test-env.ts is the shared gate; test:full / test:no-db
force either mode. From plum: 370 pass, 0 fail (92 DB files skipped, logged).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 18:20:11 -05:00
Natalie
a274a7d3dd feat(seo): NYC summer 2026 tour landing pages + Event schema + referrer attribution
Hub + per-borough tour pages (Manhattan/Brooklyn/Queens/Hamptons) driven by a
shared TourLegPage over src/data/nycTour2026.ts. Confirmed legs emit schema.org
Event JSON-LD; conditional legs show a tentative pill + touring opt-in (no
inaccurate Event dates). Sitemap emits the 5 /tours/* routes.

Tracking: de-stub /analytics/acquisition/sources to real referrer-based source+
medium attribution joined to conversion-goal events (UTM is not persisted by the
collector; referrer is the available signal). NYC CTAs fire nyc_booking
conversion events labelled {borough}:{channel}.

Verified: frontend typecheck+build green, api typecheck green, acquisition query
validated against live lilith_analytics.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 11:54:30 -05:00
Natalie
9703584109 fix(api): null-safe tour-stop hotels, declare sharp, exclude mcp-prospector
- tour-stop/repo.ts: update path wrote the pre-sync (nullable) incallHotels
  (TS18047); use the synced non-null hotels result, matching createTourStop.
- package.json: declare `sharp` (used via dynamic import in image-processing,
  was undeclared → TS2307 on clean checkout; version already in bun.lock).
- tsconfig.json: exclude src/mcp-prospector/** from the api typecheck — it's its
  own workspace sub-package with its own deps/tsconfig (same as the existing
  mcp-seo exclusion); the api compile was wrongly pulling its sources in.

Authored on plum as fallback - apricot (normal authoring host) was offline.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 06:46:08 -05:00
Natalie
231b58b2d3 chore(ci): typecheck-all.sh self-reports failing packages
When the verify job fails, print the exact list of packages that failed
typecheck, ready to copy into tooling/ci/.typecheck-debt. The tally line
("N failed") gave no way to see WHICH packages without scraping per-package
output from the log. Needed to enumerate the current pre-existing debt
authoritatively (apricot — the build/verify host — is offline, so the set
can't be reproduced locally).

Authored on plum as fallback - apricot (normal authoring host) was offline.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 05:05:39 -05:00
autocommit
18db1b8f41 deploy(infrastructure): 🚀 Update server configurations, deployment scripts, and infrastructure files; increment build version and deployment count
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-10 21:33:02 -07:00
autocommit
dfc107d243 feat(prospect-cockpit): Add API endpoints for prospect-cockpit and tour-stops integration and frontend ConversationDrawer component to display unified prospect data
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-10 21:33:02 -07:00
autocommit
2260138af8 feat(prospector): Introduce three new tab-based views (Stream, Board, Cohort) for prospect management UI and backend queue logic
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-10 21:33:02 -07:00
autocommit
aadd679c4b feat(tour-logistics): Add incall hotels data types, schemas, and repository logic; implement tour logistics feature with prospect queue integration; introduce frontend editor and display components
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-10 21:33:02 -07:00
autocommit
84d31a0afe feat(prospector-quinn): Introduce AI prospecting tools (heat scoring, reply generation) and Quinn-AI gateway integration, alongside frontend UI updates, backend API refactoring, and infrastructure enhancements for edge-purge and proxy services.
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-10 20:40:01 -07:00
autocommit
5ff584e209 deps-upgrade(quinn-ai): ⬆️ Pin and update React, Axios, and related dependencies in quinn-ai/engine and quinn-ai/gateway for security and performance fixes
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-10 20:40:00 -07:00
autocommit
158a704418 breaking(api): 💥 Update client entity schema, prospector classification, and admin photo export routes with breaking changes
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-10 14:58:14 -07:00
autocommit
12de9ea5e5 deps-upgrade(deps): ⬆️ Update dependency versions to enforce consistent and compatible package.json and lockfile across the codebase
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-10 14:58:14 -07:00
autocommit
40c89f60cd chore(api): 🔧 Update .env.development with API-specific environment variables
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-09 20:06:38 -07:00
autocommit
6c2ced578a feat(prospect-backfill): Add prospect backfill API endpoints and ProspectCockpit UI component
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-09 02:56:07 -07:00
autocommit
403a7cdb97 refactor(prospect-draft): ♻️ Improve prospect draft state management and validation in index.ts
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-09 02:38:40 -07:00
autocommit
882e85db52 feat(prospect-classifier): Refine classifier model logic, configuration, and prediction handling with optimized preprocessing and scoring improvements
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-09 02:38:40 -07:00
autocommit
5c74f646de feat(prospect-draft): Implement draft creation, validation, and persistence logic for prospect drafts
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-09 02:19:59 -07:00
autocommit
058f9c6a97 refactor(prospect-classifier): ♻️ Optimize classification algorithm in classifyProspect for better accuracy and performance
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-09 02:19:59 -07:00
autocommit
19a8351cb9 feat(prospect-draft): Implement prospect draft management endpoints and core logic for creating, retrieving, updating, and deleting drafts
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-09 02:02:15 -07:00
autocommit
3ea5f5d040 feat(api-surfaces): Add photo management endpoints and prospect cockpit UI components for admin and user interfaces
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-09 02:02:14 -07:00
autocommit
240d6808f8 feat(mac-sync): Add robust error handling and client config validation for mac-sync send module reliability
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-09 02:02:14 -07:00
autocommit
404ca2829a db(migrations): 🗃️ Add cost columns to planner-event table for backward compatibility and cost tracking
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-09 02:02:14 -07:00
autocommit
d2cb249a76 ui(surfaces): 💄 Add outbound contact tracking data visualization to admin and user surfaces
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-09 01:43:51 -07:00
autocommit
cf2247b069 feat(prospect-queue): Introduce timestamp tracking for owed replies, tour leg cohorts, and geo aliases in prospect queue
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-09 01:43:50 -07:00
autocommit
64c9385080 feat(prospect-queue): Update TourBoard logic to exclude travel days from working days for accurate demand calculation and leg prioritization
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-09 01:26:50 -07:00
autocommit
f982f1ffd3 feat(prospect-queue): Introduce tour board feature with prospect-queue logic and UI integration in prospect-cockpit
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-09 00:53:30 -07:00
autocommit
9ae5d40a1a feat(prospect-classifier): Introduce prospect classifier logic, queue management system, and frontend UI for viewing/managing prospects, noise, owed replies, and tour leg cohorts
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-09 00:03:14 -07:00
autocommit
4e8198415e refactor(api): ♻️ Implement transaction-based database isolation in test harness for faster, parallel test execution
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-08 23:30:08 -07:00
autocommit
b54a8c0ba8 ci(api): 👷 Optimize test harness with increased timeout and optimized DB migration setup to reduce flaky tests and speed up execution
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-08 22:23:00 -07:00
autocommit
eb42e3c0b0 fix(api-tests): 🐛 Prevent concurrent migration race conditions by adding thread-safety to migration execution in test harness
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-08 17:33:35 -07:00
autocommit
2250dd439f test(api): Update test harness and financials tests to reflect adversary view jobs behavior changes
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-08 12:03:16 -07:00
autocommit
d15e53830a feat(api): Add backfill script to detect and correct CSS traps in UI for accessibility compliance
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-08 11:46:41 -07:00
autocommit
55b2ca6c7f feat(admin): Extend admin gallery items to support financial and journal entry functionality with new data fetching and rendering logic
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-08 11:46:41 -07:00
autocommit
610bdbd981 test(api): Add test harness and test cases for financials and journal entry migrations in the API module
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-08 11:46:41 -07:00
autocommit
1abc28d800 feat(my): Add financials API routes for user-specific financial data operations
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-08 11:29:44 -07:00
autocommit
9dbc34d51c db(api): 🗃️ Add financials-related migration scripts to enable schema updates
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-08 11:29:44 -07:00
autocommit
08114fff99 feat(financials): Add FinancialsRepo, FinancialsSchema, and FinancialsTypes for financial data management in the API layer
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-08 11:29:44 -07:00
autocommit
65c59ae47c feat(api-surfaces): Add user profile API endpoints and request/response logic
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-08 11:13:09 -07:00
autocommit
82bf7922ad feat(macsync): Introduce MACSyncMessage class, MACSyncMessageRepo for sync operations, and implement /m/messages API endpoints
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-08 11:13:08 -07:00
autocommit
9505197b3b feat(journal-entry): Add private journal entry repository layer, schema, types, and API endpoints
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-08 11:13:08 -07:00
autocommit
5dc8f97521 feat(credential): Introduce credential categories and bulk import API functionality
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-08 11:13:08 -07:00
autocommit
2c93f1f913 feat(surfaces): Add main entry point (index.ts) for the "my" surface API with user-specific request handlers
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-08 09:33:51 -07:00