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_hourly_sales.md 3,733 bytes · Updated Oct 23, 2026 10:44 AM EDT
Raw File

curated.pos_hourly_sales

Purpose

This table stores hourly aggregated sales facts when a source can provide or derive them. It is intended for quick trend analysis over time without needing to recompute hourly windows from transaction-level data.

Because it is an aggregate surface, it is best suited for reporting and anomaly baselines rather than detailed forensic analysis.

Schema contract

The deployed SQL under backend/Kds.Ai.Warehouse/Sql/Bootstrap/Tenant/Curated/ is the source of truth for the current column names, types, and nullability.

Column groups

  • Business properties describe the business entity, event, fact, or reference record represented by the table.
  • Technical and ETL properties describe warehouse lineage, surrogate keys, source reconciliation, tenant scoping, slowly changing dimension controls, and ingestion metadata.

Business properties

ColumnTypeNullableBusiness MeaningNotes
dobDATEYesBusiness date for the sales aggregate.
storeidINTEGERYesStore identifier associated with the aggregate.
occasionidINTEGERYesOccasion or meal-period identifier.
keyvolumeINTEGERYesVolume metric used by the source aggregate.
revidINTEGERYesRevenue bucket or revenue-center identifier.
catidINTEGERYesCategory identifier included in the aggregate.
starthourINTEGERYesStarting hour of the aggregate bucket.
startminINTEGERYesStarting minute of the aggregate bucket.
amountDOUBLE PRECISIONYesSales amount for the bucket.
regionidINTEGERYesRegion identifier for roll-up reporting.
stophourINTEGERYesEnding hour of the aggregate bucket.
stopminINTEGERYesEnding minute of the aggregate bucket.
store_nameVARCHAR(255)YesReadable store name associated with the aggregate bucket.
occasion_nameVARCHAR(255)YesReadable occasion or meal-period name.
revenue_center_nameVARCHAR(255)YesReadable revenue center name.
category_nameVARCHAR(255)YesReadable category name included in the aggregate.
transaction_countINTEGERYesNumber of transactions contributing to the aggregate bucket.
guest_countINTEGERYesNumber of guests represented in the aggregate bucket when available.
quantity_soldDECIMAL(18, 4)YesTotal quantity sold in the aggregate bucket when available.
currency_codeVARCHAR(10)YesISO or business-standard currency code used for the aggregate sales amount.
timezone_nameVARCHAR(100)YesCanonical IANA or business-standard time zone name used for the time bucket.

Technical and ETL properties

ColumnTypeNullableTechnical MeaningNotes
hourly_sales_keyBIGINTYesStable warehouse key for the hourly sales aggregate row.
source_systemVARCHAR(100)YesCanonical name of the source platform that produced the hourly aggregate.
tenant_keyBIGINTYesStable warehouse key for the tenant, brand, or client that owns the aggregate bucket.
tenant_nameVARCHAR(255)YesReadable tenant, brand, or client name associated with the aggregate bucket.
_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.