Save strategy, readiness and audit docs from inbound media

This commit is contained in:
Brendan
2026-06-14 02:11:12 +00:00
parent 87d6cc14ec
commit a6f28668d3
15 changed files with 1436 additions and 0 deletions
+54
View File
@@ -0,0 +1,54 @@
# Module Inventory
This inventory lists developed modules and notable hidden/experimental areas found through the frontend registry, route map, backend route files, migrations, and project docs. "Current state" is an audit judgment, not a live acceptance result.
## Inventory
| Module | Purpose | User role | Frontend location | Backend routes | Main database tables | External integrations | Current working state | Known bugs / risks | Links to other modules | Tenant isolation | Stage 1 need |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Auth / Users | Login, signup, invites, sessions | All users/admin | `/login`, `/signup`, `/set-password/:token` | `/api/auth` | `users`, `refresh_tokens`, `businesses` | Resend for invites/reset | Prod-partial | Staging login bounce; docs disagree on localStorage vs httpOnly cookie | All modules | `users.business_id`; needs session/RLS proof | Must work |
| Dashboard | Operational overview | Admin, manager, office, workshop | `/` | `/api/dashboard` | Aggregates jobs, quotes, invoices, projects | None | Prod | Needs real tenant smoke test | Jobs, quotes, invoices | Depends on route filters | Stage 1 |
| Customers | Customer/account CRM | Admin, manager, office | `/customers`, `/customers/:id` | `/api/customers` | `customers`, `contacts`, `customer_addresses`, `customer_notes`, `customer_activities` | None | Prod | Duplicate detection missing | Enquiries, quotes, projects, invoices | Needs business-scoped verification | Stage 1 |
| Contacts | People linked to customers | Admin, manager, office | `/contacts`, `/contacts/:id` | `/api/contacts` | `contacts`, `contact_price_lists` | None | Built but sidebar disabled | Separate module disabled | Customers, quotes, invoices | Needs business-scoped verification | Stage 1 as embedded CRM |
| Enquiries | Lead capture and conversion | Admin, manager, office | `/enquiries`, `/enquiries/:id` | `/api/enquiries` | `enquiries`, `enquiry_files`, `enquiry_notes` | Email Intake | Prod | Conversion flow needs re-test | Customers, projects, email | Needs business-scoped verification | Stage 1.5 |
| Projects | Parent record connecting customer work | Admin, manager, office | `/projects`, `/projects/:id` | `/api/projects` | `projects`, `project_notes`, `project_files`, `project_update_log`, `drawing_register` | OneDrive/rclone file storage | Prod | OneDrive naming mismatch | Enquiry, quote, job, invoice | Needs business-scoped verification | Stage 1 |
| Jobs | Production/job execution | Admin, manager, office, workshop | `/jobs`, `/jobs/:id` | `/api/jobs`, `/api/bulk-delete` | `jobs`, `job_tasks`, `job_notes`, `job_files`, `job_schedules` | OneDrive/Mozaik optional | Prod | Confirm 14-stage SaaS labels vs legacy 12-stage references | Projects, quotes, invoices, production | Needs business-scoped verification | Stage 1 |
| Quotes | Quote builder, send, accept, revise | Admin, manager, office | `/quotes`, `/quotes/:id`, `/q/:token` | `/api/quotes` | `quotes`, `quote_line_items`, `quote_events`, `quote_files`, `quote_change_requests`, `quote_payment_schedule_steps` | Resend, PDF, Xero via invoice | Prod | PDF compliance default risk; `QuoteDetail.jsx` large | Customers, pricelist, projects, invoices | Needs business-scoped verification; public token access | Stage 1 |
| Quote portal | Customer quote view/accept | Customer/public | `/q/:token` | `/api/quotes/view/:token` | `quotes`, `quote_change_requests`, `portal_users` optional | Email links | Prod | Public token permissions need test | Quotes, portal, invoices | Token scoped by quote | Stage 1 |
| Invoices | Deposit/final invoices and Xero push | Admin, manager, office | `/invoices`, `/invoices/:id` | `/api/invoices`, `/api/invoice-profiles` | `invoices`, `invoice_line_items`, `invoice_profiles`, `invoice_profile_steps`, `invoice_activity` | Xero, Resend/PDF | Prod | Xero E2E depends on scopes/env | Quotes, jobs, Xero | Needs business-scoped verification | Stage 1 |
| Pricelist | Products/services and customer pricing | Admin, manager | `/pricelist` | `/api/pricelists`, `/api/customer-pricing`, `/api/quotes/:id/pricelist-items` | `price_lists`, `price_list_items`, `price_list_category_rules`, `price_list_item_overrides`, `pricelist_import_batches`, `pricelist_import_actions` | CSV/Excel import | Prod | New customer setup not guided enough | Quotes, invoices, PO, inventory | Needs business-scoped verification | Stage 1 |
| Communications | Unified outbound/inbound communication log | Admin, manager, office | `/communications` | `/api/communications` | `communications` | Resend, SMS/Twilio indirectly | Prod | Body drill-down/bulk actions missing | Quotes, invoices, projects, SMS | Needs business-scoped verification | Stage 1.5 |
| Email Intake | IMAP polling, AI parse, operational queue | Admin, manager, office | `/enquiries/email-intake` | `/api/email-intake` | `email_intake_logs`, `email_intake_filters`, `email_intake_settings`, `email_intake_trusted_senders` | IMAP, OpenAI | Staging | OpenAI key pending; privacy/failure mode setup needed | Enquiries, customers, projects, attachments | Must prove business_id on logs/settings | Stage 1.5 |
| Xero | OAuth, contacts/invoices/payment sync, P&L | Admin/manager | `/settings/integrations`, `/financials` | `/api/integrations/xero` | `integration_connections`, `integration_sync_logs`, `xero_*_cache` | Xero OAuth2 | Blocked | Brendan must enable scopes; per-tenant OAuth setup required | Invoices, financials, contacts | `integration_connections.business_id`; verify tokens per business | Stage 1 |
| Settings / Module Access | Business setup, users, modules, numbering, appearance | Admin/manager | `/settings` and child tabs | `/api/modules`, `/api/user/sidebar-*`, `/api/business`, `/api/numbering-settings` | `module_settings`, `user_sidebar_prefs`, `user_sidebar_groups`, `record_number_settings`, `businesses`, `staff` | Logo file storage | Prod | Needs onboarding-oriented setup path | All modules | Mixed; business logo/settings use business_id | Stage 1 |
| SaaS Admin | Provision/manage SaaS tenants | Founder/developer | `/admin/saas` | `/api/admin/saas` | `businesses`, `subscriptions`, tenant provisioning metadata | PostgreSQL/libpq | Staging | Not deployed; env vars needed; destructive drop endpoint must be protected | Auth, tenant create | Central to SaaS; DB-per-tenant/provision flow | Stage 1 blocker |
| Dev Centre | Internal planning/progress system | Admin/developer | `/dev-centre`, `/dev-centre/:id` | `/api/dev-centre` | `dev_*` tables | OpenRouter/OpenAI optional | Staging | Completion % manual and misleading for launch | All development modules | Internal only; should not be customer visible | Internal Stage 1 support |
| PDF Templates | Quote/invoice templates and terms | Admin/manager | `/settings/pdf-templates` | `/api/pdf-templates` | `pdf_templates`, `legal_terms`, `terms_acknowledgements` | PDF renderer | Missing/unknown in route map | Deposit clauses illegal in 4 states until defaults fixed | Quotes, invoices, compliance | Needs business_id per templates/terms | Stage 1 blocker |
| Customer Portal | Customer account/dashboard | Customer/admin | `/portal/*`, `/settings/portal-users` | `/api/portal/auth`, `/api/portal/admin` | `portal_users`, customer/job/quote/invoice views | Email links | Staging | Job progress/file access/password reset incomplete | Quotes, invoices, jobs | `portal_users.business_id`; verify customer scoping | Stage 2 |
| Production Planner | Shop planning by operations/capacity | Admin, manager, workshop | `/production`, `/production/floor-tv`, `/settings/production-routing` | `/api/production` | `production_*`, `job_production_hours`, `manual_production_entries` | Optional CNC | Staging | CNC estimates not wired; data setup heavy | Jobs, projects, schedule, capacity | Needs business scope review | Stage 2 |
| Dispatch / Scheduling | Dispatch board, legacy scheduler | Admin, manager, workshop | `/dispatch`, `/scheduling` redirect | `/api/scheduling` | `schedule_blocks`, `production_schedule_entries` | None | Staging/needs-work | Drag/drop issue in seed; superseded by planner | Jobs, production | Needs review | Later / parked |
| Inventory | Stock, remnants, transactions, kits | Admin, manager, workshop | `/inventory` | `/api/inventory` | `stock_master`, `stock_transactions`, `stock_kits`, `stock_kit_items`, `stock_remnants`, `stock_suppliers` | Barcode/CSV optional | Prod | PO receiving linkage must be verified | Pricelist, PO, production | Needs business scope review | Stage 1.5 |
| Purchase Orders | Supplier ordering and receiving | Admin, manager, office | `/purchase-orders` | `/api/purchase-orders` | `po_master`, `po_line_items`, `suppliers`, `stock_suppliers` | None | Prod | Receiving-to-inventory test required | Pricelist, inventory, financials | Needs business scope review | Stage 1.5 |
| Financials | Snapshots, forecasts, cost ledger, cashflow | Admin, manager | `/financials` | `/api/financials/*` | `financial_snapshots`, `forecast_*`, `manual_cost_entries`, `regular_expenses`, `project_back_costings`, `financial_settings` | Xero | Staging/blocked by scopes | Xero scopes; Premium-tier complexity | Invoices, Xero, jobs, PO | Uses business_id in newer tables; verify all routes | Stage 2 |
| Time Cards | Staff time entry and approval | Admin, manager, office, workshop | `/time-cards`, `/settings/time-cards` | `/api/time-cards` | `time_cards`, `time_card_entries`, `organisation_hours_defaults`, `staff_hour_templates` | Xero payroll future | Staging | Mobile/payroll export missing | Staff, financials, capacity | Needs business scope review | Stage 2 |
| Leave & Capacity | Leave requests and capacity flags | Admin, manager, office, workshop | `/leave` | `/api/leave` | `leave_requests`, `leave_balances`, `staff` | None | Prod according to route map | Needs capacity integration follow-up | Staff, time cards, production | Needs business scope review | Stage 2 |
| WHS / SOP | Safety registers and docs | Admin, manager, workshop | `/whs` | `/api/whs`, `/api/whs-ai` | `whs_*`, `training_*` overlap | OpenAI for generation | Prod | Template library setup for SaaS | Training, staff | Needs business scope review | Stage 2 |
| Training | Training modules and records | Admin, manager, office | `/training` | `/api/training` | `training_modules`, `training_records` | None | Staging | Not needed for first customer | WHS, staff | Needs business scope review | Stage 2 |
| Estimator | Material estimate sessions | Admin, manager, office | `/estimator` | `/api/estimator` | `estimate_sessions`, `estimate_lines`, `price_list_items` | None | Prod | Not fully integrated to planner | Quotes, pricelist | Older `tenant_id` model needs review | Stage 1.5 |
| Cabinet Builder | Cabinet BOM/pricing builder | Admin, manager, workshop | `/cabinet-builder` | `/api/cabinet-builder` | `cabinet_builder_*` | Mozaik optional | Prod | Uses separate `tenant_id`; folder creation issue | Quotes, jobs, Mozaik | Separate tenant model; reconcile with business_id | Stage 2 |
| Mozaik Library | Import/manage Mozaik library data | Admin/manager | `/settings/cabinet-library`, integration tabs | `/api/mozaik`, `/api/cabinet-library` | `mozaik_*`, `cnc_*`, `cabinet_builder_*` | Mozaik files | Missing/unknown/staging | Complex setup, not launch-critical | Cabinet builder, production, CNC | Needs tenant model review | Later unless first customer needs it |
| CNC Tooling | CNC tools, groups, runtime settings | Admin/manager | `/settings/cnc-tooling` | `/api/cnc` | `cnc_*` | Mozaik CNC files | Staging | Runtime not wired to planner | Mozaik, production | Partial `business_id` only | Later |
| Cabinet Library | Parameter reference, product briefs, presets | Admin, manager, workshop | `/cabinet-library` | `/api/cabinet-library` | `mozaik_parameter_reference`, `mozaik_product_briefs`, `mozaik_parameter_presets` | OpenAI formula assistant optional | Staging | Product-development oriented | Mozaik, cabinet builder | Needs review | Later |
| Team Notes | Internal notes board | Admin, manager, office, workshop | `/team-notes` | `/api/team-notes` | `team_note_pages`, `team_notes` | None | Prod | Rich text/@mentions missing | Jobs, quotes | Needs business scope review | Stage 1.5 |
| Help Centre | User guide/help | All internal users | `/help` | Mostly static | static docs | None | Built | SaaS onboarding help not complete | All modules | Not data sensitive | Stage 1.5 |
| Broadcasts | Internal announcements | Admin/staff | `/settings/broadcasts` | `/api/broadcasts` | `team_broadcasts`, `broadcast_acknowledgements` | None | Staging | Not launch-critical | Help/settings | Needs business scope review | Later |
| Database Admin | Internal database browser | Admin/developer | `/settings/database-admin` | `/api/admin/db`, `/api/admin/database-check` | All allowlisted tables, `audit_log` | None | Staging | Dangerous if exposed to customer tenants | Internal ops | Must be admin-only | Internal only |
| Tradify Import | Import legacy Tradify CSV data | Admin/developer/customer setup | `/settings/tradify-import` | `/api/tradify-import` | `tradify_import_*`, plus customers/jobs/quotes/invoices/projects | CSV upload | Staging | Customer instructions and supported CSV formats need clarity | Customers, jobs, quotes, invoices | Must write into correct tenant only | Stage 1.5 / DIFM |
| Texture Importer | Import supplier swatches into Mozaik files | Admin/manager | `/texture-importer` | `/api/mozaik/textures/*` | Mozaik texture/config tables/files | Supplier websites/files | Built/staging-ish | Not in route map summary as primary module | Mozaik | Needs review | Later |
| Door Orders | Public door order form and admin management | Public/admin | `/door-orders`, public routes | `/api/door-orders`, `/api/public/door-orders` | Door order tables (inline migration reference) | PDF/ZIP file generation | Dev | Customer-only workflow, not core SaaS launch | Customers/admin ops | Scope middleware noted | Later |
| Capture PWA | Quick capture notes | Internal/mobile | `/capture` (from source) | `/api/capture` | Capture-related or enquiries/notes | PWA | Built historically | Not in route map summary | Enquiries/notes | Needs review | Later |
| SMS | Customer notifications | Admin/office | integrated buttons | `/api/sms` | `communications`, SMS-specific fields | Twilio | Built | Customer tenant opt-in/env needed | Quotes/jobs/invoices/comms | Must isolate sender settings | Stage 1.5 |
## Inventory Conclusions
The product has enough built surface for Stage 1, but too many modules are marked "complete" without SaaS launch criteria. The first customer path should be narrow: Auth, Settings/business setup, Customers, Quotes, Pricelist, Projects, Jobs, Invoices, Xero, PDF compliance, SaaS Admin, and selected onboarding/import support.