# Brink mapping for `curated.pos_transactions`

## Main staging sources

- `staging.brink_sales2_orders`
- `staging.brink_settings2_get_destinations`

## Mapping groups

- 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 |
|---|---|---|---|---|---|
| `"check"` | `N/A` | `N/A` | `NULL` | `Not mapped` | No matching check field is documented in Brink orders. |
| `amount` | `staging.brink_sales2_orders` | `total` | `NULL` | `Not mapped` | Direct total sales amount. |
| `openhour` | `staging.brink_sales2_orders` | `opened_time` | `NULL` | `Not mapped` | Derive hour from the order open timestamp. |
| `openmin` | `staging.brink_sales2_orders` | `opened_time` | `NULL` | `Not mapped` | Derive minute from the order open timestamp. |
| `orderhour` | `staging.brink_sales2_orders` | `opened_time` | `NULL` | `Not mapped` | Derive hour from the order open timestamp. |
| `ordermin` | `staging.brink_sales2_orders` | `opened_time` | `NULL` | `Not mapped` | Derive minute from the order open timestamp. |
| `closehour` | `staging.brink_sales2_orders` | `closed_time` | `NULL` | `Not mapped` | Derive hour from the order close timestamp. |
| `closemin` | `staging.brink_sales2_orders` | `closed_time` | `NULL` | `Not mapped` | Derive minute from the order close timestamp. |
| `"count"` | `staging.brink_sales2_orders` | `order_count` | `NULL` | `Not mapped` | Direct order header count. |
| `revenue` | `staging.brink_sales2_orders` | `section_id` | `NULL` | `Not mapped` | Best header-level revenue section identifier. |
| `unit` | `N/A` | `N/A` | `NULL` | `Not mapped` | No unit identifier is documented on Brink orders. |
| `dob` | `staging.brink_sales2_orders` | `business_date` | `NULL` | `Not mapped` | Direct business date. |
| `occasion` | `staging.brink_sales2_orders` | `destination_id` | `NULL` | `Not mapped` | Best available service-occasion style field. |
| `employee` | `staging.brink_sales2_orders` | `employee_id` | `NULL` | `Not mapped` | Direct employee identifier. |
| `period` | `N/A` | `N/A` | `NULL` | `Not mapped` | No matching business-period field is documented. |
| `"type"` | `N/A` | `N/A` | `NULL` | `Not mapped` | No transaction type classification code is documented. |
| `typeid` | `staging.brink_sales2_orders` | `destination_id` | `NULL` | `Not mapped` | Best available destination/channel identifier. |
| `shift` | `N/A` | `N/A` | `NULL` | `Not mapped` | No shift identifier is documented on orders. |
| `typeid2` | `N/A` | `N/A` | `NULL` | `Not mapped` | No secondary channel identifier is documented. |
| `revid2` | `N/A` | `N/A` | `NULL` | `Not mapped` | No secondary revenue grouping identifier is documented. |
| `store_name` | `N/A` | `N/A` | `NULL` | `Not mapped` | No store name is documented. |
| `revenue_center_name` | `N/A` | `N/A` | `NULL` | `Not mapped` | No revenue center name is documented at the order header level. |
| `occasion_name` | `staging.brink_settings2_get_destinations` | `name` | `NULL` | `Not mapped` | Resolve occasion name by joining `destination_id` to `staging.brink_settings2_get_destinations` on `destination_id`. |
| `transaction_type_name` | `staging.brink_settings2_get_destinations` | `name` | `NULL` | `Not mapped` | Resolve transaction type name by joining `destination_id` to `staging.brink_settings2_get_destinations` on `destination_id`. |
| `business_timestamp_utc` | `staging.brink_sales2_orders` | `opened_time` | `NULL` | `Not mapped` | Direct UTC timestamp. |
| `guest_count` | `staging.brink_sales2_orders` | `guest_count` | `NULL` | `Not mapped` | Direct guest count. |
| `net_amount` | `staging.brink_sales2_orders` | `net_sales` | `NULL` | `Not mapped` | Direct net sales amount. |
| `currency_code` | `N/A` | `N/A` | `NULL` | `Not mapped` | Currency is not documented in the available Brink staging model. |
| `transaction_status_code` | `staging.brink_sales2_orders` | `(is_closed, is_refund, is_future_order)` | `NULL` | `Not mapped` | Derive machine-friendly status code from status boolean fields. |

## Technical and ETL property mappings

| Curated Column | Brink Staging Table | Brink Property Path | Current mapping | Status | Notes |
|---|---|---|---|---|---|
| `transaction_key` | N/A | N/A | `NULL` | `Not mapped` | Warehouse-generated key. |
| `source_system` | N/A | N/A | `constant 'brink_pos'` | `Derived constant` | Warehouse constant, not a Brink API field. |
| `source_transaction_id` | `staging.brink_sales2_orders` | `order_id` | `NULL` | `Not mapped` | Direct Brink source order identifier kept for reconciliation. |
| `tenant_key` | N/A | N/A | `NULL` | `Not mapped` | Warehouse-generated key. |
| `tenant_name` | N/A | N/A | `parameter @tenant_id` | `ETL context` | Tenant metadata is outside the documented Brink staging payloads. |
| `_etl_batch_id` | staging.brink_sales2_orders | _etl_batch_id | `_etl_batch_id` | `Mapped` | ETL metadata propagated from staging. |
| `_etl_source_type` | staging.brink_sales2_orders | _etl_source_type | `_etl_source_type` | `Mapped` | ETL metadata propagated from staging. |
| `_etl_ingested_at` | staging.brink_sales2_orders | _etl_ingested_at_utc | `_etl_ingested_at_utc AS _etl_ingested_at` | `Mapped` | ETL metadata propagated from staging. |

## Portal and sample validation

| Curated field | Additional validated source | How to use it |
|---|---|---|
| `occasion` | `Sales2.GetOrders -> Orders[].Entries[].OrderItem.DayPartId` | Sample payloads and Brink WSDL confirm `DayPartId`, which can be used as an additional meal-period signal. |
| `occasion_name` | `Settings.GetDayParts -> DayPart.Name` | Brink portal WSDL confirms a day-part lookup endpoint that can supplement destination-based occasion mapping. |
| `employee` | `Settings2.GetEmployees -> Employees[].DisplayName` | Portal WSDL and sample response confirm employee lookup fields that can enrich transaction-level employee context. |
| `source_transaction_id` | `Sales2.GetOrders -> Orders[].IdNoLocation` | Sample payloads confirm `IdNoLocation` exists as a useful extra source identifier beside `Id`. |
