# curated.pos_transaction_tenders

## Purpose

This table stores tender or payment facts associated with POS transactions. It provides a flattened payment-level surface for settlement analysis, tender mix reporting, drawer reconciliation, and payment troubleshooting.

Each row represents one tender event or payment record in the current reporting-oriented 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

| Column | Type | Nullable | Business Meaning | Notes |
|---|---|---|---|---|
| `check` | `INTEGER` | Yes | Check or transaction number being paid. |  |
| `date` | `DATE` | Yes | Business date associated with the tender record. |  |
| `typeid` | `INTEGER` | Yes | Specific tender or payment subtype identifier. |  |
| `unit` | `VARCHAR(6)` | Yes | Store or unit code in the source contract. |  |
| `amount` | `DOUBLE PRECISION` | Yes | Main tender amount applied. |  |
| `type` | `INTEGER` | Yes | Tender record type code. |  |
| `name` | `VARCHAR(20)` | Yes | Tender or payer display name. |  |
| `tip` | `DOUBLE PRECISION` | Yes | Tip amount attached to the tender. |  |
| `houseid` | `INTEGER` | Yes | House-account identifier when relevant. |  |
| `tippable` | `INTEGER` | Yes | Flag indicating whether the tender is tip-eligible. |  |
| `hour` | `INTEGER` | Yes | Hour bucket associated with the tender event. |  |
| `minute` | `INTEGER` | Yes | Minute bucket associated with the tender event. |  |
| `id` | `INTEGER` | Yes | Tender record identifier. |  |
| `autograt` | `DOUBLE PRECISION` | Yes | Automatic gratuity amount associated with the tender. |  |
| `strunit` | `INTEGER` | Yes | Structured unit identifier from the source contract. |  |
| `revenue` | `INTEGER` | Yes | Revenue identifier associated with the tender. |  |
| `occasion` | `INTEGER` | Yes | Occasion identifier associated with the transaction. |  |
| `source` | `INTEGER` | Yes | Source code indicating where the tender originated. |  |
| `store_name` | `VARCHAR(255)` | Yes | Readable store name associated with the tender event. |  |
| `tender_name` | `VARCHAR(255)` | Yes | Readable tender or payment-method name used in canonical business form. |  |
| `payment_family` | `VARCHAR(100)` | Yes | Standardized payment family code such as cash, card, wallet, loyalty, or house account. |  |
| `payment_family_name` | `VARCHAR(255)` | Yes | Readable business name of the standardized payment family. |  |
| `event_time_utc` | `TIMESTAMP` | Yes | UTC timestamp representing the canonical tender event time. |  |
| `business_date` | `DATE` | Yes | Business date associated with the tender event in curated logic. |  |
| `currency_code` | `VARCHAR(10)` | Yes | ISO or business-standard currency code used for tender monetary values. |  |

## Technical and ETL properties

| Column | Type | Nullable | Technical Meaning | Notes |
|---|---|---|---|---|
| `transaction_tender_key` | `BIGINT` | Yes | Stable warehouse key for the transaction tender fact row. |  |
| `source_system` | `VARCHAR(100)` | Yes | Canonical name of the source platform that produced the tender event row. |  |
| `source_transaction_tender_id` | `VARCHAR(199)` | Yes | Original transaction tender identifier from the source platform. |  |
| `tenant_key` | `BIGINT` | Yes | Stable warehouse key for the tenant, brand, or client that owns the tender event. |  |
| `tenant_name` | `VARCHAR(255)` | Yes | Readable tenant, brand, or client name associated with the tender event. |  |
| `_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. |
