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/pos_orders.md 5,536 bytes · Updated Oct 23, 2026 10:44 AM EDT
Raw File

curated.pos_orders

Purpose

curated.pos_orders is the shared business order header in the warehouse.

It should answer the question: what order happened, when, for what amount, in what business context, and from which source system?

Why this table matters

  • gives one row per business order
  • provides the main order-level measures: subtotal, tax, total
  • keeps order lifecycle context such as status, status_name, and order_status_code
  • keeps shared reporting context such as business_date, source_system, and tenant lineage
  • creates a stable contract for future cross-source analyses such as store comparisons, channel mix, order-value anomalies, and customer-order behavior

Grain

One row per business order in the curated order model.

Column groups

  • Business properties describe the order itself: identifiers used by users, timestamps, amounts, lifecycle, channel, customer, and store context.
  • Technical and ETL properties describe warehouse lineage, surrogate keys, source reconciliation, tenant scoping, and ingestion metadata.

Business properties

ColumnTypeNullableBusiness MeaningNotes
order_idVARCHAR(50)NoBusiness-facing order identifier used for joins and drill-through.Preferred identifier for downstream business joins and drill-through.
order_typeVARCHAR(50)YesShared order type such as dine-in, carryout, or delivery.
payment_methodVARCHAR(50)YesSimplified payment summary at order level.Intended for normalized payment semantics rather than raw tender detail.
subtotalDECIMAL(10, 2)YesOrder value before tax and later adjustments.
totalDECIMAL(10, 2)YesFinal order total.
created_atTIMESTAMPYesBusiness timestamp of order creation in source semantics.Not guaranteed to be UTC.
customer_numberVARCHAR(50)YesCustomer or loyalty identifier linked to the order.
idINTEGERNoSource-native compact order identifier when available.Source-specific helper identifier, not the preferred business-facing order key.
table_numberVARCHAR(50)YesDine-in table identifier.
taxDECIMAL(10, 2)YesTax amount for the order.
statusVARCHAR(50)YesOrder state in readable business form.Human-readable business status.
terminal_idVARCHAR(50)YesTerminal identifier tied to order capture.
points_usedINTEGERYesLoyalty points redeemed on the order.
additional_paymentDECIMAL(10, 2)YesAdditional payment outside the main method.
pos_terminal_idVARCHAR(50)YesPOS-native terminal identifier when different from presentation-friendly fields.Useful when the curated model needs the raw POS terminal identity alongside normalized labels.
destinationVARCHAR(100)YesOperational destination or order routing label.
terminal_nameVARCHAR(255)YesHuman-readable terminal label.
store_idVARCHAR(199)YesShared store identifier.Canonical store identifier for cross-source reporting.
store_nameVARCHAR(255)YesHuman-readable store name.
status_nameVARCHAR(100)YesReadable lifecycle label, often aligned with status.May temporarily match status, but kept as a separate semantic field.
service_channelVARCHAR(100)YesShared service mode such as dine-in, drive-thru, pickup, or delivery.Normalized service-mode classification.
fulfillment_channelVARCHAR(100)YesShared fulfillment method used to complete the order.Normalized fulfillment classification.
created_at_utcTIMESTAMPYesUTC-normalized order creation timestamp.Preferred timestamp for cross-store and cross-timezone analysis.
business_dateDATEYesRestaurant business date used for reporting and ETL partitioning.May differ from the calendar date of created_at_utc.
currency_codeVARCHAR(10)YesCurrency of the monetary values.Required when curated data spans multiple currency contexts.
order_status_codeVARCHAR(100)YesStable machine-friendly lifecycle code.Distinct from readable labels so downstream logic can depend on a stable code set.

Technical and ETL properties

ColumnTypeNullableTechnical MeaningNotes
order_keyBIGINTYesWarehouse-generated stable surrogate key for the order entity.Surrogate warehouse key for dimensional or fact-style joins.
source_systemVARCHAR(100)YesCanonical integration name used for lineage across source platforms.Identifies which operational platform produced the record.
source_order_idVARCHAR(199)YesOriginal source identifier kept for reconciliation and drill-through.Preserves the native source key even when curated identifiers are normalized.
tenant_keyBIGINTYesWarehouse surrogate key for tenant or brand scope.
tenant_nameVARCHAR(255)YesTenant or brand identifier injected by the ETL context.Human-readable tenant or brand lineage value.
_etl_batch_idVARCHAR(256)YesETL batch lineage identifier.
_etl_source_typeVARCHAR(100)YesSource adapter type used by ETL.
_etl_ingested_atTIMESTAMPNoWarehouse ingestion timestamp for the curated row.Required ingestion audit timestamp.