maiven gateway · online··
manifest · 1d ago
Sign in
Back to catalog
MAIVENmodelstaging

stg_gcs__whse_returns

staging view

Returns, typed and FK-validated.

Definition

Cleaned mirror of `raw_gcs.whse_returns`. Coerces the CSV's `Nullable(String)` columns into typed equivalents and enforces the FK to `stg_gcs__whse_orders`. `client_id`/`site_id` are denormalized from the parent order; an INC-22 integrity test asserts the denormalized client_id equals the parent order's client_id. Feeds metric_returns_rate; `return_reason` → `reason` and `return_value_eur` → `return_value` on the mart.

14 of 14
Column
Description
Tests · PII
return_id
UUID5 from the source CSV. Primary key.
2 tests
order_id
Foreign key to stg_gcs__whse_orders — the parent (delivered) order.
client_id
Denormalized owning client (from the parent order), carried for the row policy. INC-22 model-level integrity test asserts equality to the parent order's client_id.
site_id
Denormalized site (from the parent order).
return_date
Return date (≥ parent order delivered_date). Coerced from String → Date.
1 test
disposition
Return disposition.
2 tests
return_reason
Return reason. Aliased to `reason` on the mart.
2 tests
units_returned
Units returned. Coerced from String → Int32 (passthrough to mart unchanged).
return_value_eur
Return value in EUR. Coerced from String → Decimal(14,2). Raw name aliased to `return_value` on the mart.
cycle_time_days
Days from receipt to disposition. Coerced from String → UInt16.
restocked
1 if disposition = 'restock', else 0. Coerced from the CSV's "true"/"false" strings.
1 test
source_file_url
Airbyte-supplied `_ab_source_file_url` — the gs:// URI the row came from.
source_file_modified_at
Airbyte-supplied `_ab_source_file_last_modified` — object mtime of the source file.
airbyte_extracted_at
When Airbyte extracted this row from GCS.