# curated.employees

## Purpose

`curated.employees` is the shared employee dimension in the warehouse.

It should answer the question: `who works at the restaurant, what are their personal and employment details, and are they currently active?`

## Why this table matters

- gives one row per employee snapshot
- provides the main workforce reference for joins with orders, labor shifts, and job roles
- keeps employment lifecycle context such as `hire_date`, `termination_date`, `terminated`, and `is_active`
- keeps shared reporting context such as `business_date`, `source_system`, and tenant lineage
- creates a stable contract for future cross-source workforce analyses

## Grain

One row per employee snapshot.

## Column groups

- Business properties describe the employee: identity, personal details, employment dates, compensation classification, and active status.
- Technical and ETL properties describe warehouse lineage, surrogate keys, source reconciliation, tenant scoping, and ingestion metadata.

## Business properties

| Column | Type | Nullable | Business Meaning | Notes |
|---|---|---|---|---|
| `employee_id` | `BIGINT` | No | Source-native employee identifier. | Preferred identifier for downstream joins. |
| `display_name` | `VARCHAR(1024)` | Yes | Full display name of the employee. | |
| `first_name` | `VARCHAR(1024)` | Yes | Employee first name. | |
| `last_name` | `VARCHAR(1024)` | Yes | Employee last name. | |
| `email_address` | `VARCHAR(1024)` | Yes | Employee email address. | |
| `cell_phone` | `VARCHAR(256)` | Yes | Employee mobile phone number. | |
| `home_location_id` | `VARCHAR(256)` | Yes | Identifier of the employee's home location. | |
| `hire_date` | `TIMESTAMP` | Yes | Date the employee was hired. | |
| `termination_date` | `TIMESTAMP` | Yes | Date the employee was terminated. | |
| `terminated` | `BOOLEAN` | Yes | Whether the employee has been terminated. | |
| `is_salaried` | `BOOLEAN` | Yes | Whether the employee is on a salary compensation plan. | |
| `is_exempt` | `BOOLEAN` | Yes | Whether the employee is exempt from overtime. | |
| `payroll_id` | `VARCHAR(256)` | Yes | External payroll system identifier. | |
| `employee_unique_id` | `VARCHAR(256)` | Yes | Source-system unique employee identifier. | |
| `snapshot_date` | `DATE` | Yes | Date of the employee snapshot used for ETL partitioning. | |
| `is_active` | `BOOLEAN` | Yes | Derived active status. | Derived as `NOT COALESCE(terminated, FALSE)` in the Brink mapping. |
| `currency_code` | `VARCHAR(10)` | Yes | Currency of monetary values. | Required when curated data spans multiple currency contexts. |

## Technical and ETL properties

| Column | Type | Nullable | Technical Meaning | Notes |
|---|---|---|---|---|
| `source_system` | `VARCHAR(100)` | Yes | Canonical integration name used for lineage across source platforms. | Identifies which operational platform produced the record. |
| `source_employee_id` | `VARCHAR(199)` | Yes | Original source identifier kept for reconciliation and drill-through. | Preserves the native source key. |
| `employee_key` | `BIGINT` | Yes | Warehouse-generated stable surrogate key for the employee entity. | Surrogate warehouse key for dimensional joins. |
| `tenant_key` | `BIGINT` | Yes | Warehouse surrogate key for tenant or brand scope. | |
| `tenant_name` | `VARCHAR(255)` | Yes | Tenant or brand identifier injected by the ETL context. | Human-readable tenant or brand lineage value. |
| `effective_from_utc` | `TIMESTAMP` | Yes | SCD2 effective-from timestamp. | Currently deferred to NULL. |
| `effective_to_utc` | `TIMESTAMP` | Yes | SCD2 effective-to timestamp. | Currently deferred to NULL. |
| `is_current` | `BOOLEAN` | Yes | SCD2 current-row flag. | Currently deferred to NULL. |
| `_etl_batch_id` | `VARCHAR(256)` | Yes | ETL batch lineage identifier. | |
| `_etl_source_type` | `VARCHAR(100)` | Yes | Source adapter type used by ETL. | |
| `_etl_ingested_at` | `TIMESTAMP` | No | Warehouse ingestion timestamp for the curated row. | Required ingestion audit timestamp. |
