bridge_product_to_organization_unit


Description

Access control mapping that defines which products are available at which gym locations. Products can be made available at gyms through whitelisting (for MATERIAL, VOUCHER, and VIRTUAL types) or by being sold there (for dynamic ad-hoc products). This bridge table replaces the single organization_unit_id foreign key in dim_product to support the many-to-many relationship where products can be available at multiple locations.

Columns

Column Type Size Nulls Auto Default Children Parents Comments
product_to_organization_unit_id varchar 256 null

The primary key of this bridge table. Surrogate key uniquely identifying each product-organization_unit relationship.

product_id varchar 256 null
dim_product.product_id Implied Constraint R

The product that is available at the gym location. Includes both static products (from product catalog) and dynamic products (ad-hoc items created during sales).

organization_unit_id int8 19 null
dim_organization_unit.organization_unit_id Implied Constraint R

The gym location where this product is available. Products can be available at multiple locations through whitelisting or by being sold there.

is_archived bool 1 null

Whether this product-to-organization-unit mapping is archived. When true, the product is no longer available at this location. Always false for home organization units and dynamic products.

last_updated timestamptz 35 null

System column. UTC Timestamp at which entry was calculated (lags shortly behind source system).

Relationships