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

curated.labor_shifts

Purpose

curated.labor_shifts is the shared labor shift fact table in the warehouse.

It should answer the question: what labor shift happened, who worked it, when, for how long, and what was the compensation context?

Why this table matters

  • gives one row per labor shift
  • provides the main labor measures: minutes_worked, regular_minutes_worked, overtime_minutes_worked, extended_minutes_worked
  • keeps shift timing context such as start_time, end_time, and business_date
  • keeps break aggregation context with break_count and total_break_minutes
  • provides compensation context with pay_rate and declared_tips
  • creates a stable contract for future cross-source labor cost and workforce analyses

Grain

One row per labor shift.

Column groups

  • Business properties describe the shift: identity, timing, worked minutes breakdown, compensation, and break aggregation.
  • Technical and ETL properties describe warehouse lineage, surrogate keys, source reconciliation, tenant scoping, and ingestion metadata.

Business properties

ColumnTypeNullableBusiness MeaningNotes
shift_idVARCHAR(36)NoSource-native shift identifier.Preferred identifier for downstream joins.
employee_idBIGINTYesEmployee who worked the shift.Joins to curated.employees.
job_idBIGINTYesJob (workforce role) for the shift.Joins to curated.pos_jobs.
business_dateDATEYesRestaurant business date for reporting and ETL partitioning.
start_timeTIMESTAMPTZYesShift start time with timezone.
end_timeTIMESTAMPTZYesShift end time with timezone.
minutes_workedINTEGERYesTotal minutes worked during the shift.
regular_minutes_workedINTEGERYesRegular (non-overtime) minutes worked.
overtime_minutes_workedINTEGERYesOvertime minutes worked.
extended_minutes_workedINTEGERYesExtended minutes worked beyond standard overtime.
pay_rateDECIMAL(18, 4)YesHourly pay rate for the shift.
declared_tipsDECIMAL(18, 4)YesTips declared by the employee for the shift.
shift_numberSMALLINTYesSequential shift number within the source system.Maps from brink_labor_shifts.number.
break_countINTEGERYesNumber of breaks taken during the shift.Aggregated from brink_labor_breaks via LEFT JOIN + GROUP BY.
total_break_minutesINTEGERYesTotal minutes of break time during the shift.Aggregated from brink_labor_breaks via LEFT JOIN + GROUP BY.
currency_codeVARCHAR(10)YesCurrency of monetary values.Required when curated data spans multiple currency contexts.

Technical and ETL properties

ColumnTypeNullableTechnical MeaningNotes
source_systemVARCHAR(100)YesCanonical integration name used for lineage across source platforms.Identifies which operational platform produced the record.
source_shift_idVARCHAR(199)YesOriginal source identifier kept for reconciliation and drill-through.Preserves the native source key.
labor_shift_keyBIGINTYesWarehouse-generated stable surrogate key for the labor shift entity.Surrogate warehouse key for dimensional joins.
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.