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

curated.loyalty_customers

Purpose

This table stores customer records specific to a loyalty program rather than general POS identity. It is intended for balance checks, account linking, and customer engagement or reward workflows.

The table should be treated carefully because it mixes business identity fields with credential-oriented legacy columns from the current contract.

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
customer_numberVARCHAR(50)NoCustomer number used by the loyalty system.
idINTEGERNoLoyalty customer identifier.
first_nameVARCHAR(100)NoCustomer first name.
last_nameVARCHAR(100)NoCustomer last name.
companyVARCHAR(150)YesCompany associated with the loyalty customer.
points_balanceINTEGERYesCurrent loyalty points balance.
program_nameVARCHAR(255)YesReadable name of the loyalty program.
member_statusVARCHAR(100)YesBusiness-friendly loyalty member status such as active, suspended, or inactive.
tier_nameVARCHAR(100)YesReadable loyalty tier name.
enrolled_at_utcTIMESTAMPYesUTC timestamp when the customer enrolled in the loyalty program.
last_activity_at_utcTIMESTAMPYesUTC timestamp of the customer's last loyalty-related activity.

Technical and ETL properties

ColumnTypeNullableTechnical MeaningNotes
loyalty_customer_keyBIGINTYesStable warehouse key for the loyalty customer entity.
source_systemVARCHAR(100)YesCanonical name of the source platform that produced the loyalty record.
source_loyalty_customer_idVARCHAR(199)YesOriginal loyalty customer identifier from the source platform.
tenant_keyBIGINTYesStable warehouse key for the tenant, brand, or client that owns the loyalty program.
tenant_nameVARCHAR(255)YesReadable tenant, brand, or client name associated with the loyalty member.
is_currentBOOLEANYesCanonical flag indicating whether the row is the current loyalty-member version.
effective_from_utcTIMESTAMPYesUTC timestamp from which the current loyalty-member version is valid.
effective_to_utcTIMESTAMPYesUTC timestamp until which the current loyalty-member version is valid.
_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.