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/brinkPos-curated-model-mapps/pos_orders.md 7,803 bytes · Updated Oct 23, 2026 10:44 AM EDT
Raw File

Brink mapping for curated.pos_orders

Main staging sources used today

  • staging.brink_sales2_orders
  • staging.brink_settings2_get_destinations

Additional staged sources available for future enrichment

  • staging.brink_settings_get_tenders
  • staging.brink_sales2_order_payments
  • staging.brink_settings2_get_tables

Mapping groups

  • Business property mappings describe how Brink order content is mapped or could be mapped into curated business fields.
  • Technical and ETL property mappings describe lineage, source reconciliation, tenant scoping, and ingestion metadata.

Business property mappings

Curated ColumnBrink Staging TableBrink Property PathCurrent mappingStatusNotes
order_idstaging.brink_sales2_ordersid_encoded fallback order_idCOALESCE(NULLIF(id_encoded, ''), CAST(order_id AS VARCHAR(50)))MappedActual current insert logic. Best string-style external order identifier.
order_typestaging.brink_settings2_get_destinationsnameCAST(dest.name AS VARCHAR(50))MappedResolved by joining brink_sales2_orders on destination_id to brink_settings2_get_destinations.
payment_methodstaging.brink_sales2_order_payments + staging.brink_settings_get_tenderstender_id -> nameNULLNot mappedRequires payment summary logic plus tender lookup.
subtotalstaging.brink_sales2_orderssubtotalCAST(subtotal AS DECIMAL(10, 2))MappedDirect order subtotal.
totalstaging.brink_sales2_orderstotalCAST(total AS DECIMAL(10, 2))MappedDirect final total.
created_atstaging.brink_sales2_ordersopened_timeCAST(opened_time AS TIMESTAMP)MappedDirect order-open timestamp.
customer_numberstaging.brink_sales2_orderscustomer_idcustomer_idMappedBrink customer identifier.
idstaging.brink_sales2_ordersorder_id_no_locationCOALESCE(order_id_no_location, 0)MappedCompact integer-style order identifier with current fallback to 0.
table_numberN/AN/ANULLNot mappedCurrent staged Settings2.GetTables dictionary is not joinable from the existing curated insert.
taxstaging.brink_sales2_orderstaxCAST(tax AS DECIMAL(10, 2))MappedDirect total tax.
statusstaging.brink_sales2_orders(is_closed, is_future_order, is_refund)CASE WHEN is_refund THEN 'refund' WHEN is_future_order THEN 'future' WHEN is_closed THEN 'closed' ELSE 'open' ENDMappedDerived readable status.
terminal_idstaging.brink_sales2_ordersterminal_idCAST(terminal_id AS VARCHAR(50))MappedDirect terminal ID.
points_usedN/AN/ANULLNot mappedNo current loyalty-redemption field is used in this flow.
additional_paymentstaging.brink_sales2_order_paymentstender_idNULLNot mappedCould be derived later if business defines how to summarize split or secondary payments.
pos_terminal_idstaging.brink_sales2_ordersterminal_idCAST(terminal_id AS VARCHAR(50))MappedSame current value as terminal_id.
destinationstaging.brink_settings2_get_destinationsnameCAST(dest.name AS VARCHAR(100))MappedResolved by joining brink_sales2_orders on destination_id to brink_settings2_get_destinations.
terminal_namestaging.brink_settings_get_registersnameNULLNot mappedResolve terminal name by joining staging.brink_sales2_orders on terminal_id to staging.brink_settings_get_registers on register_id.
store_idN/AN/ANULLNot mappedLikely future source is tenant or location metadata outside Sales2.GetOrders.
store_nameN/AN/ANULLNot mappedLikely future source is tenant or location metadata outside Brink order payload.
status_namestaging.brink_sales2_orders(is_closed, is_future_order, is_refund)CASE WHEN is_refund THEN 'refund' WHEN is_future_order THEN 'future' WHEN is_closed THEN 'closed' ELSE 'open' ENDMappedCurrently identical to status.
service_channelstaging.brink_settings2_get_destinations(is_delivery, name)CASE WHEN COALESCE(dest.is_delivery, FALSE) THEN 'Delivery' WHEN COALESCE(dest.name, '') ILIKE '%qr%' OR COALESCE(dest.name, '') ILIKE '%mobile%' THEN 'Mobile/QR' ELSE 'Counter' ENDMappedDerived from destination metadata: delivery flag and name-based QR/mobile detection.
fulfillment_channelstaging.brink_settings2_get_destinationsis_deliveryCASE WHEN COALESCE(dest.is_delivery, FALSE) THEN 'Delivery' ELSE 'On-Premise' ENDMappedDerived from destination delivery flag.
created_at_utcstaging.brink_sales2_ordersopened_timeCAST(opened_time AS TIMESTAMP)MappedDirect UTC timestamp from current staging.
business_datestaging.brink_sales2_ordersbusiness_dateCAST(business_date AS DATE)MappedDirect business date.
currency_codeN/AN/ANULLNot mappedNo canonical currency source is used by the current Brink curated flow.
order_status_codestaging.brink_sales2_orders(is_closed, is_future_order, is_refund)CASE WHEN is_refund THEN 'refund' WHEN is_future_order THEN 'future' WHEN is_closed THEN 'closed' ELSE 'open' ENDMappedDerived machine-friendly status code, currently same as status and status_name.

Technical and ETL property mappings

Curated ColumnBrink Staging TableBrink Property PathCurrent mappingStatusNotes
order_keyN/AN/ANULLNot mappedWarehouse-generated key, not assigned by current insert.
source_systemN/AN/Aconstant 'brink_pos'Derived constantWarehouse constant.
source_order_idstaging.brink_sales2_ordersorder_idCAST(order_id AS VARCHAR(199))MappedDirect Brink source ID kept for reconciliation.
tenant_keyN/AN/ANULLNot mappedWarehouse-generated tenant key, not assigned by current insert.
tenant_nameN/AN/Aparameter @tenant_idETL contextPopulated from ETL context, not from Brink payload.
_etl_batch_idstaging.brink_sales2_orders_etl_batch_id_etl_batch_idMappedETL metadata propagated from staging.
_etl_source_typestaging.brink_sales2_orders_etl_source_type_etl_source_typeMappedETL metadata propagated from staging.
_etl_ingested_atstaging.brink_sales2_orders_etl_ingested_at_utc_etl_ingested_at_utc AS _etl_ingested_atMappedETL metadata propagated from staging.

Portal and sample validation

Curated fieldAdditional validated sourceHow to use it
payment_methodSales2.GetOrders -> Orders[].Payments[].AdditionalData[Name='PaymentSource']Sample payloads confirm Brink emits a PaymentSource name-value pair that can supplement tender-name-based payment summaries.
terminal_nameSettings.GetRegisters -> Register.NameBrink portal WSDL confirms a register lookup endpoint. The TerminalId -> Register.Id join should still be validated on real data before making it canonical.
order_typeSettings2.GetDestinations -> Destinations[].(Indicator, IsDelivery)Destination metadata confirmed in sample responses can refine service-channel normalization without replacing the current Name mapping.
statusSales2.GetOrders -> Orders[].PickupTimeFuture/scheduled orders can be further qualified with PickupTime confirmed in the Brink order contract.