True Legacy's internal Estate Sales reporting & operations platform. Core weekly P&L editor, versioned saves, and regional roll-ups are live for editors and admins. Next phase wires NetSuite live sync, surfaces trend analytics, and ships kanban workflows for disposition and renovation teams.
Every authenticated request attaches the user's Supabase bearer via attachSupabaseAuth. Editor/admin gates live in middleware (requireSupabaseAuth + assertEditor). External syncs run server-side only.
| Function | Method | Auth | Writes To | Cadence |
|---|---|---|---|---|
getWeekOverrides src/lib/api/weekly-edits.functions.ts | GET | Public (RLS) | — | on-demand |
listWeekVersions src/lib/api/weekly-edits.functions.ts | GET | Public (RLS) | — | on-demand |
saveWeekChanges src/lib/api/weekly-edits.functions.ts | POST | Editor+ | tlh_weekly_overrides · tlh_weekly_override_versions | on-demand |
revertToVersion src/lib/api/weekly-edits.functions.ts | POST | Editor+ | tlh_weekly_overrides · tlh_weekly_override_versions | on-demand |
clearWeekOverrides src/lib/api/weekly-edits.functions.ts | POST | Editor+ | tlh_weekly_overrides · tlh_weekly_override_versions | on-demand |
getMyEditRole src/lib/api/weekly-edits.functions.ts | GET | Optional bearer | — | on-demand |
getUpcomingWeeks src/lib/api/upcoming.functions.ts | GET | Public | — | on-demand |
listUsers + role mutations src/lib/api/admin-users.functions.ts | GET/POST | Admin | user_roles | on-demand |
Transaction ingest, future write-back
AI-assisted summarization / forecasting (planned)
Property files bucket (private)
| Table | Purpose | RLS |
|---|---|---|
| tlh_deals | Source-of-truth deals + close dates | Read: auth |
| tlh_weekly_overrides | Editable per-cell P&L overrides | Read: auth · Write: editor+ (upsert only) |
| tlh_weekly_override_versions | Append-only edit timeline | Read: auth · Insert: editor+ |
| tlh_budget_line_items | Per-deal budget breakdown | Read: auth |
| tlh_change_orders | Scope / cost change tracking | Read: auth |
| tlh_profit_share | Profit-share splits per deal | Read: auth |
| tlh_netsuite_transactions | NetSuite txn cache | Read: auth · Write: service |
| tlh_renovation_milestones | Reno timeline events | Read: auth |
| Table | Purpose | RLS |
|---|---|---|
| kanban_disposition_tasks | Disposition pipeline cards | Read: auth |
| kanban_renovation_tasks | Renovation pipeline cards | Read: auth |
| listing_prep_tasks + templates | Pre-list checklist instances | Read: auth |
| mls_checklist_items + submissions | MLS compliance audits | Read: auth |
| hir_repair_items + submissions + files | Home inspection response repairs | Read: auth |
| meeting_hosts | Walkthrough / meeting assignments | Read: auth |
| property_files | Per-property file metadata | Read: auth |
| property_stage_history | Stage transition audit log | Read: auth |
| Table | Purpose | RLS |
|---|---|---|
| user_roles | Role assignments (admin / editor / user) | Self-read · Admin write · has_role() SECURITY DEFINER |
| admin_users | Admin user metadata | Admin-only |
Multi-week comparison charts on /trends
Sandbox → Production toggle, txn ingest on schedule
Drag/drop board backed by kanban_disposition_tasks
Per-deal splits surfaced in property detail
Workflow UIs for both checklist tables
Formal DELETE policy on overrides, security pass
Friday EOW Slack auto-post, QuickBooks alpha sync
Editors can UPDATE but not DELETE; reset uses null-upsert workaround
Mitigation · Formalize DELETE policy in M6
Manual QA only — regression risk grows with surface area
Mitigation · Add Vitest + Playwright smoke suite alongside M3
Live sync could throttle during peak hours
Mitigation · Confirm quota with NetSuite admin before M2 cutover
Blocks M7
Mitigation · Decision needed this week