# Brink mapping for `curated.labor_shifts`

## Main staging sources used today

- `staging.brink_labor_shifts`
- `staging.brink_labor_breaks`

## Mapping groups

- Business property mappings describe how Brink labor content is mapped into curated business fields.
- Technical and ETL property mappings describe lineage, source reconciliation, tenant scoping, and ingestion metadata.

## Business property mappings

| Curated Column | Brink Staging Table | Brink Property Path | Current mapping | Status | Notes |
|---|---|---|---|---|---|
| `shift_id` | `staging.brink_labor_shifts` | `shift_id` | `s.shift_id` | `Mapped` | Direct Brink shift ID. |
| `employee_id` | `staging.brink_labor_shifts` | `employee_id` | `s.employee_id` | `Mapped` | Direct employee ID from shift. |
| `job_id` | `staging.brink_labor_shifts` | `job_id` | `s.job_id` | `Mapped` | Direct job ID from shift. |
| `business_date` | `staging.brink_labor_shifts` | `business_date` | `CAST(s.business_date AS DATE)` | `Mapped` | Cast to DATE. |
| `start_time` | `staging.brink_labor_shifts` | `start_time` | `s.start_time` | `Mapped` | Direct shift start time. |
| `end_time` | `staging.brink_labor_shifts` | `end_time` | `s.end_time` | `Mapped` | Direct shift end time. |
| `minutes_worked` | `staging.brink_labor_shifts` | `minutes_worked` | `s.minutes_worked` | `Mapped` | Direct total minutes worked. |
| `regular_minutes_worked` | `staging.brink_labor_shifts` | `regular_minutes_worked` | `s.regular_minutes_worked` | `Mapped` | Direct regular minutes. |
| `overtime_minutes_worked` | `staging.brink_labor_shifts` | `overtime_minutes_worked` | `s.overtime_minutes_worked` | `Mapped` | Direct overtime minutes. |
| `extended_minutes_worked` | `staging.brink_labor_shifts` | `extended_minutes_worked` | `s.extended_minutes_worked` | `Mapped` | Direct extended minutes. |
| `pay_rate` | `staging.brink_labor_shifts` | `pay_rate` | `s.pay_rate` | `Mapped` | Direct pay rate. |
| `declared_tips` | `staging.brink_labor_shifts` | `declared_tips` | `s.declared_tips` | `Mapped` | Direct declared tips. |
| `shift_number` | `staging.brink_labor_shifts` | `number` | `s.number AS shift_number` | `Mapped` | Maps from staging `number` column to curated `shift_number`. |
| `break_count` | `staging.brink_labor_breaks` | `shift_id` | `COUNT(b.shift_id)` | `Derived` | Aggregated from breaks via LEFT JOIN + GROUP BY. |
| `total_break_minutes` | `staging.brink_labor_breaks` | `minutes` | `COALESCE(SUM(b.minutes), 0)` | `Derived` | Aggregated from breaks via LEFT JOIN + GROUP BY. |
| `currency_code` | `N/A` | `N/A` | `NULL` | `Not mapped` | No canonical currency source in Brink labor payload. |

## Technical and ETL property mappings

| Curated Column | Brink Staging Table | Brink Property Path | Current mapping | Status | Notes |
|---|---|---|---|---|---|
| `source_system` | `N/A` | `N/A` | constant `'brink_pos'` | `Derived constant` | Warehouse constant. |
| `source_shift_id` | `staging.brink_labor_shifts` | `shift_id` | `s.shift_id` | `Mapped` | Direct shift ID for reconciliation. |
| `labor_shift_key` | `N/A` | `N/A` | `NULL` | `Not mapped` | Warehouse-generated key, not assigned by current insert. |
| `tenant_key` | `N/A` | `N/A` | `NULL` | `Not mapped` | Warehouse-generated tenant key, not assigned by current insert. |
| `tenant_name` | `N/A` | `N/A` | parameter `@tenant_id` | `ETL context` | Populated from ETL context, not from Brink payload. |
| `_etl_batch_id` | `staging.brink_labor_shifts` | `_etl_batch_id` | `s._etl_batch_id` | `Mapped` | ETL metadata propagated from staging. |
| `_etl_source_type` | `staging.brink_labor_shifts` | `_etl_source_type` | `s._etl_source_type` | `Mapped` | ETL metadata propagated from staging. |
| `_etl_ingested_at` | `staging.brink_labor_shifts` | `_etl_ingested_at_utc` | `s._etl_ingested_at_utc AS _etl_ingested_at` | `Mapped` | ETL metadata propagated from staging. |
