Spensara Spensara Knowledge Base & Documentation Repository

Repository Docs & Knowledge Base

Consolidated Spensara documentation repository (722 Markdown & architecture documents in ../repository)
Built Word Documents (.docx): Spensara Overview (.docx) Capability Assessment (.docx) Brink POS Ingestion Analysis (.docx) The Borg Ingestion Architecture (.docx)

Warehouse Model (93)

Analytical data warehouse schemas, curated tables, and Redshift/Athena data models.
warehouse-model/docs/features/ETL/warehouse-data/curated-model/index.md 4,297 bytes · Updated Oct 23, 2026 10:44 AM EDT
Raw File

Curated Model

Purpose

This folder documents the current shared curated schema created by the bootstrap SQL under backend/Kds.Ai.Warehouse/Sql/Bootstrap/Tenant/Curated/.

This is the business-facing warehouse layer that AI agents should use first. The model is meant to be shared across integrations, so each table should expose stable business meaning rather than vendor-specific payload shape.

For this folder, the source of truth for table existence and columns is the deployed SQL. The documentation explains:

  • what business entity each table represents
  • what value it gives to PO, analysts, and AI agents
  • what the current schema contract looks like
  • how the model is intended to support multi-source ingestion

Current priority

Current active curated tables are:

  • curated.pos_orders
  • curated.pos_order_items
  • curated.pos_menu_items
  • curated.employees
  • curated.pos_jobs
  • curated.labor_shifts
  • curated.pos_destinations

Modeling principles for PO

  • curated is the semantic contract for downstream AI and business use, not a copy of staging.
  • The model must stay broad enough to accept data from multiple POS systems.
  • If a source does not provide a field yet, the field may stay NULL; this is better than silently widening ETL scope.
  • Shared business terms such as order, item, status, business date, service channel, and source lineage are more important than vendor-native field names.
  • Order-centric and transaction-centric facts can coexist, but their business meaning must stay explicit.
  • Source-specific population rules and mappings belong in source-mapping documents, not in the curated schema contract.

Cross-table summary

TablePrimary roleGrainKey business columnsStrong sidesMain modeling riskMost important next step
curated.employeesEmployee dimensionOne row per employee snapshotemployee_id, display_name, is_active, hire_dateStable workforce reference for joins and attributionSnapshot semantics must stay explicitKeep source-agnostic employee identity fields stable
curated.labor_shiftsLabor factOne row per labor shiftshift_id, employee_id, business_date, minutes_worked, pay_rateShift timing and labor-cost analysis surfaceVendor-specific break semantics can leak throughKeep shift grain explicit
curated.pos_destinationsDestination dimensionOne row per destination snapshotdestination_id, name, is_delivery, is_activeOrder-channel and routing contextSnapshot semantics must stay explicitKeep source-agnostic destination identity fields stable
curated.pos_jobsJob dimensionOne row per job snapshotjob_id, name, is_bartender, is_delivery_driverWorkforce role context for orders and laborSource role semantics can drift by vendorKeep canonical job meaning narrow
curated.pos_menu_itemsMenu-state snapshotOne row per menu item per snapshotitem_id, item_name, price, is_active, category_idGood availability and routing contextCan drift into serving or UI modelKeep it as canonical sellable menu state
curated.pos_order_itemsBusiness order-line factOne row per order line itemorder_id, item_id, item_name, unit_price, quantityGood basket and order composition contextCan overlap with transaction-line modelSeparate order semantics from settlement semantics
curated.pos_ordersBusiness order header factOne row per business orderorder_id, order_type, subtotal, total, business_date, service_channelStrong commercial order surfaceStill partly serving-like and source-shapedStrengthen canonical order lifecycle and channel semantics

Table type classification

TableRecommended type
curated.employeesdimension
curated.labor_shiftsfact
curated.pos_destinationsdimension
curated.pos_jobsdimension
curated.pos_menu_itemssnapshot
curated.pos_order_itemsfact
curated.pos_ordersfact

Tables

  • employees.md
  • labor_shifts.md
  • pos_destinations.md
  • pos_jobs.md
  • pos_menu_items.md
  • pos_order_items.md
  • pos_orders.md
  • todo.md