Module Index

Cross-reference of all modules, their schemas, table/column counts, lock dates, ownership summary, and dependencies.

Source of truth for per-module detail is PROJECT_DECISIONS.md; this is the navigable index. Updated at every schema lock (Section 6 lock gate).


Locked Schemas — 23 schemas · 188 tables · 2,816 cols (as of 2026-06-12)

Platform & Service Layer

Module Schema Tables Cols Locked Owns Depends on
Platform platform 16 301 2026-06-09 Vrida's control plane: tenant identity, SaaS subscriptions/billing, payments-to-Vrida, legal agreements, usage, onboarding, entitlements (source of truth for feature access). nothing
Identity identity 11 140 2026-06-09 Authorization layer: staff users, tenant membership, roles, permissions, site access, SSO config, support-access grants. (Supabase Auth owns authN; Identity owns authZ.) platform
Shared shared 7 57 2026-06-09 Non-tenant global reference data: country, us_state, currency, unit_of_measure, usda_hardiness_zone, plant + plant_common_name. nothing
Multi-Location multi_loc 1 21 2026-06-09 The site concept — a physical nursery property; defines what site_id points to system-wide. (Transfers/cross-site ops → v1.5.) platform
Pricing pricing 4 56 2026-06-09 Odoo-style price lists, per-variant rules, customer/group assignments, quantity breaks, dated sales. (Layers on inventory base price.) inventory, crm
Payments payments 8 112 2026-06-10 Merchant Stripe Connect: incoming customer payments, Terminal, payouts, refunds, Stripe event log. (Owns ALL Stripe; tax → Stripe Tax.) platform
Integrations integrations 9 127 2026-06-11 Generic external-connector runtime: connectors, OAuth credential rotation, sync runs, provider-call log, inbound/outbound webhooks, field mapping. (Config in Admin; executes/syncs here.) platform, admin
Files files 3 43 2026-06-11 Generic file-metadata registry over Cloudflare R2: metadata, 3 visibility tiers, fine-grained access grants, storage usage quota. (R2 owns bytes; Files owns metadata.) platform
AI / Intelligence ai 4 71 2026-06-11 AI onboarding import pipeline (zero-mapping ingestion: import_job/import_file/import_record) + Bedrock-call log (ai_request). AI features are service-layer over existing data. Human-in-the-loop DB-enforced. Closes platform.tenant_setup_task onboarding-import dependency. platform, identity, files
Search search 0 0 2026-06-11 Zero-table schema — delivered as 6 additive FTS touches (+6 search_vector cols) to locked source tables. Postgres-native FTS: tsvector generated cols + dual GIN indexes (tsvector + pg_trgm) on inventory.item, inventory.item_variant, crm.customer, purchasing.vendor, orders.order_header, pos.sale. SearchService abstraction; callers never query search_vector directly; every query must include WHERE tenant_id = ?. inventory, crm, purchasing, orders, pos

Nursery-Facing Modules

Module Schema Tables Cols Locked Owns Depends on
Inventory inventory 21 238 2026-06-09 Vertical-neutral item catalog + variants + stock + lots + kits + counts. Owns stock_reservation, weighted-avg cost, item_image (display). +2 cols 2026-06-11: search_vector on item + item_variant (Search FTS touch). platform, shared, multi_loc
CRM crm 8 108 2026-06-09 Customers (individual/business), contacts, addresses, groups, notes, merge audit, consent log + tax certificates. +1 col 2026-06-11: search_vector on customer (Search FTS touch). platform, shared, multi_loc
POS pos 19 280 2026-06-10 In-store transactions; only offline-first module. Sales, tenders, refunds, registers, gift cards/store credit, layaway, guarantees, sync-conflict resolution. +1 col 2026-06-11: search_vector on sale (Search FTS touch). inventory, crm, pricing, admin, payments, multi_loc
Orders orders 7 133 2026-06-10 Quotes/orders/special-orders/preorders; deposits + installment schedule; light fulfillment. (Link-don't-convert to POS sale; tax finalizes at POS.) +1 col 2026-06-11: search_vector on order_header (Search FTS touch). inventory, crm, pricing, admin, multi_loc
Purchasing purchasing 16 341 2026-06-10 Vendors, POs, receiving, vendor invoices/bills, returns, landed cost. (Calls InventoryService to register received stock.) +1 col 2026-06-11: search_vector on vendor (Search FTS touch). inventory, admin, integrations
Billing billing 8 113 2026-06-10 Merchant-side A/R + A/P control layer: charge accounts, customer credit, statements, vendor bill payments. (NOT SaaS subscription — that's Platform.) crm, admin, payments
Admin admin 11 145 2026-06-10 Tenant configuration only: settings, branding, tax config (Stripe Tax), integration/webhook config, compliance docs. (HR/labor permanently out of scope.) platform, identity
Audit audit 7 118 2026-06-10 Cross-cutting integrity-chained audit log + compliance workflow (GDPR/CCPA DSR, breach incidents, DPA, subprocessors, exports). platform
Notifications notifications 11 166 2026-06-10 Event-driven delivery orchestrator: templates, notification convergence, delivery attempts, preferences, in-app inbox, journeys, campaigns, two-way SMS. (Consent queried from CRM.) platform, crm, integrations, audit
Reporting & Analytics reporting 3 43 2026-06-11 Operational BI — 2 frozen financial snapshots + run header; matviews + service-layer for the rest. Terminal — reads ~15 schemas (service_role); nothing depends on it; zero forward-refs out. platform, multi_loc, inventory, identity

Consumer Layer

Module Schema Tables Cols Locked Owns Depends on
Consumer consumer 4 47 2026-06-11 Platform-level person account (Model B) — consumer-scoped RLS; social-login auth; identity / tenant-links / addresses / interests. NON-TENANT-SCOPED (third non-tenant schema after platform and shared). First consumer-layer module. platform, shared, crm
Rewards rewards 6 89 2026-06-12 Per-business loyalty — points/tiers/earning-rules/redemption-catalog/ledger; tenant-scoped, consumer_id dimension; closes pos.sale.points seam. TENANT-SCOPED (second consumer-layer module; inverse of consumer_tenant_link). platform, consumer, pos, identity
Offers offers 4 68 2026-06-12 Business-issued discount/promo offers — definition/codes/assignment-lifecycle/append-only-redemption; merchant-funded v1 ('vrida' guarded, deferred v1.5); settlement feeds platform. TENANT-SCOPED (third consumer-layer module; funding_source flag; seam: offer_redemption.sale_id → pos.sale, no POS touch). platform, consumer, pos

Rewards (rewards) graduated to Locked Schemas 2026-06-12.

Offers (offers) graduated to Locked Schemas 2026-06-12.


Unbuilt / Future Modules

AI / Intelligence (ai) graduated to Locked Schemas 2026-06-11. See Locked Schemas table above. 4 tables, 71 cols, schema ai. See docs/PROJECT_DECISIONS.md "AI Module (Locked 2026-06-11)".

Search (search) graduated to Locked Schemas 2026-06-11. Zero-table schema. 6 FTS touches (+6 search_vector cols) applied to locked source tables. See Locked Schemas table above. See docs/PROJECT_DECISIONS.md "Search Module (Locked 2026-06-11)".

Reporting & Analytics (reporting) graduated to Locked Schemas 2026-06-11. 3 tables, 43 cols. Terminal module — reads ~15 schemas, nothing depends on it. See Locked Schemas table above and docs/PROJECT_DECISIONS.md "Reporting Module (Locked 2026-06-11)".

Consumer (consumer) graduated to Locked Schemas 2026-06-11. 4 tables, 47 cols. First consumer-layer module; third non-tenant-scoped schema. See Consumer Layer section in Locked Schemas table above and docs/PROJECT_DECISIONS.md "Consumer Module (Locked 2026-06-11)".

Later phases

Module Schema Phase Notes
Production / Propagation production v1.2 Pure nursery-vertical — non-nursery deployments omit this module entirely. Depends on inventory, admin.
Delivery & Logistics delivery v1.5 Depends on orders, admin.
Services & Jobs services v2.0 Depends on crm, admin.

Consumer Layer (post-v1.0 — remaining 1 module: direction only, no spec yet)

consumer schema graduated 2026-06-11 — see Consumer Layer section in Locked Schemas above. rewards schema graduated 2026-06-12 — see Consumer Layer section in Locked Schemas above. offers schema graduated 2026-06-12 — see Consumer Layer section in Locked Schemas above. One remaining module is still direction-only. No module spec files exist or should be created until the merchant core is built. See PROJECT_DECISIONS "Consumer Layer Architecture (2026-06-09)", "Consumer Module (Locked 2026-06-11)", "Rewards Module (Locked 2026-06-12)", and "Offers Module (Locked 2026-06-12)".

Module Schema Notes
Consumer App consumer_app Consumer app experience. Supersedes nursery-only 08_customer_app.md direction.

Dependency Build Order

Recommended order. Foundation first; nursery-facing modules layer on top.

Ordering Rationale

Five principles shape the sequence:

  1. Foundation firstplatform, identity, and shared migrate first because every other module depends on tenant identity, user/authZ, and global reference data. No downstream schema can migrate before its upstream dependencies exist.
  2. Close seams while fresh — schedule each module soon after the modules whose seams it closes. billing follows pos/orders (charge-account seams); payments follows the Stripe-seam modules; integrations follows notifications (provider seams); files follows the R2-seam modules. Deferred FKs accumulate context debt — closing them late means reconstructing decisions.
  3. AI mid-service-layerai sits alongside the cross-cutting services (not last) because the onboarding import pipeline (import_job/import_file/import_record) is a hard dependency of platform.tenant_setup_task. The pipeline must be functional before the v1.0 nursery build proceeds.
  4. Reporting near-lastreporting reads from every operational module, AI, and Files. Building it early would mean constant revision as upstream tables lock. It is terminal (nothing in v1.0 depends on it); build it after all upstream schemas are stable.
  5. Consumer layer last, separate phaseconsumer, rewards, offers, consumer_app are a distinct product surface (Model B) layered on the locked merchant core. The core does not depend on them; they depend on the core (especially POS for rewards earn). Separate post-v1.0 phase. (consumer locked 2026-06-11, rewards locked 2026-06-12, offers locked 2026-06-12; consumer_app remaining.)

1. Foundation & Platform:

  1. platform — Vrida's control plane (tenant, subscriptions, entitlements)
  2. identity — authorization layer (users, roles, permissions, sessions)
  3. shared — global reference data (seed-managed, no tenant dependency)
  4. paymentsPaymentsService over Stripe Connect; required for trial-to-paid
  5. integrations — external-connector runtime (QuickBooks first); depends on admin config

2. Cross-cutting services (build alongside the modules that use them):

  • aiAIService over Bedrock; AI import pipeline + Bedrock-call log (locked 2026-06-11)
  • files — R2 metadata + access control (locked 2026-06-11)
  • search — Postgres FTS + pg_trgm dual-GIN; SearchService abstraction (locked 2026-06-11 — zero tables, 6 FTS touches)

3. Tenant configuration: 6. admin — tenant settings, branding, tax config, integration/webhook config (depends on identity; HR/labor out of scope)

4. Nursery-facing: 7. multi_loc — site concept (foundation for all site_id FKs) 8. crm — customer table (tenant-scoped, in crm schema) 9. inventory — item catalog, variants, stock 10. pricing — price lists, rules, assignments (depends on inventory + crm) 11. pos — in-store transactions (depends on inventory, crm, pricing, payments) 12. orders — quotes/orders (depends on inventory, crm, pricing) 13. purchasing — vendor POs, receiving, bills (depends on inventory, integrations) 14. billing — A/R + A/P control (depends on crm, payments) 15. audit — integrity-chained log + compliance workflow 16. notifications — delivery orchestrator (depends on crm consent, integrations for delivery) 17. reporting — terminal BI module (locked 2026-06-11 — 3 tables, 43 cols; reads ~15 schemas)

5. v1.2+: 18. production — propagation (nursery-vertical only)

6. v1.5+: 19. multi_loc v1.5 features — transfers, cross-site fulfillment 20. delivery — logistics

7. v2.0+: 21. services — services & jobs

8. Consumer Layer (post-v1.0 — schema-locked, build-order TBD per module): 22. consumer — consumer identity (schema locked 2026-06-11; build when Consumer Layer phase begins) 23. rewards — per-nursery loyalty (schema locked 2026-06-12; build when Consumer Layer phase begins) 24. offers — discount/promo offers (schema locked 2026-06-12; build when Consumer Layer phase begins) 25. consumer_app — consumer mobile experience (direction only)

Last modified: Jun 17, 2026, 6:57 PM PT
On this page
Esc