<?xml version="1.0" encoding="UTF-8"?><database name="enterprise_4e" schema="erp_v2" type="Redshift - 8.0.2">
   <tables>
      <table catalog="enterprise_4e" name="bridge_company_to_company_code" remarks="Bridge table linking companies to their assigned company codes (tags).&#10;A company can have multiple codes and a code can be assigned to multiple companies." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="company_to_company_code_id" nullable="false" remarks="Surrogate primary key." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="company_id" nullable="true" remarks="Foreign key to dim_company." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="company_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_company"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="company_code_id" nullable="true" remarks="Foreign key to dim_company_code." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="company_code_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_company_code"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="4" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="company_to_company_code_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="bridge_company_to_organization_unit" remarks="Bridge table linking companies to organization units (gyms) they are whitelisted for.&#10;Represents access permissions for gyms on companies." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="company_to_organization_unit_id" nullable="false" remarks="Surrogate primary key." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="company_id" nullable="true" remarks="The partner company this access is about." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="company_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_company"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="organization_unit_id" nullable="true" remarks="The organization unit (gym) that has access to this company." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_bridge_company_to_organization_unit_organization_unit_id__erp_v2_dim_organization_unit_organization_uni_51e5d48373ee" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="permission" nullable="true" remarks="Permission level of the organization unit for this company." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="archived" nullable="true" remarks="Whether this whitelist entry is archived." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="5" name="created_date" nullable="true" remarks="Timestamp when the whitelist entry was created." size="29" type="timestamp" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="created_user" nullable="true" remarks="User who created the whitelist entry." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="8" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="company_to_organization_unit_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="bridge_customer_group_to_customer" remarks="Records each customer's membership in a customer group, one row per membership&#10;event. Captures the validity period, the member's individual discount&#10;eligibility, and — for `Shared Contract` type groups — the relationship role&#10;within the group. A customer may appear multiple times for the same group&#10;across non-overlapping periods.&#10;Join to `dim_customer_group` on `customer_group_id` to determine the group&#10;type, discount configuration, and member limits. Join to `dim_customer` on&#10;`customer_id` for customer attributes." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="customer_group_to_customer_id" nullable="false" remarks="Unique identifier for the customer-group membership row." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="customer_id" nullable="true" remarks="The customer assigned to the group." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_bridge_customer_group_to_customer_customer_id__erp_v2_dim_customer_customer_id_fkey_4148985e8f30" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="customer_group_id" nullable="true" remarks="The customer group assigned to the customer." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_group_id" foreignKey="erp_v2_bridge_customer_group_to_customer_customer_group_id__erp_v2_dim_customer_group_customer_group_id_fkey_5e8065fbc643" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer_group"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="start_date" nullable="true" remarks="Date when the customer became part of the customer group." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="end_date" nullable="true" remarks="Date when the customer-group membership ended. Null means the membership is still active." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="is_discountable" nullable="true" remarks="Whether this individual membership is eligible to receive the group discount on the member's contract. Acts as a per-membership override: even when the group is configured as discountable (`dim_customer_group.is_discountable = true`), setting this to `false` prevents the group discount from being applied to this member's contracts." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="permission" nullable="true" remarks="Administrative permission level assigned to the customer within the group. Controls whether the member can manage group settings (e.g. add or remove members). NULL when no explicit permission has been configured for this membership." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="relationship_type" nullable="true" remarks="How the customer is related to the rest of the group. Only populated for `Shared Contract` type groups.&#10;* OWNER: The customer who owns and administers the group (not user-selectable).&#10;* PARENT: A parental member of the group.&#10;* CHILD: A child member of the group.&#10;* SPOUSE: A spousal member of the group.&#10;* FRIEND: A friend member of the group.&#10;* PARTNER: A partner member of the group." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="is_archived" nullable="true" remarks="Whether the customer-group membership has been archived." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="10" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="customer_group_to_customer_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="bridge_customer_to_customer_code" remarks="Link customer to all his customer codes." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="customer_to_customer_code_id" nullable="false" remarks="The primary key of the table. System column calculated by the source System." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="customer_id" nullable="true" remarks="The customer this customer code is assigned to." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_bridge_customer_to_customer_code_customer_id__erp_v2_dim_customer_customer_id_fkey_6d686c59d642" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="customer_code_id" nullable="true" remarks="The customer code that this customer is assigned to." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_code_id" foreignKey="erp_v2_bridge_customer_to_customer_code_customer_code_id__erp_v2_dim_customer_code_customer_code_id_fkey_60a1d958f68c" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer_code"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="4" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="customer_to_customer_code_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="bridge_discount_campaign_to_allowed_origin_type" remarks="Maps discount campaigns to their allowed sales channel origin types.&#10;One row per (campaign, origin_type) pair. Only origin types listed here are permitted&#10;to trigger the campaign discount when a contract is signed.&#10;&#10;If a contract is created via a channel not present in this table for the active campaign,&#10;the campaign discount is not applied." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="discount_campaign_to_allowed_origin_type_id" nullable="false" remarks="The primary key of this table. Surrogate key derived from (discount_campaign_id, origin_type)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="discount_campaign_id" nullable="true" remarks="The discount campaign whose allowed origin types are listed." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="discount_campaign_id" foreignKey="erp_v2_bridge_discount_campaign_to_allowed_origin_type_discount_campaign_id__erp_v2_dim_discount_campaign_disc_0ed5bdc786d7" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_discount_campaign"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="origin_type" nullable="true" remarks="#### The sales channel that is permitted to apply this campaign.&#10;One of:&#10;* CONFIGURATION_LINK: Sign-up via a MySports configuration/sharing link.&#10;* CONNECT_API: Sign-up via the Magicline Connect API.&#10;* EXTERNAL: Sign-up via the public Open API (generic external).&#10;* JOB: Automated by a background job (internal).&#10;* LANDING_PAGE: Sign-up via a campaign landing page.&#10;* MYSPORTS_APP: Sign-up via the MySports mobile app.&#10;* MYSPORTS_WEB: Sign-up via the MySports web client.&#10;* NOX: Sign-up via the NOX/MySports channel (legacy).&#10;* MEMBER_CHATBOT: Sign-up via the member-facing chatbot.&#10;* ONLINE_CHECKOUT_PAGE: Sign-up via the online checkout page.&#10;* OPEN_API: Sign-up via the public Open API.&#10;* PERSONALIZED_OFFER_PAGE: Sign-up via a personalised offer page.&#10;* SALES_TOOL: Created by staff using the internal sales tool.&#10;* TOUCHPOINT: Triggered via an internal studio touchpoint.&#10;* WEBCLIENT: Created via the internal back-office web client." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="4" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="discount_campaign_to_allowed_origin_type_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="bridge_discount_campaign_to_organization_unit" remarks="Maps studios (organization units) to their currently active discount campaign.&#10;One row per studio — at most one active discount campaign per studio is represented here.&#10;This is a point-in-time snapshot sourced from `active_organization_unit_configuration`,&#10;which holds at most one active discount campaign configuration per studio at any given time.&#10;&#10;**Important limitation:** When a studio deactivates a discount campaign, the corresponding&#10;row is hard-deleted — no historical record is preserved." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="discount_campaign_to_organization_unit_id" nullable="false" remarks="The primary key of this table. Surrogate key derived from (organization_unit_id, discount_campaign_id)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="discount_campaign_id" nullable="true" remarks="The discount campaign currently active for this studio." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="discount_campaign_id" foreignKey="erp_v2_bridge_discount_campaign_to_organization_unit_discount_campaign_id__erp_v2_dim_discount_campaign_discou_7a9da8bcf0a3" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_discount_campaign"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="organization_unit_id" nullable="true" remarks="The studio for which this discount campaign is currently active." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_bridge_discount_campaign_to_organization_unit_organization_unit_id__erp_v2_dim_organization_unit_organi_d2fbb7060fea" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="4" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="discount_campaign_to_organization_unit_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="bridge_organization_unit_to_organization_unit_code" remarks="Link organization unit (gym) to all its organization unit codes (tags)." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="organization_unit_to_organization_unit_code_id" nullable="false" remarks="The primary key of the table. Surrogate primary key of the table." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="organization_unit_id" nullable="true" remarks="The organization unit (gym) this organization unit code is assigned to." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_bridge_organization_unit_to_organization_unit_code_organization_unit_id__erp_v2_dim_organization_unit_o_508bb3291f6a" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="organization_unit_code_id" nullable="true" remarks="The organization unit code that this organization unit is assigned to." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_code_id" foreignKey="erp_v2_bridge_organization_unit_to_organization_unit_code_organization_unit_code_id__erp_v2_dim_organization_u_a47f3e8453ce" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit_code"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="4" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="organization_unit_to_organization_unit_code_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="bridge_payment_to_payment_run" remarks="Connects payment runs with payments. Each row represents one payment-run item and its corresponding payment. The `payment_run_id` joins to `fct_payment_run.payment_run_id`, and `payment_id` joins to `fct_payment.payment_id`. The payment-run-item to payment connection is one-to-one." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="payment_to_payment_run_id" nullable="false" remarks="Surrogate primary key for a payment-run and payment relationship." size="32" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="payment_id" nullable="true" remarks="The transaction-resolved payment associated with the payment-run booking. Join this key to fct_payment.payment_id." size="32" type="varchar" typeCode="12">
            <parent catalog="enterprise_4e" column="payment_id" foreignKey="erp_v2_bridge_payment_to_payment_run_payment_id__erp_v2_fct_payment_payment_id_fkey_237755775dad" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_payment"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="payment_run_id" nullable="true" remarks="The payment-run result associated with the normalized booking. Join this key to fct_payment_run.payment_run_id." size="32" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="4" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="payment_to_payment_run_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="bridge_payment_to_revenue" remarks="Connects payments with the revenue entries they settle. Each row represents one payment-to-revenue link across budget, invoice-based, and cash-based accounting. The `payment_id` joins to `fct_payment.payment_id`, and the revenue ID columns join to their corresponding revenue fact tables. The `payment_to_revenue_id` identifies the unique payment-to-revenue relationship." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="payment_to_revenue_id" nullable="false" remarks="Surrogate primary key generated from the booking-detail link and revenue entry." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="revenue_id" nullable="true" remarks="Budget/accrual revenue entry linked to the payment." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="revenue_id" foreignKey="erp_v2_bridge_payment_to_revenue_revenue_id__erp_v2_fct_revenue_revenue_id_fkey_cf88bdaea053" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_revenue"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="revenue_invoice_based_id" nullable="true" remarks="Invoice-based revenue entry linked to the payment." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="revenue_invoice_based_id" foreignKey="erp_v2_bridge_payment_to_revenue_revenue_invoice_based_id__erp_v2_fct_revenue_invoice_based_revenue_invoice_ba_454d87e51545" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_revenue_invoice_based"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="revenue_cash_based_id" nullable="true" remarks="Cash-based revenue entry linked to the payment." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="revenue_cash_based_id" foreignKey="erp_v2_bridge_payment_to_revenue_revenue_cash_based_id__erp_v2_fct_revenue_cash_based_revenue_cash_based_id_fk_4643f1995d21" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_revenue_cash_based"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="payment_revenue_cash_based_id" nullable="true" remarks="Cash-based revenue entry of the settling payment." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="revenue_cash_based_id" foreignKey="erp_v2_bridge_payment_to_revenue_payment_revenue_cash_based_id__erp_v2_fct_revenue_cash_based_revenue_cash_bas_0d2b3c544987" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_revenue_cash_based"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="internal_payment_id" nullable="true" remarks="Identifies the payment that settles the linked revenue entry." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="payment_id" nullable="true" remarks="The payment identity used by fct_payment, generated from the payment booking entry and reversal state." size="32" type="varchar" typeCode="12">
            <parent catalog="enterprise_4e" column="payment_id" foreignKey="erp_v2_bridge_payment_to_revenue_payment_id__erp_v2_fct_payment_payment_id_fkey_4b31ff9bbf9f" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_payment"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="8" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="payment_to_revenue_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="bridge_pos_saleposition_to_payment" remarks="Bridge table linking each POS sale position to every payment actively settling it. A single sale position can be split across multiple payments (e.g. partial settlements or split payment methods), so this table has a many-to-many grain: one row per active sale-position-to-payment link. Use this table instead of the deprecated fct_pos_saleposition.internal_payment_id, which collapses splits down to a single link and loses this granularity." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="pos_saleposition_to_payment_id" nullable="false" remarks="The primary key of this table. Surrogate key built from the sale position and payment." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="pos_saleposition_id" nullable="true" remarks="The sale position (line item) this payment link belongs to. May appear on multiple rows when the sale position is settled by more than one payment." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="pos_saleposition_id" foreignKey="erp_v2_bridge_pos_saleposition_to_payment_pos_saleposition_id__erp_v2_fct_pos_saleposition_pos_saleposition_id_50c30e724329" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_pos_saleposition"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="payment_internal_id" nullable="true" remarks="One of the payment entries that records the financial impact of this sale position." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="4" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="pos_saleposition_to_payment_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="bridge_product_to_organization_unit" remarks="Access control mapping that defines which products are available at which gym locations. Products can be made available &#10;at gyms through whitelisting (for MATERIAL, VOUCHER, and VIRTUAL types) or by being sold there (for dynamic ad-hoc products). &#10;This bridge table replaces the single organization_unit_id foreign key in dim_product to support the many-to-many &#10;relationship where products can be available at multiple locations." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="product_to_organization_unit_id" nullable="false" remarks="The primary key of this bridge table. Surrogate key uniquely identifying each product-organization_unit relationship." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="product_id" nullable="true" remarks="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)." size="256" type="varchar" typeCode="12">
            <parent catalog="enterprise_4e" column="product_id" foreignKey="erp_v2_bridge_product_to_organization_unit_product_id__erp_v2_dim_product_product_id_fkey_f1fdb9e3c1ce" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_product"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="organization_unit_id" nullable="true" remarks="The gym location where this product is available. Products can be available at multiple locations through whitelisting or by being sold there." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_bridge_product_to_organization_unit_organization_unit_id__erp_v2_dim_organization_unit_organization_uni_7f6dc1b876f7" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="is_archived" nullable="true" remarks="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." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="5" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="product_to_organization_unit_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="bridge_rate_bundle_to_company" remarks="Bridge table linking rate bundles to partner companies for corporate deals, including any cooperation identifier used for that partnership." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="rate_bundle_to_company_id" nullable="false" remarks="The primary key of this table. Surrogate key built from the rate bundle and company." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="rate_bundle_id" nullable="true" remarks="The rate bundle that is linked to the company." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_bundle_id" foreignKey="erp_v2_bridge_rate_bundle_to_company_rate_bundle_id__erp_v2_dim_rate_bundle_rate_bundle_id_fkey_ca45bd926733" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate_bundle"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="company_id" nullable="true" remarks="The company that the rate bundle is linked to." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="company_id" foreignKey="erp_v2_bridge_rate_bundle_to_company_company_id__erp_v2_dim_company_company_id_fkey_716408ac5f77" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_company"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="cooperation_id" nullable="true" remarks="Cooperation identifier used for company-specific bundle availability." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="created_date" nullable="true" remarks="Timestamp in UTC when the rate bundle/company link was created." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="6" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="rate_bundle_to_company_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="bridge_rate_bundle_to_payment_choice" remarks="Bridge table listing which payment choices are allowed when selling a rate bundle." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="rate_bundle_to_payment_choice_id" nullable="false" remarks="The primary key of this table. Surrogate key built from the rate bundle and payment choice." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="rate_bundle_id" nullable="true" remarks="The rate bundle that allows the payment choice." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_bundle_id" foreignKey="erp_v2_bridge_rate_bundle_to_payment_choice_rate_bundle_id__erp_v2_dim_rate_bundle_rate_bundle_id_fkey_c53498fca3fa" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate_bundle"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="payment_choice" nullable="true" remarks="Allowed payment choice for the rate bundle." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="4" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="rate_bundle_to_payment_choice_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="bridge_rate_to_rate_code" remarks="Bridge table linking rates to their assigned rate codes (tags).&#10;A rate can have multiple codes and a code can be assigned to multiple rates." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="rate_to_rate_code_id" nullable="false" remarks="Surrogate primary key." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="rate_id" nullable="true" remarks="The foreign key to the rate table." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_id" foreignKey="erp_v2_bridge_rate_to_rate_code_rate_id__erp_v2_dim_rate_rate_id_fkey_9ee2eae02ce4" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="rate_code_id" nullable="true" remarks="The foreign key to the Rate Code table." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_code_id" foreignKey="erp_v2_bridge_rate_to_rate_code_rate_code_id__erp_v2_dim_rate_code_rate_code_id_fkey_dd41198c328b" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate_code"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="4" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="rate_to_rate_code_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="bridge_revenue_to_purchased_contingent" remarks="Bridge table linking revenue transactions to purchased contingents (day passes, class packs, etc.).&#10;Handles many-to-many relationships where one sale position may create multiple contingents &#10;(e.g., bundle products, family packs). Use this table to analyze revenue by specific purchased &#10;contingent while avoiding grain issues and revenue duplication.&#10;&#10;Example use cases:&#10;- &quot;Show revenue generated from day pass sales with their utilization rates&quot;&#10;- &quot;Analyze which purchased contingents contribute most to revenue&quot;&#10;- &quot;Track revenue for bundle products that create multiple contingents&quot;" schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="revenue_to_purchased_contingent_id" nullable="false" remarks="Surrogate primary key generated from revenue_id and purchased_contingent_id." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="revenue_id" nullable="true" remarks="The revenue transaction that includes the sale of this purchased contingent." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="revenue_id" foreignKey="erp_v2_bridge_revenue_to_purchased_contingent_revenue_id__erp_v2_fct_revenue_revenue_id_fkey_8725c47a1b69" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_revenue"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="purchased_contingent_id" nullable="true" remarks="The purchased contingent (day pass, class pack, etc.) created by this revenue transaction." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="purchased_contingent_id" foreignKey="erp_v2_bridge_revenue_to_purchased_contingent_purchased_contingent_id__erp_v2_dim_purchased_contingent_purchas_f6a75d64c8cd" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_purchased_contingent"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="4" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="revenue_to_purchased_contingent_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="bridge_service_to_organization_unit" remarks="Access control mapping that defines which services are available at which gym locations. Services must be explicitly whitelisted &#10;for a gym before they can be booked or used there. This enables multi-location businesses to offer different service menus &#10;at different facilities (e.g., specialized classes only at flagship locations, or region-specific offerings)." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="service_to_organization_unit_id" nullable="false" remarks="Surrogate primary key." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="service_id" nullable="true" remarks="The service that has been authorized for use at the gym location (e.g., Yoga Class, Personal Training, Sauna Access)." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="service_id" foreignKey="erp_v2_bridge_service_to_organization_unit_service_id__erp_v2_dim_service_service_id_fkey_027ea9035df6" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_service"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="organization_unit_id" nullable="true" remarks="The gym location where customers can book and use this service. Each service-location pairing must be explicitly configured." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_bridge_service_to_organization_unit_organization_unit_id__erp_v2_dim_organization_unit_organization_uni_93f5ab50f16a" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="archived" nullable="true" remarks="Whether this service-to-organization-unit mapping has been archived." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="5" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="service_to_organization_unit_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_appointment" remarks="The unique event of an appointment on the calendar with its properties." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="appointment_id" nullable="false" remarks="The primary key of this table. System column calculated by the source System. Unique identifier for an appointment." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="appointment_id" foreignKey="erp_v2_fct_class_appointment_appointment_id__erp_v2_dim_appointment_appointment_id_fkey_f4e53bd6c753" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_class_appointment"/>
            <child catalog="enterprise_4e" column="appointment_id" foreignKey="erp_v2_fct_class_event_appointment_id__erp_v2_dim_appointment_appointment_id_fkey_ef6408601227" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_class_event"/>
            <child catalog="enterprise_4e" column="appointment_id" foreignKey="erp_v2_fct_customer_appointment_appointment_id__erp_v2_dim_appointment_appointment_id_fkey_24da8b99b36c" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_customer_appointment"/>
            <child catalog="enterprise_4e" column="appointment_id" foreignKey="erp_v2_fct_trainer_appointment_appointment_id__erp_v2_dim_appointment_appointment_id_fkey_4e3c9632486d" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_trainer_appointment"/>
            <child catalog="enterprise_4e" column="appointment_id" foreignKey="erp_v2_fct_trainer_class_appointments_appointment_id__erp_v2_dim_appointment_appointment_id_fkey_03e54edf990b" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_trainer_class_appointments"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="type" nullable="true" remarks="If this appointment is a TRIAL_SESSION, SINGLE_APPOINTMENT or COURSE_APPOINTMENT." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="source" nullable="true" remarks="Through which system this appointment was created.&#10;* WEBCLIENT: Appointment created on Systems website by employee.&#10;* OPEN_API: Appointment created via the Systems open API (eg partner integration)&#10;* CONNECT_API: Appointment created via the Systems public API (eg tenant website)&#10;* PUBLIC_API_LEGACY: Appointment created via a deprecated API (eg tenant website)&#10;* MYSPORTS: Appointment created via Mysports/Branded App or mysports.com&#10;* TOUCHPOINT: Appointment created via Touchpoint, a self service solution enabling members to book additional modules via touch screen in the studio.&#10;* ONLINE_CHECKOUT_PAGE: Appointment created via Studio Pages feature (See Settings &gt; Websites &gt; Studio pages)" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="status" nullable="true" remarks="The state of the appointment booking. PLANNED (appointment is planned to take place or did already take place), DELETED or CANCELED." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="max_participants" nullable="true" remarks="How many participants are allowed in the appointment" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="max_waiting_list" nullable="true" remarks="How many participants are allowed in the waiting list" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="planned_participants" nullable="true" remarks="How many participants are expected in the appointment" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="archived" nullable="true" remarks="Permanently removed but kept for historic relations." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="9" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="appointment_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_campaign" remarks="Campaign dimension" schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="campaign_id" nullable="false" remarks="Primary key for campaign" size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="campaign_id" foreignKey="erp_v2_dim_contract_voucher_definition_campaign_id__erp_v2_dim_campaign_campaign_id_fkey_de47ec642bb7" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_contract_voucher_definition"/>
            <child catalog="enterprise_4e" column="campaign_id" foreignKey="erp_v2_fct_contract_voucher_campaign_id__erp_v2_dim_campaign_campaign_id_fkey_00f5f09da640" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract_voucher"/>
            <child catalog="enterprise_4e" column="campaign_id" foreignKey="erp_v2_fct_lead_lifetime_campaign_id__erp_v2_dim_campaign_campaign_id_fkey_791cdefd0cec" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_lead_lifetime"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="name" nullable="true" remarks="Campaign name" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="description" nullable="true" remarks="Campaign description. Null values are replaced with 'UNKNOWN'. Truncated to 250 characters." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="external_identifier" nullable="true" remarks="External identifier for the campaign" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="archived" nullable="true" remarks="Permanently removed but kept for historic relations" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="created_date_time" nullable="true" remarks="Timestamp when the campaign was created" size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="7" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="campaign_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_cancellation_reason" remarks="### DEPRECATED. Use `dim_contract_cancellation_reason` instead.&#10;A reason for contract cancellation" schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="cancellation_reason_id" nullable="false" remarks="The primary key of this table. System column calculated by the source System." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="cancellation_reason_id" foreignKey="erp_v2_dim_cancellation_reason_localized_cancellation_reason_id__erp_v2_dim_cancellation_reason_cancellation_r_612cc6936a76" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_cancellation_reason_localized"/>
            <child catalog="enterprise_4e" column="cancellation_reason_id" foreignKey="erp_v2_dim_contract_cancellation_reason_cancellation_reason_id__erp_v2_dim_cancellation_reason_cancellation_re_644d1c4c8bb7" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_contract_cancellation_reason"/>
            <child catalog="enterprise_4e" column="cancellation_reason_id" foreignKey="erp_v2_fct_contract_cancellation_cancellation_reason_id__erp_v2_dim_cancellation_reason_cancellation_reason_id_842390f8bf91" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract_cancellation"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="name" nullable="true" remarks="The name of the reason" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="type" nullable="true" remarks="The type of the reason" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="default_value" nullable="true" remarks="Default value for the reason" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="is_archived" nullable="true" remarks="Indicates whether this cancellation reason has been archived." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="6" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="cancellation_reason_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_cancellation_reason_localized" remarks="The localized version of a cancellation reason, defining translated information of a cancellation reason per locale. &#10;One cancellation reason can have multiple localized versions." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="cancellation_reason_localized_id" nullable="false" remarks="The primary key of this table." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="cancellation_reason_id" nullable="true" remarks="The cancellation reason (unlocalized) to link this localized entry back to a cancellation reason." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="cancellation_reason_id" foreignKey="erp_v2_dim_cancellation_reason_localized_cancellation_reason_id__erp_v2_dim_cancellation_reason_cancellation_r_612cc6936a76" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_cancellation_reason"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="locale" nullable="true" remarks="The locale representing the language and region for which the cancellation reason is translated, &#10;formatted as a combination of ISO-639 language code and ISO-3166 country code (e.g., `de_DE`)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="name" nullable="true" remarks="The localized name of the cancellation reason for this locale." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="5" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="cancellation_reason_localized_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_cash_register" remarks="A physical or virtual point-of-sale register, used to process sales and issue receipts." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="cash_register_id" nullable="false" remarks="The primary key of this table." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="cash_register_id" foreignKey="erp_v2_fct_pos_saleposition_cash_register_id__erp_v2_dim_cash_register_cash_register_id_fkey_9dc8c20076bd" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_pos_saleposition"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="organization_unit_id" nullable="true" remarks="The gym location this cash register belongs to." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_dim_cash_register_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_e6721b9ab5cd" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="name" nullable="true" remarks="Human-readable name of the cash register. Unique per location." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="description" nullable="true" remarks="Optional description of the cash register." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="status" nullable="true" remarks="Current lifecycle status: CREATED, VALIDATION, OPEN, DEACTIVATED, or DEACTIVATED_BY_SYSTEM." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="external_register_id" nullable="true" remarks="Machine-readable identifier of the register, used for fiscal compliance." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="is_regulated" nullable="true" remarks="Whether the register is subject to fiscal regulation." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="created_date" nullable="true" remarks="Timestamp when the cash register was created." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="9" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="cash_register_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_class" remarks="A class that a customer can participate in, e.g. yoga, dance class, etc" schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="class_id" nullable="false" remarks="The primary key of this table. System column calculated by the source System." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="class_id" foreignKey="erp_v2_fct_class_appointment_class_id__erp_v2_dim_class_class_id_fkey_0eb0a68fdacf" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_class_appointment"/>
            <child catalog="enterprise_4e" column="class_id" foreignKey="erp_v2_fct_class_event_class_id__erp_v2_dim_class_class_id_fkey_608cf7f8dd85" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_class_event"/>
            <child catalog="enterprise_4e" column="class_id" foreignKey="erp_v2_fct_trainer_class_appointments_class_id__erp_v2_dim_class_class_id_fkey_40aa8e71a982" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_trainer_class_appointments"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="name" nullable="true" remarks="The name of the class" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="description" nullable="true" remarks="The description of the class" size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="purchasing_type" nullable="true" remarks="A purchasing type of the class" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="free_usage" nullable="true" remarks="Whether or not class is free" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="studio_access_type" nullable="true" remarks="For whom this class is available, such as:&#10;* MAIN_STUDIO: customer's home studio needs to be the same, where the appointment (assigned to benefit) takes place.&#10;* ALL_STUDIOS: all customers are allowed to use it.&#10;* RESTRICTED_STUDIOS: only customers from specific studios can use it." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="archived" nullable="true" remarks="Permanently removed but kept for historic relations." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="booking_option_type" nullable="true" remarks="How a class can be booked:&#10;* USAGE_REQUIRES_CONTINGENT: customer should use contingent to book a class.&#10;* FREE_USAGE: a class is free for booking&#10;* DISPLAY_ONLY: used for MySports. Customers are not able to book this class. Customers can only see when this class will take place" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="9" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="class_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_class_event_property" remarks="The table contains simple properties of class events. This is a junk dimension that stores distinct combinations of event status, source, and booked_for_free flag." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="class_event_property_id" nullable="false" remarks="The primary key of this table. System column calculated by DataOps." size="256" type="varchar" typeCode="12">
            <child catalog="enterprise_4e" column="class_event_property_id" foreignKey="erp_v2_fct_class_event_class_event_property_id__erp_v2_dim_class_event_property_class_event_property_id_fkey_2f246406031f" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_class_event"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="status" nullable="true" remarks="Status of the event, e.g., BOOKED, CANCELED, etc." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="source" nullable="true" remarks="The system from which the event was triggered, e.g., MYSPORTS, INTERNAL_API, etc." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="booked_for_free" nullable="true" remarks="Is this booking event for free, that is, no contingent was used for booking a class" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="5" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="class_event_property_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_closing_hours" remarks="Irregular or recurring closure times for an organization unit (gym). Defines exceptions to the regular opening hours, including one-time closures and yearly recurring closures (holidays, maintenance, etc.). YEARLY entries are expanded into specific datetime ranges based on creation/archival dates." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="closing_hours_id" nullable="false" remarks="The primary key of this table. System column." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="organization_unit_id" nullable="true" remarks="The organization unit (gym) that these closing hours apply to." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_dim_closing_hours_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_82c34000fc77" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="name" nullable="true" remarks="Descriptive name for the closure period (e.g., 'Summer Break', 'Christmas Holiday', 'Maintenance')." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="closure_type" nullable="true" remarks="Type of closure: `ONE_TIME` for specific date ranges, `YEARLY` for annually recurring closures." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="4" name="start_date_time" nullable="true" remarks="Start date and time of the closure period in local studio timezone. For ONE_TIME: converted from UTC to local studio timezone. For YEARLY: calculated start datetime for each year from created_date to year 2045 (non-archived) or to modified_date (archived)." size="29" type="timestamp" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="5" name="end_date_time" nullable="true" remarks="End date and time of the closure period in local studio timezone. For ONE_TIME: converted from UTC to local studio timezone. For YEARLY: calculated end datetime for each year from created_date to year 2045 (non-archived) or to modified_date (archived)." size="29" type="timestamp" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="archived" nullable="true" remarks="Whether this closing hours entry has been archived/deleted." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="created_date" nullable="true" remarks="Date and time when this closing hours entry was originally created." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="9" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="closing_hours_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_company" remarks="A 'partner company' that contracts can be related to for the Corporate Fitness program.&#10;Only includes companies that are currently whitelisted for the studios related to this DWH instance." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="company_id" nullable="false" remarks="The primary key of this table. System column calculated by the source System." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="company_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="bridge_company_to_company_code"/>
            <child catalog="enterprise_4e" column="company_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="bridge_company_to_organization_unit"/>
            <child catalog="enterprise_4e" column="company_id" foreignKey="erp_v2_bridge_rate_bundle_to_company_company_id__erp_v2_dim_company_company_id_fkey_716408ac5f77" implied="false" onDeleteCascade="false" schema="erp_v2" table="bridge_rate_bundle_to_company"/>
            <child catalog="enterprise_4e" column="company_id" foreignKey="erp_v2_dim_contract_voucher_definition_company_id__erp_v2_dim_company_company_id_fkey_70190aaa5d2c" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_contract_voucher_definition"/>
            <child catalog="enterprise_4e" column="company_id" foreignKey="erp_v2_fct_contract_company_id__erp_v2_dim_company_company_id_fkey_8ca1239364d9" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract"/>
            <child catalog="enterprise_4e" column="company_id" foreignKey="erp_v2_fct_contract_voucher_company_id__erp_v2_dim_company_company_id_fkey_9ee647363011" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract_voucher"/>
            <child catalog="enterprise_4e" column="company_id" foreignKey="erp_v2_fct_invoice_company_id__erp_v2_dim_company_company_id_fkey_744909276350" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_invoice"/>
            <child catalog="enterprise_4e" column="company_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="fct_payment"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="company_name" nullable="true" remarks="The name of the partner company." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="external_company_identifier" nullable="true" remarks="A string to identify the company in external systems." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="company_number" nullable="true" remarks="More human-readable identifier key to identify the company. Formatted as `C-&lt;increasing number&gt;` (e.g., `C-1`, `C-2`, ..)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="active" nullable="true" remarks="Whether the company currently is assignable to contracts." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="archived" nullable="true" remarks="Permanently removed but kept for historic relations." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="chamber_of_commerce_number" nullable="true" remarks="The chamber of commerce registration number of the company." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="vat_number" nullable="true" remarks="The VAT (Value Added Tax) identification number of the company." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="contact_firstname" nullable="true" remarks="The first name of the contact person for the company." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="contact_lastname" nullable="true" remarks="The last name of the contact person for the company." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="contact_title" nullable="true" remarks="The title of the contact person for the company." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="contact_street" nullable="true" remarks="The street name of the contact address for the company." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="contact_house_number" nullable="true" remarks="The house number of the contact address for the company." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="contact_zip" nullable="true" remarks="The postal code of the contact address for the company." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="contact_city" nullable="true" remarks="The city of the contact address for the company." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="contact_country" nullable="true" remarks="The country of the contact address for the company." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="contact_email" nullable="true" remarks="The email address of the contact person for the company." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="contact_phone_number" nullable="true" remarks="The phone number of the contact person for the company." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="18" name="contact_mobile_number" nullable="true" remarks="The mobile phone number of the contact person for the company." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="19" name="contact_fax" nullable="true" remarks="The fax number of the contact person for the company." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="20" name="contact_email_status" nullable="true" remarks="The status of the contact email address. One of:&#10;* WARNING: Email address may have issues&#10;* REFUSED_FULL: Email server refused the email completely&#10;* INVALID: Email address is invalid&#10;* REFUSED: Email was refused&#10;* NOT_YET_USED: Email address has not been used yet&#10;* VALID_READ: Email address is valid and has been read&#10;* VALID: Email address is valid&#10;* NO_EMAIL: No email address is set" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="21" name="invoice_firstname" nullable="true" remarks="The first name of the invoice contact person for the company." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="22" name="invoice_lastname" nullable="true" remarks="The last name of the invoice contact person for the company." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="23" name="invoice_title" nullable="true" remarks="The title of the invoice contact person for the company." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="24" name="invoice_street" nullable="true" remarks="The street name of the invoice address for the company." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="25" name="invoice_house_number" nullable="true" remarks="The house number of the invoice address for the company." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="26" name="invoice_zip" nullable="true" remarks="The postal code of the invoice address for the company." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="27" name="invoice_city" nullable="true" remarks="The city of the invoice address for the company." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="28" name="invoice_country" nullable="true" remarks="The country of the invoice address for the company." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="29" name="invoice_email" nullable="true" remarks="The email address of the invoice contact person for the company." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="30" name="invoice_phone_number" nullable="true" remarks="The phone number of the invoice contact person for the company." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="31" name="invoice_mobile_number" nullable="true" remarks="The mobile phone number of the invoice contact person for the company." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="32" name="invoice_fax" nullable="true" remarks="The fax number of the invoice contact person for the company." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="33" name="invoice_email_status" nullable="true" remarks="The status of the invoice email address. One of:&#10;* WARNING: Email address may have issues&#10;* REFUSED_FULL: Email server refused the email completely&#10;* INVALID: Email address is invalid&#10;* REFUSED: Email was refused&#10;* NOT_YET_USED: Email address has not been used yet&#10;* VALID_READ: Email address is valid and has been read&#10;* VALID: Email address is valid&#10;* NO_EMAIL: No email address is set" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="34" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="35" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="company_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_company_code" remarks="Company codes (tags) that can be assigned to companies for categorization and filtering purposes.&#10;Similar to customer codes but for partner companies." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="company_code_id" nullable="false" remarks="The primary key of this table. System column calculated by the source System." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="company_code_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="bridge_company_to_company_code"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="name" nullable="true" remarks="The name of the company code." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="description" nullable="true" remarks="Description of the company code. Defaults to 'UNKNOWN' if not provided." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="color_hex" nullable="true" remarks="Hexadecimal color code for visual representation of the company code." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="5" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="company_code_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_contract_cancellation_property" remarks="### DEPRECATED. Use `dim_contract_cancellation_reason` instead.&#10;A set of basic properties of cancellation such as origin and if the cancellation was extraordinary.&#10;This is a junk dimension containing all distinct combinations of cancellation properties." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="contract_cancellation_property_id" nullable="false" remarks="The primary key of this table." size="256" type="varchar" typeCode="12">
            <child catalog="enterprise_4e" column="contract_cancellation_property_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="fct_contract_cancellation"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="origin" nullable="true" remarks="Who or what initiated contract cancellation" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="extraordinary" nullable="true" remarks="If the contract was canceled before or after terms end date due to particular reasons." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="4" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="contract_cancellation_property_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_contract_cancellation_reason" remarks="Contract cancellations with their reasons. Built from actual contract cancellations that occurred in the system. Includes information about how the cancellation was initiated, the type of cancellation, and the reason." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="contract_cancellation_reason_id" nullable="false" remarks="The primary key of this table." size="256" type="varchar" typeCode="12">
            <child catalog="enterprise_4e" column="contract_cancellation_reason_id" foreignKey="erp_v2_fct_contract_contract_cancellation_reason_id__erp_v2_dim_contract_cancellation_reason_contract_cancella_2593f16b1f8a" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="cancellation_reason_id" nullable="true" remarks="The cancellation reason to link to a localized `contract_cancellation_reason_localized` entry." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="cancellation_reason_id" foreignKey="erp_v2_dim_contract_cancellation_reason_cancellation_reason_id__erp_v2_dim_cancellation_reason_cancellation_re_644d1c4c8bb7" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_cancellation_reason"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="origin" nullable="true" remarks="#### How the contract cancellation was initiated. Possible values:&#10;* CONTRACT_SWITCH (automated or manual switch to new contract),&#10;* CUSTOMER (customer initiated via self-service or staff request),&#10;* STUDIO (staff initiated via backoffice),&#10;* DUNNING (automated due to non-payment),&#10;* IMPORT (migrated from legacy systems)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="extraordinary" nullable="true" remarks="If the contract was canceled before or after terms end date due to a particular reasons." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="name" nullable="true" remarks="The human-readable cancellation reason text in the language of the studio where it was first created." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="type" nullable="true" remarks="Categorization of the cancellation reason. Possible values:&#10;* CONTRACT_SWITCH (membership continues with new contract),&#10;* CUSTOM (contract cancelled with custom reason),&#10;* REST_MATURITY (immediate payment of all outstanding fees due upon cancellation)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="default_value" nullable="true" remarks="System-readable value for pre-generated cancellation reasons displayed as system reasons in the source system." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="8" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="contract_cancellation_reason_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_contract_payment_frequency" remarks="Defines how often and how much is paid for an individual contract." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="contract_payment_frequency_id" nullable="false" remarks="The primary key of this table." size="256" type="varchar" typeCode="12">
            <child catalog="enterprise_4e" column="contract_payment_frequency_id" foreignKey="erp_v2_fct_contract_contract_payment_frequency_id__erp_v2_dim_contract_payment_frequency_contract_payment_freq_9af692569944" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="payment_frequency_type" nullable="true" remarks="#### Type of payment frequency. One of:&#10;* RECURRING: A payment has to be made every value x unit (eg 1 x Week)&#10;* NON_RECURRING: A payment has to be made only once.&#10;* FREE: No Payment has to be made.&#10;* MONTH_DAY_NON_RECURRING: A payment has to be made at specific pre-defined days in the year, only one year long.&#10;* MONTH_DAY_RECURRING: A payment has to be made at specific pre-defined days in a year. Repeating every year.&#10;* TERM_DAYS_NON_RECURRING: A payment has to be made at specific pre-defined days after the contract starts.&#10;* TERM_DAYS_RECURRING: A payment has to be made at specific pre-defined days after each term of a contract starts." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="2" name="payment_frequency_price" nullable="true" remarks="How much has to be paid by the **original contract settings**, which does not take adjustments into account." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="3" name="payment_frequency_current_price" nullable="true" remarks="How much has to be paid taking adjustments into account for the current date" size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="payment_frequency_value" nullable="true" remarks="The interval in `unit` between each payment. Or: How many times a payment has to be made per `unit`." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="payment_frequency_unit" nullable="true" remarks="#### The unit of the interval `value` between each payment. One of:&#10;* DAY&#10;* WEEK&#10;* MONTH&#10;* YEAR&#10;* ONCE: A payment only has to be made once, so an interval is not applicable.&#10;* CUSTOM: The interval of payments is defined in specific dates or days after contract&#10;start / contract term start." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="7" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="contract_payment_frequency_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_contract_property" remarks="A set of basic contract properties, e.g whether or not contract is signed, via which service it was created, is contract disabled, which payment type was used for the contract, etc." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="contract_property_id" nullable="false" remarks="The primary key of this table." size="256" type="varchar" typeCode="12">
            <child catalog="enterprise_4e" column="contract_property_id" foreignKey="erp_v2_fct_contract_contract_property_id__erp_v2_dim_contract_property_contract_property_id_fkey_ed2c046c6e2a" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="contract_status" nullable="true" remarks="`CANCELLED` if the contract is cancelled, else `ACTIVE`. It doesn't matter if the contract's end date is in the future or in the past. It's only relevant if the contract was cancelled or not." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="signature_status" nullable="true" remarks="Whether or not contract was signed, is still in process, or unknown" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="payment_choice" nullable="true" remarks="The payment choice that customer was using for the contract" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="sales_source" nullable="true" remarks="Through which service the contract was created.&#10;- `WEBCLIENT`: Contract created on System Website by employee.&#10;- `CONNECT_API`: Contract created via public API (eg tenant website) &#10;- `SALES_TOOL`: Contract created via “Sales Tool” a special part of&#10;the Website optimized for tablets to easily create&#10;contracts together with the (to-be) member.&#10;- `MYSPORTS`: Contract created via Mysports/Branded App or mysports.&#10;com.&#10;- `TOUCHPOINT`: Contract created via Touchpoint, a self&#10;service solution enabling members to book additional modules via&#10;touch screen in the studio.&#10;- `ONLINE_CHECKOUT_PAGE`: Contract created via Studio&#10;Pages feature (See Settings &gt; Websites &gt; Studio pages)&#10;- `LANDING_PAGE`: Contract created via Landing Page &#10;feature (See Settings &gt; Websites &gt; Landing pages)" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="preuse_type" nullable="true" remarks="If a customer is able to visit the studio before their contract has started:&#10;- `NONE`: customer is not allowed to checkin before `start_date`.&#10;- `FREE`: customer is allowed to checkin before `start_date` but not before `start_date_of_use` (the pre usage is free).&#10;- `CHARGEABLE`: customer is allowed to checkin before `start_date` but not before `start_date_of_use` (customer has to pay for the pre usage)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="disabled" nullable="true" remarks="DEPRECATED, use fct_contract.is_reversed instead. Indicates if the contract has been reversed, effectively nullifying any associated payments and treating the contract as if it never existed in the originating system." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="company_contract" nullable="true" remarks="Whether or not the contract is subsidized by the company the customer is employed at" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="9" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="contract_property_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_contract_term" remarks="The term of the contract." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="contract_term_id" nullable="false" remarks="The primary key of this table." size="256" type="varchar" typeCode="12">
            <child catalog="enterprise_4e" column="contract_term_id" foreignKey="erp_v2_fct_contract_contract_term_id__erp_v2_dim_contract_term_contract_term_id_fkey_313196804702" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="value" nullable="true" remarks="The measure of the term" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="unit" nullable="true" remarks="The unit measure of the term value" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="4" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="contract_term_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_contract_voucher_definition" remarks="A definition of a voucher that can be generated into voucher codes and applied to a contract to get a discount or credit. &#10;Vouchers can be used to grant discounts on contracts, waive fees, or provide credit." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="contract_voucher_definition_id" nullable="false" remarks="The primary key of this table. System column calculated by the source system." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="contract_voucher_definition_id" foreignKey="erp_v2_dim_contract_voucher_definition_localized_contract_voucher_definition_id__erp_v2_dim_contract_voucher_d_cecef4a0b550" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_contract_voucher_definition_localized"/>
            <child catalog="enterprise_4e" column="contract_voucher_definition_id" foreignKey="erp_v2_dim_contract_voucher_rate_discount_period_contract_voucher_definition_id__erp_v2_dim_contract_voucher_d_cdc745c0b2a0" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_contract_voucher_rate_discount_period"/>
            <child catalog="enterprise_4e" column="contract_voucher_definition_id" foreignKey="erp_v2_fct_contract_voucher_contract_voucher_definition_id__erp_v2_dim_contract_voucher_definition_contract_vo_0c28e7e59b34" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract_voucher"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="company_id" nullable="true" remarks="The partner company this voucher definition is associated with, if applicable. Used for company vouchers." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="company_id" foreignKey="erp_v2_dim_contract_voucher_definition_company_id__erp_v2_dim_company_company_id_fkey_70190aaa5d2c" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_company"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="campaign_id" nullable="true" remarks="The campaign this voucher definition is associated with, if applicable." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="campaign_id" foreignKey="erp_v2_dim_contract_voucher_definition_campaign_id__erp_v2_dim_campaign_campaign_id_fkey_de47ec642bb7" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_campaign"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="rate_id" nullable="true" remarks="The specific rate this voucher definition is linked to, if type is CONTRACT. This means the voucher is only valid for this specific rate." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_id" foreignKey="erp_v2_dim_contract_voucher_definition_rate_id__erp_v2_dim_rate_rate_id_fkey_c565bcfd10eb" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="6" id="4" name="created_date" nullable="true" remarks="Date when this voucher definition was created." size="29" type="timestamp" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="5" name="limited_offering_start_date" nullable="true" remarks="Start date when this voucher definition can be offered to customers. Defines the validity period for offering the voucher." size="29" type="timestamp" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="6" name="limited_offering_end_date" nullable="true" remarks="End date when this voucher definition can no longer be offered to customers. Defines the validity period for offering the voucher." size="29" type="timestamp" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="7" name="limited_use_start_date" nullable="true" remarks="Start date when vouchers from this definition can be redeemed. Defines the validity period for redeeming the voucher." size="29" type="timestamp" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="8" name="limited_use_end_date" nullable="true" remarks="End date when vouchers from this definition can no longer be redeemed. Defines the validity period for redeeming the voucher." size="29" type="timestamp" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="contract_voucher_definition_name" nullable="true" remarks="The name given to this voucher definition. This name is visible when selecting the voucher." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="voucher_generation_type" nullable="true" remarks="Type of voucher generation: STATIC (single code for multiple uses, e.g. 'SUMMER2025') or INDIVIDUAL (unique codes for each use, generated with a prefix)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="contract_voucher_type" nullable="true" remarks="#### The type of benefit this voucher provides.&#10;One of:&#10;* CREDIT: Fixed amount credit applied to the customer's account.&#10;* DISCOUNT: Discount applied to the contract.&#10;* CONTRACT: Voucher tied to a specific contract that is free of charge.&#10;* COMPANY_FEE_SPLIT: Partner company pays part of the fee." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="static_voucher_code" nullable="true" remarks="The static voucher code if voucher_generation_type is STATIC. This is the code customers enter to redeem the voucher." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="individual_voucher_code_prefix" nullable="true" remarks="The prefix used for generating individual voucher codes if voucher_type is INDIVIDUAL. The system appends a unique string to this prefix." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="static_voucher_quantity" nullable="true" remarks="Maximum number of times the static voucher can be used. Null means unlimited usage." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="archived" nullable="true" remarks="Whether this voucher definition has been permanently removed but kept for historic relations." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="16" name="credit_amount" nullable="true" remarks="The credit amount provided by this voucher, if type is CREDIT. This amount is credited to the member's account." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="legacy_discount_type" nullable="true" remarks="The type of discount: ABSOLUTE or PERCENTAGE. Note: This field is deprecated, use dim_contract_voucher_rate_discount_period instead." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="18" name="legacy_discount_absolute_amount" nullable="true" remarks="The absolute discount amount if discount_type is ABSOLUTE. Note: This field is deprecated, use dim_contract_voucher_rate_discount_period instead." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="19" name="legacy_discount_percentage" nullable="true" remarks="The percentage discount if discount_type is PERCENTAGE. Note: This field is deprecated, use dim_contract_voucher_rate_discount_period instead." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="20" name="applies_to_starter_package" nullable="true" remarks="Whether the voucher definition applies to the starter package." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="21" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="22" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="contract_voucher_definition_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_contract_voucher_definition_localized" remarks="Localized text for contract voucher definitions, one row per definition per locale.&#10;Includes the public-facing name and description shown to members, plus the staff-only&#10;internal description used to categorise a promotion or voucher (not visible to members)." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="contract_voucher_definition_localized_id" nullable="false" remarks="The primary key of this table. Surrogate key derived from (contract_voucher_definition_id, locale)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="contract_voucher_definition_id" nullable="true" remarks="The contract voucher definition this translation belongs to." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="contract_voucher_definition_id" foreignKey="erp_v2_dim_contract_voucher_definition_localized_contract_voucher_definition_id__erp_v2_dim_contract_voucher_d_cecef4a0b550" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_contract_voucher_definition"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="locale" nullable="true" remarks="The locale representing the language and region for which the voucher definition is translated,&#10;formatted as a combination of ISO-639 language code and ISO-3166 country code (e.g., `de_DE`)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="public_name" nullable="true" remarks="The public-facing name of the voucher definition shown to members, for this locale." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="description" nullable="true" remarks="The public-facing description of the voucher definition shown to members, for this locale." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="sub_description" nullable="true" remarks="A secondary, public-facing description of the voucher definition shown to members, for this locale." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="footnote" nullable="true" remarks="Footnote text associated with the voucher definition, shown to members, for this locale." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="contract_remarks" nullable="true" remarks="Remarks shown on the contract document for this voucher definition, for this locale." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="internal_description" nullable="true" remarks="A description that can categorise or annotate this voucher definition/promotion. Not visible to members. Truncated to 650 characters to fit Redshift column constraints." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="10" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="contract_voucher_definition_localized_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_contract_voucher_rate_discount_period" remarks="A period during which a discount is applied in the context of a contract voucher. Discounts are defined at a hierarchical granularity: rate → term configuration → payment frequency. A null at any level means the discount applies to all values at that level and below. For example, a null rate_id means the discount covers all rates; a set rate_id with a null rate_term_configuration_id means all term configurations of that rate." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="contract_voucher_rate_discount_period_id" nullable="false" remarks="The primary key of this table. System column calculated by the source system." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="contract_voucher_definition_id" nullable="true" remarks="The voucher definition this discount period belongs to. Null if linked only to a specific voucher." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="contract_voucher_definition_id" foreignKey="erp_v2_dim_contract_voucher_rate_discount_period_contract_voucher_definition_id__erp_v2_dim_contract_voucher_d_cdc745c0b2a0" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_contract_voucher_definition"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="contract_voucher_id" nullable="true" remarks="The specific redeemed voucher this discount period is linked to. Null if linked only to the definition." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="contract_voucher_id" foreignKey="erp_v2_dim_contract_voucher_rate_discount_period_contract_voucher_id__erp_v2_fct_contract_voucher_contract_vou_e703b72da57c" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract_voucher"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="rate_id" nullable="true" remarks="The specific rate this discount applies to. Null if the discount applies to all rates." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_id" foreignKey="erp_v2_dim_contract_voucher_rate_discount_period_rate_id__erp_v2_dim_rate_rate_id_fkey_0f1b67906738" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="rate_term_configuration_id" nullable="true" remarks="The specific term configuration (contract term, cancellation period, etc.) this discount is restricted to. Null if the discount applies to all term configurations of the rate. Only meaningful when rate_id is set. Joins to dim_rate_term_configuration." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_term_configuration_id" foreignKey="erp_v2_dim_contract_voucher_rate_discount_period_rate_term_configuration_id__erp_v2_dim_rate_term_configuratio_0956186ce754" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate_term_configuration"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="rate_term_payment_frequency_id" nullable="true" remarks="The specific payment frequency (e.g. monthly, annual) this discount is restricted to. Null if the discount applies to all payment frequencies of the term configuration. Only meaningful when rate_term_configuration_id is set. Joins to dim_rate_term_payment_frequency." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_term_payment_frequency_id" foreignKey="erp_v2_dim_contract_voucher_rate_discount_period_rate_term_payment_frequency_id__erp_v2_dim_rate_term_payment__f347a8726f1b" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate_term_payment_frequency"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="effective_period" nullable="true" remarks="#### Description on how long this discount period is effective for.&#10;One of:&#10;* TIME_BASED: The discount is effective for a specific time period defined by `effective_period_time_based_term_value` and `effective_period_time_based_term_unit`.&#10;* UNLIMITED: The discount is effective indefinitely.&#10;* INITIAL_TERM: The discount is effective for the initial term of the contract." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="effective_period_time_based_term_value" nullable="true" remarks="The numeric value of the time-based term for this discount period (e.g., 3 for 3 months). Only applicable if effective_period is TIME_BASED." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="effective_period_time_based_term_unit" nullable="true" remarks="The unit of the time-based term (e.g., MONTHS, WEEKS, DAYS). Only applicable if effective_period is TIME_BASED." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="discount_position" nullable="true" remarks="The position/order of this discount in a sequence of multiple discount periods." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="discount_type" nullable="true" remarks="The type of discount: ABSOLUTE (fixed amount) or PERCENTAGE." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="11" name="discount_absolute_amount" nullable="true" remarks="The absolute discount amount if discount_type is ABSOLUTE." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="12" name="discount_percentage" nullable="true" remarks="The percentage discount if discount_type is PERCENTAGE. E.g., 100.00 for free." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="14" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="contract_voucher_rate_discount_period_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_currency" remarks="All available currencies" schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="currency_id" nullable="false" remarks="Primary key of this table." size="256" type="varchar" typeCode="12">
            <child catalog="enterprise_4e" column="currency_id" foreignKey="erp_v2_fct_contract_cancellation_currency_id__erp_v2_dim_currency_currency_id_fkey_f92da2de7845" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract_cancellation"/>
            <child catalog="enterprise_4e" column="currency_id" foreignKey="erp_v2_fct_idle_period_currency_id__erp_v2_dim_currency_currency_id_fkey_331a01d0c42d" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_idle_period"/>
            <child catalog="enterprise_4e" column="currency_id" foreignKey="erp_v2_fct_invoice_currency_id__erp_v2_dim_currency_currency_id_fkey_572bc6bb4efa" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_invoice"/>
            <child catalog="enterprise_4e" column="currency_id" foreignKey="erp_v2_fct_payment_currency_id__erp_v2_dim_currency_currency_id_fkey_a06f02bdffbe" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_payment"/>
            <child catalog="enterprise_4e" column="currency_id" foreignKey="erp_v2_fct_payment_run_currency_id__erp_v2_dim_currency_currency_id_fkey_3e612dd303a5" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_payment_run"/>
            <child catalog="enterprise_4e" column="currency_id" foreignKey="erp_v2_fct_revenue_currency_id__erp_v2_dim_currency_currency_id_fkey_61503c820a1c" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_revenue"/>
            <child catalog="enterprise_4e" column="currency_id" foreignKey="erp_v2_fct_revenue_cash_based_currency_id__erp_v2_dim_currency_currency_id_fkey_2b0e240e4321" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_revenue_cash_based"/>
            <child catalog="enterprise_4e" column="currency_id" foreignKey="erp_v2_fct_revenue_invoice_based_currency_id__erp_v2_dim_currency_currency_id_fkey_946272c93489" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_revenue_invoice_based"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="name" nullable="true" remarks="Human readable name of the currency" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="code" nullable="true" remarks="ISO 4217 currency code" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="numeric_code" nullable="true" remarks="ISO 4217 numeric code" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="5" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="currency_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_customer" remarks="A customer is a person who signed up to a studio owned by you or your franchise." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="customer_id" nullable="false" remarks="The primary key of this table. System column calculated by the source System." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_bridge_customer_group_to_customer_customer_id__erp_v2_dim_customer_customer_id_fkey_4148985e8f30" implied="false" onDeleteCascade="false" schema="erp_v2" table="bridge_customer_group_to_customer"/>
            <child catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_bridge_customer_to_customer_code_customer_id__erp_v2_dim_customer_customer_id_fkey_6d686c59d642" implied="false" onDeleteCascade="false" schema="erp_v2" table="bridge_customer_to_customer_code"/>
            <child catalog="enterprise_4e" column="customer_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_customer_communication_consent"/>
            <child catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_dim_customer_custom_field_customer_id__erp_v2_dim_customer_customer_id_fkey_d73bcf978e91" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer_custom_field"/>
            <child catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_dim_customer_dunning_configuration_customer_id__erp_v2_dim_customer_customer_id_fkey_1ac71bcccf0f" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer_dunning_configuration"/>
            <child catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_dim_payment_instrument_customer_id__erp_v2_dim_customer_customer_id_fkey_1d94a658b247" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_payment_instrument"/>
            <child catalog="enterprise_4e" column="paying_customer_id" foreignKey="erp_v2_dim_payment_instrument_paying_customer_id__erp_v2_dim_customer_customer_id_fkey_2652b076ff2a" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_payment_instrument"/>
            <child catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_dim_purchased_contingent_customer_id__erp_v2_dim_customer_customer_id_fkey_3991af1b86ab" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_purchased_contingent"/>
            <child catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_checkin_customer_id__erp_v2_dim_customer_customer_id_fkey_7952116f2b18" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_checkin"/>
            <child catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_class_event_customer_id__erp_v2_dim_customer_customer_id_fkey_a00da0c26bf7" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_class_event"/>
            <child catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_contract_customer_id__erp_v2_dim_customer_customer_id_fkey_37033086980d" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract"/>
            <child catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_contract_cancellation_customer_id__erp_v2_dim_customer_customer_id_fkey_6b34f21d3ca5" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract_cancellation"/>
            <child catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_contract_price_history_customer_id__erp_v2_dim_customer_customer_id_fkey_b2ed05f46d44" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract_price_history"/>
            <child catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_contract_term_dates_customer_id__erp_v2_dim_customer_customer_id_fkey_62bfcf6248f3" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract_term_dates"/>
            <child catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_customer_appointment_customer_id__erp_v2_dim_customer_customer_id_fkey_7869556c7673" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_customer_appointment"/>
            <child catalog="enterprise_4e" column="referred_customer_id" foreignKey="erp_v2_fct_customer_referral_referred_customer_id__erp_v2_dim_customer_customer_id_fkey_10688aacefae" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_customer_referral"/>
            <child catalog="enterprise_4e" column="referring_customer_id" foreignKey="erp_v2_fct_customer_referral_referring_customer_id__erp_v2_dim_customer_customer_id_fkey_9ed5c601064c" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_customer_referral"/>
            <child catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_customer_studio_history_customer_id__erp_v2_dim_customer_customer_id_fkey_87a3526d7c02" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_customer_studio_history"/>
            <child catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_dunning_step_customer_id__erp_v2_dim_customer_customer_id_fkey_1879304da46c" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_dunning_step"/>
            <child catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_idle_period_customer_id__erp_v2_dim_customer_customer_id_fkey_f8f5fa2aadee" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_idle_period"/>
            <child catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_invoice_customer_id__erp_v2_dim_customer_customer_id_fkey_6bae03ba04a1" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_invoice"/>
            <child catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_lead_lifetime_customer_id__erp_v2_dim_customer_customer_id_fkey_8e5fc9fefb54" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_lead_lifetime"/>
            <child catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_lead_stage_history_customer_id__erp_v2_dim_customer_customer_id_fkey_4f92f3f5c4c9" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_lead_stage_history"/>
            <child catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_payment_customer_id__erp_v2_dim_customer_customer_id_fkey_e319be685fa2" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_payment"/>
            <child catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_payment_instrument_status_history_customer_id__erp_v2_dim_customer_customer_id_fkey_c435bb107490" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_payment_instrument_status_history"/>
            <child catalog="enterprise_4e" column="paying_customer_id" foreignKey="erp_v2_fct_payment_instrument_status_history_paying_customer_id__erp_v2_dim_customer_customer_id_fkey_5618b8434946" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_payment_instrument_status_history"/>
            <child catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_payment_run_customer_id__erp_v2_dim_customer_customer_id_fkey_8bd139378cfb" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_payment_run"/>
            <child catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_revenue_customer_id__erp_v2_dim_customer_customer_id_fkey_813904625cce" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_revenue"/>
            <child catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_revenue_cash_based_customer_id__erp_v2_dim_customer_customer_id_fkey_9fcfa77af3ae" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_revenue_cash_based"/>
            <child catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_revenue_invoice_based_customer_id__erp_v2_dim_customer_customer_id_fkey_324f3c30b638" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_revenue_invoice_based"/>
            <child catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_service_usage_customer_id__erp_v2_dim_customer_customer_id_fkey_3b345e479996" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_service_usage"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="customer_number" nullable="true" remarks="More human-readable identifier key to identify the person. Formatted as studioprefix-number (eg AB-123). Freed up (set null) on archived customers to redistribute." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="imported_customer_number" nullable="true" remarks="The customer number as it was set in a previous system the customer was imported from. Only set if it was specifically required in the import-process." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="third_party_id" nullable="true" remarks="A unique identifier of the person in a third-party system. This is used to link the person to a third-party system, like a CRM or ERP system." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="customer_status" nullable="true" remarks="#### The current (business) relation of the person to the studio.&#10;One of:&#10;* PROSPECT: The person entered contact information but has no valid contract (yet).&#10;* MEMBER: The person has a valid contract which end_date is in the future.&#10;* FORMER_MEMBER: The person had a valid contract which end_date is in the past." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="firstname" nullable="true" remarks="The personal name given to the person at birth" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="second_firstname" nullable="true" remarks="The personal name given to the person at birth" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="lastname" nullable="true" remarks="The family name of the person" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="second_lastname" nullable="true" remarks="The family name of the person" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="tel_private" nullable="true" remarks="The private phone number of the person" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="tel_private_mobile" nullable="true" remarks="The private mobile phone number of the person" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="tel_business" nullable="true" remarks="The at-work phone number of the person" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="tel_business_mobile" nullable="true" remarks="The at-work mobile phone number of the person" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="email" nullable="true" remarks="The email address of the person" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="email_verification_status" nullable="true" remarks="#### The current state of verification of the persons email address.&#10;One of:&#10;* **INITIAL**: No verification email was sent yet.&#10;* **PENDING**: The verification email was sent and is waiting for action of the recipient.&#10;* **VERIFIED**: The recipient successfully verified the email address by clicking the verification link.&#10;* **UNVERIFIED**: No email address is set or the recipient did not react on the verification email for 24 hours." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="gender" nullable="true" remarks="The sex the person identifies with" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="date_of_birth" nullable="true" remarks="The date at which the person was born" size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="place_of_birth" nullable="true" remarks="The name of the city the person was born" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="18" name="country_of_birth" nullable="true" remarks="The name of the nation the person was born" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="19" name="deceased" nullable="true" remarks="Whether the person died" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="20" name="archived" nullable="true" remarks="Permanently removed but kept for historic relations" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="21" name="referral_code" nullable="true" remarks="Unique personal code the customer can share with others to refer them to the gym. Stays the same for the lifetime of the customer account." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="22" name="excluded_from_referral" nullable="true" remarks="When true the customer is excluded from the referral program and the invite-friends section is hidden from their member platform." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="23" name="created_date" nullable="true" remarks="Date when the customer was added to the current Systems database" size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="24" name="locale" nullable="true" remarks="The language of a customer represented by its ISO-639 and ISO-3166 Code" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="25" name="customer_origin" nullable="true" remarks="##### Through which system the customer was created.&#10;* **WEBCLIENT**: Customer created via System website by an employee.&#10;* **CONNECT_API**: Customer created via the public Systems API (eg tenant website)&#10;* **EXTERNAL**: Customer created via Partner Integration.&#10;* **SALES_TOOL**: Customer created via &quot;Sales Tool&quot; a special part of the&#10;Systems website optimized for tablets to easily create contracts&#10;together with the (to-be) member.&#10;* **LEGACY_MYSPORTS**: Customer created via Mysports/Branded App or mysports.com&#10;(only set for customers created as leads before 2023-08).&#10;* **MYSPORTS_APP**: Customer created via Mysports/Branded App.&#10;* **MYSPORTS_WEB**: Customer created via mysports.com&#10;* **ONLINE_CHECKOUT_PAGE**: Customer created via Studio Pages feature&#10;(See Settings &gt; Websites &gt; Studio pages)&#10;* **LEGACY_WEB**: Customer created via CONNECT_API, ONLINE_CHECKOUT_PAGE or similar&#10;Web sources of the System (only set for customers created as leads before 2023-08)&#10;* **IMPORT-***: Customer was imported from another system or from a file and other origins&#10;can't be determined.&#10;* **UNKNOWN**: The origin can not or no longer be determined. (Often the case for customers&#10;created as leads before 2023-08)" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="26" name="street" nullable="true" remarks="The name of the street the person lives in" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="27" name="house_number" nullable="true" remarks="The unique identifier of a building in a street the person lives in" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="28" name="zip" nullable="true" remarks="The ZIP-Code (postal code) of the place the person lives in" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="29" name="city" nullable="true" remarks="The name of the settlement the person lives in" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="30" name="country" nullable="true" remarks="The 2-letter ISO 3166 abbreviation of the country the person lives in" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="31" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="32" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="customer_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_customer_code" remarks="Dimension table containing customer codes (tags) used to categorize customers.&#10;Customer codes help organize and filter customers based on business-defined categories.&#10;Each customer code has a unique identifier and can be associated with multiple customers." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="customer_code_id" nullable="false" remarks="Unique identifier for the customer code (primary key)" size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="customer_code_id" foreignKey="erp_v2_bridge_customer_to_customer_code_customer_code_id__erp_v2_dim_customer_code_customer_code_id_fkey_60a1d958f68c" implied="false" onDeleteCascade="false" schema="erp_v2" table="bridge_customer_to_customer_code"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="name" nullable="true" remarks="Display name of the customer code" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="description" nullable="true" remarks="Detailed description of the customer code purpose and usage. Defaults to 'UNKNOWN' if not provided." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="color_hex" nullable="true" remarks="Hexadecimal color code for visual representation of the customer code in UI" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="active" nullable="true" remarks="Indicates if the customer code is currently active and available for use" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="archived" nullable="true" remarks="Indicates if the customer code has been archived and is no longer in regular use" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="7" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="customer_code_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_customer_communication_consent" remarks="Dimension table that tracks customer communication consent preferences across different message categories.&#10;This table combines customer-level and organization-level communication configurations, with customer-level &#10;settings taking priority over organization-level defaults." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="customer_communication_consent_id" nullable="false" remarks="Unique identifier for each customer communication consent record (MD5 hash of customer_id and message_category)" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="customer_id" nullable="true" remarks="Unique identifier for the customer" size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_customer"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="organization_unit_id" nullable="true" remarks="The studio of the customer giving consent." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_dim_customer_communication_consent_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_17e4f8f0f3bc" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="configuration_origin" nullable="true" remarks="Indicates whether the communication configuration comes from customer-level settings or organization-level defaults.&#10;Values: 'CUSTOMER' or 'ORGANIZATION_UNIT'" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="message_category" nullable="true" remarks="The category of messages for which consent is being tracked (e.g., marketing, transactional)" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="modified_date" nullable="true" remarks="Timestamp when the communication configuration was last modified" size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="allows_mysports" nullable="true" remarks="Flag indicating if customer allows MySports app messages" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="allows_email" nullable="true" remarks="Flag indicating if customer allows email communications" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="allows_text_message" nullable="true" remarks="Flag indicating if customer allows text message (SMS) communications" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="allows_phone" nullable="true" remarks="Flag indicating if customer allows phone call communications" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="allows_letter" nullable="true" remarks="Flag indicating if customer allows postal mail communications" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="allows_all_communication_channels" nullable="true" remarks="Flag indicating if customer allows all communication channels (MySports, email, text, phone, and letter)" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="communication_channels" nullable="true" remarks="Comma-separated list of allowed communication channels (e.g., 'EMAIL,TEXT_MESSAGE,PHONE')" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="14" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="customer_communication_consent_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_customer_custom_field" remarks="Custom field values assigned to customers on lead or member level." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="customer_custom_field_id" nullable="false" remarks="The primary key of this table." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="customer_id" nullable="true" remarks="The customer this custom field value belongs to." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_dim_customer_custom_field_customer_id__erp_v2_dim_customer_customer_id_fkey_d73bcf978e91" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="field_name" nullable="true" remarks="The name of the custom field." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="field_type" nullable="true" remarks="The data type of the custom field. One of: BOOLEAN, DATE, LIST, NUMERIC, TEXT." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="field_value" nullable="true" remarks="The value of the custom field, converted to string format." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="level" nullable="true" remarks="The level at which the custom field is assigned. LEAD for additional field values assigned during lead capture, MEMBER for dataplus assignments for active/former members." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="created_date" nullable="true" remarks="UTC Timestamp at which the custom field value was created." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="8" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="customer_custom_field_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_customer_dunning_configuration" remarks="Dimension table exposing the dunning and billing stop configuration per customer.&#10;Each customer has at most one row. All four stop types are sourced from a single&#10;record configured manually by studio operators.&#10;&#10;Stop types use a three-value LimitType pattern:&#10;  - DISABLED  — the stop is not active&#10;  - UNLIMITED — the stop is permanently active (until_date is NULL)&#10;  - LIMITED   — the stop is active until until_date (inclusive)&#10;&#10;To test whether a stop is currently active as of a reference date, apply:&#10;  &lt;stop&gt;_limit_type = 'UNLIMITED'&#10;  OR (&lt;stop&gt;_limit_type = 'LIMITED' AND &lt;stop&gt;_until_date &gt;= &lt;reference_date&gt;)&#10;&#10;**Important:** This table covers only **manually configured** stops&#10;set by studio operators. Dunning-engine-triggered&#10;collection stops (automatically set when a dunning level is reached) are stored in&#10;`fct_dunning_step` (collection_stop column). Combine both sources for a&#10;complete collection stop picture:&#10;&#10;```sql&#10;-- All customers with an active collection stop as of a reference date:&#10;SELECT customer_id FROM dim_customer_dunning_configuration&#10;WHERE collection_stop_limit_type = 'UNLIMITED'&#10;   OR (collection_stop_limit_type = 'LIMITED' AND collection_stop_until_date &gt;= '&lt;ref_date&gt;')&#10;UNION&#10;SELECT customer_id FROM fct_dunning_step&#10;WHERE collection_stop IS TRUE&#10;  AND dunning_date &lt;= '&lt;ref_date&gt;'&#10;  AND (withdrawn_date IS NULL OR withdrawn_date::date &gt; '&lt;ref_date&gt;')&#10;```&#10;&#10;Use cases:&#10;  - Active billable member counts: exclude customers where collection_stop_limit_type&#10;    is UNLIMITED or (LIMITED and collection_stop_until_date &gt;= reference_date)&#10;  - Dunning portfolio analysis: identify customers where dunning is paused&#10;  - Debt collection oversight: track customers blocked from external collection handover&#10;  - Invoice audit: identify customers where invoice generation is suppressed" schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="customer_dunning_configuration_id" nullable="false" remarks="Primary key of this table. Uniquely identifies this customer's dunning configuration." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="customer_id" nullable="true" remarks="The customer this dunning configuration belongs to. One configuration record exists per customer." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_dim_customer_dunning_configuration_customer_id__erp_v2_dim_customer_customer_id_fkey_1ac71bcccf0f" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="created_date" nullable="true" remarks="Timestamp when this configuration record was created. Use as a lower-bound guard in historical queries: a stop can only have been active as of dates on or after this timestamp." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="collection_stop_limit_type" nullable="true" remarks="Whether payment collection runs are blocked for this customer.&#10;When active, the customer will not be included in payment collection runs and&#10;will appear as an `EXCLUDED_BOOKING` with reason `COLLECTION_STOP` in `fct_payment_run`.&#10;&#10;#### Values&#10;* `DISABLED` — no collection stop active&#10;* `UNLIMITED` — collection permanently stopped&#10;* `LIMITED` — collection stopped until `collection_stop_until_date` (inclusive)" size="10" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="collection_stop_until_date" nullable="true" remarks="The date until which the collection stop is active (inclusive). Only populated when `collection_stop_limit_type` is `LIMITED`. NULL for `DISABLED` and `UNLIMITED`." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="dunning_stop_limit_type" nullable="true" remarks="Whether the dunning process (payment reminder escalation) is paused for this customer.&#10;&#10;#### Values&#10;* `DISABLED` — dunning proceeds normally&#10;* `UNLIMITED` — dunning permanently paused&#10;* `LIMITED` — dunning paused until `dunning_stop_until_date` (inclusive)" size="10" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="dunning_stop_until_date" nullable="true" remarks="The date until which the dunning stop is active (inclusive). Only populated when `dunning_stop_limit_type` is `LIMITED`. NULL for `DISABLED` and `UNLIMITED`." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="debt_collection_stop_limit_type" nullable="true" remarks="Whether handover of this customer's debt to an external debt collection agency is blocked.&#10;&#10;#### Values&#10;* `DISABLED` — debt collection handover proceeds normally&#10;* `UNLIMITED` — handover permanently blocked&#10;* `LIMITED` — handover blocked until `debt_collection_stop_until_date` (inclusive)" size="10" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="debt_collection_stop_until_date" nullable="true" remarks="The date until which the debt collection stop is active (inclusive). Only populated when `debt_collection_stop_limit_type` is `LIMITED`. NULL for `DISABLED` and `UNLIMITED`." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="invoice_stop_limit_type" nullable="true" remarks="Whether invoice generation is suppressed for this customer.&#10;&#10;#### Values&#10;* `DISABLED` — invoices are generated normally&#10;* `UNLIMITED` — invoice generation permanently suppressed&#10;* `LIMITED` — invoice generation suppressed until `invoice_stop_until_date` (inclusive)" size="10" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="invoice_stop_until_date" nullable="true" remarks="The date until which the invoice stop is active (inclusive). Only populated when `invoice_stop_limit_type` is `LIMITED`. NULL for `DISABLED` and `UNLIMITED`." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="invoice_stop_on_delete" nullable="true" remarks="Whether an invoice stop is automatically applied when the customer record is deleted. This is a system-level configuration flag set per customer. NULL when not explicitly configured." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="13" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="customer_dunning_configuration_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_customer_group" remarks="One row per customer group configured in the system. Customer groups classify&#10;customers by membership arrangement and determine whether group discounts apply&#10;to their contracts. Groups belong to an organization unit and come in three&#10;types: `Customer` (a generic grouping for shared discounts), `Premium` (an&#10;elevated-tier group linking a referred customer to a referrer), and&#10;`Shared Contract` (a family plan in which all members share a single contract).&#10;The group `type` governs discount behaviour, member capacity limits, and&#10;contract linking throughout the model." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="customer_group_id" nullable="false" remarks="Unique identifier for the customer group." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="customer_group_id" foreignKey="erp_v2_bridge_customer_group_to_customer_customer_group_id__erp_v2_dim_customer_group_customer_group_id_fkey_5e8065fbc643" implied="false" onDeleteCascade="false" schema="erp_v2" table="bridge_customer_group_to_customer"/>
            <child catalog="enterprise_4e" column="customer_group_id" foreignKey="erp_v2_dim_customer_group_member_discount_customer_group_id__erp_v2_dim_customer_group_customer_group_id_fkey_b1ddf1fcd7b5" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer_group_member_discount"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="organization_unit_id" nullable="true" remarks="The organization unit that owns the customer group." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_dim_customer_group_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_4fdcd4b09658" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="contract_id" nullable="true" remarks="The contract shared by all members of this group. Only populated when `type = 'Shared Contract'`." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="contract_id" foreignKey="erp_v2_dim_customer_group_contract_id__erp_v2_fct_contract_contract_id_fkey_f3bb8a9435ed" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="name" nullable="true" remarks="Display name of the customer group. Auto-generated for `Customer` type groups (prefixed `CG`). Always `UNKNOWN` for `Premium` type groups, which carry no name." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="code" nullable="true" remarks="Business code used to identify the customer group. Auto-generated for `Customer` type groups (prefixed `CG`). Always `UNKNOWN` for `Premium` type groups, which carry no code." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="type" nullable="true" remarks="The type of customer group, determining its purpose and behaviour:&#10;* Customer: A generic grouping of customers (e.g. for shared discounts).&#10;* Premium: A premium-tier group with elevated benefits or pricing rules.&#10;* Shared Contract: A group whose members share a single contract (e.g. a family plan)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="is_discountable" nullable="true" remarks="Whether this group is configured to apply a discount to eligible members' contracts. Always `true` for `Premium` type groups. When `false`, no group discount is applied." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="discount_type" nullable="true" remarks="How the group's discount values are expressed: `PERCENTAGE` (0-100) or `ABSOLUTE` (fixed amount). NULL when the group has no discount tiers configured." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="apply_discount_during_paid_period" nullable="true" remarks="Controls whether the group discount is charged during the billing period in&#10;which the member joins the group, or deferred to the start of the next billing cycle.&#10;The group discount's effective date (visible as `fct_contract_price_history.valid_from_date`&#10;where `dynamic_adjustment_origin = 'CUSTOMER_GROUP'`) is always set to the membership&#10;start date (`bridge_customer_group_to_customer.start_date`) in both cases.&#10;Always `true` for `Premium` type groups.&#10;* When `true`: the group discount is charged proportionally within the billing period&#10;  it falls into. The period is split at the membership start date — the portion before&#10;  is charged at the original price, the remainder at the discounted price.&#10;* When `false`: the current billing period is charged in full at the original price.&#10;  The group discount takes effect only from the start of the next billing cycle.&#10;NULL when `is_discountable` is false." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="max_member_count" nullable="true" remarks="Maximum number of members allowed in the group. Always `2` for `Premium` type groups (one discount receiver, one referred customer). NULL when no explicit limit is configured for `Customer` or `Shared Contract` groups." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="max_full_age_member_count" nullable="true" remarks="Maximum number of adult members allowed in the group. Only populated when `type = 'Shared Contract'`." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="max_under_age_member_count" nullable="true" remarks="Maximum number of underage members allowed in the group. Only populated when `type = 'Shared Contract'`." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="12" name="discount_value" nullable="true" remarks="Extra discount added on top of the group discount step matched from the group's&#10;discount schedule (see `dim_customer_group_member_discount`) for the current&#10;eligible group size. Applied to the contracts of eligible group members&#10;(see `bridge_customer_group_to_customer.discountable`). The value is a percentage&#10;(0-100) or an absolute amount, as defined by `discount_type`. Only `Customer` type&#10;groups can carry a non-zero value here — `Premium` and `Shared Contract` groups&#10;always have `0`." size="23" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="is_archived" nullable="true" remarks="Whether the customer group has been archived." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="15" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="customer_group_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_customer_group_member_discount" remarks="Defines the group discount schedule for a customer group. Each row is one step in&#10;the schedule: when the number of eligible group members reaches or exceeds&#10;`min_member_count`, that step's `discount_value` becomes the group discount applied&#10;to all eligible members' contracts. The highest matching step is always used — for&#10;example, with thresholds at 2 members (5%) and 4 members (10%), a group of 4 eligible&#10;members receives a 10% group discount.       `dim_customer_group.discount_value` is&#10;then added on top of the matched step's value.&#10;Join to `dim_customer_group` on `customer_group_id` to get the group type and&#10;`discount_type` (percentage or absolute) that applies to all steps." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="customer_group_member_discount_id" nullable="false" remarks="Generated identifier for this group discount step." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="customer_group_id" nullable="true" remarks="The customer group this discount step belongs to." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_group_id" foreignKey="erp_v2_dim_customer_group_member_discount_customer_group_id__erp_v2_dim_customer_group_customer_group_id_fkey_b1ddf1fcd7b5" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer_group"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="min_member_count" nullable="true" remarks="Minimum number of eligible group members needed for this discount step to activate.&#10;The step with the highest `min_member_count` that is still ≤ the current eligible&#10;group size is applied." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="3" name="discount_value" nullable="true" remarks="The group discount for this step. Interpreted as a percentage (0-100) or an absolute&#10;amount according to `dim_customer_group.discount_type`." size="23" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="discount_type" nullable="true" remarks="How the discount value is expressed: `PERCENTAGE` (0-100) or `ABSOLUTE` (fixed amount)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="6" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="customer_group_member_discount_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_date" remarks="Date dimension covering years 1900-2099" schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="date_id" nullable="false" remarks="Primary key in YYYYMMDD format" size="10" type="int4" typeCode="4">
            <child catalog="enterprise_4e" column="checkin_date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="fct_checkin"/>
            <child catalog="enterprise_4e" column="checkout_date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="fct_checkin"/>
            <child catalog="enterprise_4e" column="created_date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="fct_class_appointment"/>
            <child catalog="enterprise_4e" column="end_date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="fct_class_appointment"/>
            <child catalog="enterprise_4e" column="start_date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="fct_class_appointment"/>
            <child catalog="enterprise_4e" column="end_date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="fct_class_event"/>
            <child catalog="enterprise_4e" column="event_date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="fct_class_event"/>
            <child catalog="enterprise_4e" column="start_date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="fct_class_event"/>
            <child catalog="enterprise_4e" column="cancellation_date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="fct_contract"/>
            <child catalog="enterprise_4e" column="cancellation_receipt_date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="fct_contract"/>
            <child catalog="enterprise_4e" column="created_date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="fct_contract"/>
            <child catalog="enterprise_4e" column="end_date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="fct_contract"/>
            <child catalog="enterprise_4e" column="pre_cancellation_end_date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="fct_contract"/>
            <child catalog="enterprise_4e" column="start_date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="fct_contract"/>
            <child catalog="enterprise_4e" column="cancellation_date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="fct_contract_cancellation"/>
            <child catalog="enterprise_4e" column="cancellation_receipt_date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="fct_contract_cancellation"/>
            <child catalog="enterprise_4e" column="contract_end_date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="fct_contract_cancellation"/>
            <child catalog="enterprise_4e" column="pre_cancellation_end_date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="fct_contract_cancellation"/>
            <child catalog="enterprise_4e" column="end_date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="fct_idle_period"/>
            <child catalog="enterprise_4e" column="start_date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="fct_idle_period"/>
            <child catalog="enterprise_4e" column="effective_collection_date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="fct_payment_run"/>
            <child catalog="enterprise_4e" column="accounting_date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="fct_revenue"/>
            <child catalog="enterprise_4e" column="end_date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="fct_trainer_class_appointments"/>
            <child catalog="enterprise_4e" column="start_date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="fct_trainer_class_appointments"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="date" nullable="true" remarks="Actual date" size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="year" nullable="true" remarks="Year component" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="month" nullable="true" remarks="Month component" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="day" nullable="true" remarks="Day component" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="year_month" nullable="true" remarks="Concatenated year and month in YYYYMM format" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="year_day" nullable="true" remarks="Concatenated year and day in YYYYDDD format" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="month_day" nullable="true" remarks="Concatenated month and day in MMDD format" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="day_number_of_year" nullable="true" remarks="Day number within the year (1-365/366)" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="day_number_of_week" nullable="true" remarks="Day number within the week as returned by extract(dow from date) (0=Sunday, 6=Saturday)" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="day_of_week" nullable="true" remarks="Name of the day of the week" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="month_name" nullable="true" remarks="Name of the month" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="weekday_name" nullable="true" remarks="Name of the weekday" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="is_start_of_month" nullable="true" remarks="Flag indicating if the date is the first day of the month" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="is_end_of_month" nullable="true" remarks="Flag indicating if the date is the last day of the month" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="16" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="date_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_daytime" remarks="This table contains all times of a day from `00:00:00` to `23:59:59` with the granularity of one second." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="daytime_id" nullable="false" remarks="Primary key representing seconds in a day (1-86400)" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="daytime" nullable="true" remarks="Time in HH:MM:SS format" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="hour" nullable="true" remarks="Hour component (0-23)" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="minute" nullable="true" remarks="Minute component (0-59)" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="second" nullable="true" remarks="Second component (0-59)" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="6" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="daytime_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_device" remarks="A device connected to the system, which enables registering customers using certain areas (the whole gym, the gym sauna) or machines (eg a massage bed) of a gym." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="device_id" nullable="false" remarks="The primary key of this table. System column calculated by the source System." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="device_id" foreignKey="erp_v2_fct_checkin_device_id__erp_v2_dim_device_device_id_fkey_8a1ae26194f0" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_checkin"/>
            <child catalog="enterprise_4e" column="device_id" foreignKey="erp_v2_fct_service_usage_device_id__erp_v2_dim_device_device_id_fkey_c8141dcfec7f" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_service_usage"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="name" nullable="true" remarks="The name of the device chosen on setup." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="connection_type" nullable="true" remarks="How the device talks to the System. One of [USB, NETWORK, COM, API, USB_VIRTUAL_COM]" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="model" nullable="true" remarks="The model name of the device. Chosen by the manufacturer." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="active" nullable="true" remarks="Whether the device currently accepts inputs." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="6" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="device_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_discount_campaign" remarks="A discount campaign is a time-bound promotional discount configuration that studio administrators&#10;define and activate per studio. When active, it automatically applies a discount to contracts&#10;signed via the configured allowed sales channels (origin types). A campaign defines its validity&#10;window (`active_from` / `active_to`), how it interacts with discount vouchers&#10;(`voucher_interoperability_mode`), and which rate bundles / flat fees / modules it applies to." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="discount_campaign_id" nullable="false" remarks="The primary key of this table." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="discount_campaign_id" foreignKey="erp_v2_bridge_discount_campaign_to_allowed_origin_type_discount_campaign_id__erp_v2_dim_discount_campaign_disc_0ed5bdc786d7" implied="false" onDeleteCascade="false" schema="erp_v2" table="bridge_discount_campaign_to_allowed_origin_type"/>
            <child catalog="enterprise_4e" column="discount_campaign_id" foreignKey="erp_v2_bridge_discount_campaign_to_organization_unit_discount_campaign_id__erp_v2_dim_discount_campaign_discou_7a9da8bcf0a3" implied="false" onDeleteCascade="false" schema="erp_v2" table="bridge_discount_campaign_to_organization_unit"/>
            <child catalog="enterprise_4e" column="discount_campaign_id" foreignKey="erp_v2_dim_discount_campaign_discount_period_discount_campaign_id__erp_v2_dim_discount_campaign_discount_campa_6920fa97ea32" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_discount_campaign_discount_period"/>
            <child catalog="enterprise_4e" column="discount_campaign_id" foreignKey="erp_v2_dim_discount_campaign_localized_discount_campaign_id__erp_v2_dim_discount_campaign_discount_campaign_id_88507be14e5c" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_discount_campaign_localized"/>
            <child catalog="enterprise_4e" column="discount_campaign_id" foreignKey="erp_v2_dim_discount_campaign_scope_discount_campaign_id__erp_v2_dim_discount_campaign_discount_campaign_id_fke_ab76005959cc" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_discount_campaign_scope"/>
            <child catalog="enterprise_4e" column="discount_campaign_id" foreignKey="erp_v2_fct_contract_discount_campaign_id__erp_v2_dim_discount_campaign_discount_campaign_id_fkey_acd88b13dfa5" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="name" nullable="true" remarks="The internal administrative name of the discount campaign as entered by the studio administrator. Not customer-facing — see dim_discount_campaign_localized for translated public names." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="active_from" nullable="true" remarks="UTC timestamp marking the start of the campaign's validity window (inclusive). Always set." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="active_to" nullable="true" remarks="UTC timestamp marking the end of the campaign's validity window (inclusive). NULL means the campaign has no expiry date and remains active indefinitely." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="archived" nullable="true" remarks="True if the campaign has been soft-deleted and is no longer available for new activations. Archived campaigns are retained for historical reference." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="voucher_interoperability_mode" nullable="true" remarks="#### Controls how this campaign interacts with discount vouchers when both are active.&#10;One of:&#10;* ALLOW_DISCOUNT_VOUCHERS: Discount vouchers can be combined with this campaign simultaneously (default).&#10;* ALLOW_DISCOUNT_VOUCHERS_VOUCHER_FIRST: Discount vouchers can be combined with this campaign, but the voucher discount takes precedence.&#10;* DISALLOW_DISCOUNT_VOUCHERS: Discount vouchers are blocked while this campaign is active; the campaign takes full precedence.&#10;* VOUCHER_REPLACES_DISCOUNT: When a customer redeems a discount voucher, the voucher replaces this campaign discount entirely." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="7" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="discount_campaign_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_discount_campaign_discount_period" remarks="Defines the discount amounts and effective periods for discount campaigns.&#10;Covers all three campaign scope types — main contract rate bundle (RATE_BUNDLE),&#10;flat-fee bundle (FLAT_FEE), and optional add-on module (MODULE) — in a single table.&#10;&#10;Each row represents one discount tier (position) for one campaign scope entry.&#10;Multiple tiers per scope entry are possible (e.g. position 0: 100% off for 3 months,&#10;position 1: 50% off for the following 3 months).&#10;&#10;Join to `dim_discount_campaign_scope` on `discount_campaign_scope_id` to determine&#10;which rate bundles or terms the discount applies to." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="discount_campaign_discount_period_id" nullable="false" remarks="Unique identifier for this discount tier." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="scope_type" nullable="true" remarks="#### The type of price component this discount period targets.&#10;One of:&#10;* RATE_BUNDLE: Discount on the main contract rate bundle price.&#10;* FLAT_FEE: Discount on a flat-fee rate bundle price.&#10;* MODULE: Discount on an optional add-on module price." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="discount_campaign_scope_id" nullable="true" remarks="References the campaign scope entry (rate bundle, flat-fee bundle, or module) that this discount period belongs to." size="256" type="varchar" typeCode="12">
            <parent catalog="enterprise_4e" column="discount_campaign_scope_id" foreignKey="erp_v2_dim_discount_campaign_discount_period_discount_campaign_scope_id__erp_v2_dim_discount_campaign_scope_di_c4317c5deca6" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_discount_campaign_scope"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="discount_campaign_id" nullable="true" remarks="The discount campaign this discount period belongs to." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="discount_campaign_id" foreignKey="erp_v2_dim_discount_campaign_discount_period_discount_campaign_id__erp_v2_dim_discount_campaign_discount_campa_6920fa97ea32" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_discount_campaign"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="discount_position" nullable="true" remarks="The order of this discount tier within the campaign scope entry. Lower positions apply first." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="discount_type" nullable="true" remarks="The method by which the discount value is applied: ABSOLUTE (fixed euro amount), PERCENTAGE (percentage of price) or PRICE_OVERRIDE (sets new price)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="6" name="discount_absolute_amount" nullable="true" remarks="The fixed monetary amount deducted from the price when discount_type is ABSOLUTE. Zero when discount_type is PERCENTAGE/PRICE_OVERRIDE." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="7" name="discount_percentage" nullable="true" remarks="The percentage of the price deducted when discount_type is PERCENTAGE (e.g. 100.00 for fully free). Zero when discount_type is ABSOLUTE/PRICE_OVERRIDE." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="8" name="price_override" nullable="true" remarks="When set, replaces the computed discount with a fixed price. Used when discount_type is PRICE_OVERRIDE." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="effective_period" nullable="true" remarks="#### How long this discount tier is active.&#10;One of:&#10;* UNLIMITED: The discount applies for the entire duration of the contract.&#10;* INITIAL_TERM: The discount applies only during the initial contract term.&#10;* TIME_BASED: The discount applies for a fixed duration set by effective_period_time_based_term_value and effective_period_time_based_term_unit." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="effective_period_time_based_term_value" nullable="true" remarks="The numeric duration of the time-based effective period (e.g. 3 for 3 months). Only set when effective_period is TIME_BASED." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="effective_period_time_based_term_unit" nullable="true" remarks="#### The time unit for the time-based effective period. Only set when effective_period is TIME_BASED.&#10;One of:&#10;* DAY: Duration in calendar days.&#10;* WEEK: Duration in calendar weeks.&#10;* MONTH: Duration in calendar months.&#10;* YEAR: Duration in calendar years." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="13" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="discount_campaign_discount_period_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_discount_campaign_localized" remarks="Localized public names and descriptions for discount campaigns, one row per campaign per locale.&#10;Used to display campaign information in the member's preferred language (e.g. in the MySports app&#10;or online checkout). Follows the same pattern as dim_rate_localized and dim_cancellation_reason_localized." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="discount_campaign_localized_id" nullable="false" remarks="The primary key of this table. Surrogate key derived from (discount_campaign_id, locale)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="discount_campaign_id" nullable="true" remarks="The discount campaign this translation belongs to." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="discount_campaign_id" foreignKey="erp_v2_dim_discount_campaign_localized_discount_campaign_id__erp_v2_dim_discount_campaign_discount_campaign_id_88507be14e5c" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_discount_campaign"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="locale" nullable="true" remarks="The locale for this translation, formatted as ISO-639 language code + ISO-3166 country code (e.g. `de_DE`, `nl_NL`, `en_GB`)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="public_name" nullable="true" remarks="The customer-facing name of the discount campaign for this locale. May be null if no translation has been configured." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="description" nullable="true" remarks="The customer-facing description of the discount campaign for this locale. May be null if no translation has been configured." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="6" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="discount_campaign_localized_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_discount_campaign_scope" remarks="Defines which rate bundles (and optionally which specific terms) are in scope for each&#10;discount campaign, across all three price component types: RATE_BUNDLE (main contract),&#10;FLAT_FEE (flat-fee bundle), and MODULE (optional add-on). One row per scope entry.&#10;&#10;A NULL `rate_bundle_id` means the campaign applies to **all** rate bundles of that type.&#10;A NULL `rate_bundle_term_id` means the campaign applies to **all terms** of the rate bundle&#10;(only meaningful when `rate_bundle_id` is also set).&#10;&#10;Use this table to answer: &quot;Which rate bundles have a discount campaign set on them?&quot; and&#10;&quot;Does this campaign apply to all bundles or only specific ones?&quot;&#10;&#10;Join with `dim_discount_campaign_discount_period` on `discount_campaign_scope_id`&#10;to get the actual discount amounts for each scoped entry." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="discount_campaign_scope_id" nullable="false" remarks="Surrogate primary key uniquely identifying a campaign scope entry." size="256" type="varchar" typeCode="12">
            <child catalog="enterprise_4e" column="discount_campaign_scope_id" foreignKey="erp_v2_dim_discount_campaign_discount_period_discount_campaign_scope_id__erp_v2_dim_discount_campaign_scope_di_c4317c5deca6" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_discount_campaign_discount_period"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="scope_type" nullable="true" remarks="#### The type of price component this scope entry targets.&#10;One of:&#10;* RATE_BUNDLE: Scope over the main contract rate bundle price.&#10;* FLAT_FEE: Scope over a flat-fee rate bundle price.&#10;* MODULE: Scope over an optional add-on module price." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="discount_campaign_id" nullable="true" remarks="The discount campaign this scope entry belongs to." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="discount_campaign_id" foreignKey="erp_v2_dim_discount_campaign_scope_discount_campaign_id__erp_v2_dim_discount_campaign_discount_campaign_id_fke_ab76005959cc" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_discount_campaign"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="rate_bundle_id" nullable="true" remarks="The rate bundle in scope for this campaign. NULL means the campaign applies to all rate bundles of the given type." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_bundle_id" foreignKey="erp_v2_dim_discount_campaign_scope_rate_bundle_id__erp_v2_dim_rate_bundle_rate_bundle_id_fkey_36f09d6ebe50" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate_bundle"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="rate_bundle_term_id" nullable="true" remarks="The specific rate bundle term in scope. NULL means the campaign applies to all terms of the rate bundle. Always NULL when rate_bundle_id is NULL." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_bundle_term_id" foreignKey="erp_v2_dim_discount_campaign_scope_rate_bundle_term_id__erp_v2_dim_rate_bundle_term_rate_bundle_term_id_fkey_460c2f074767" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate_bundle_term"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="applies_to_all_rate_bundles" nullable="true" remarks="True when this campaign covers all rate bundles of the given type rather than a specific one." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="applies_to_all_terms" nullable="true" remarks="True when this campaign covers all terms of the scoped rate bundle rather than a specific term." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="8" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="discount_campaign_scope_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_dunning_level" remarks="Dimension table for dunning levels configured in the Magicline dunning engine.&#10;Each row represents one level in a dunning escalation ladder, as defined by a&#10;studio's dunning configuration template.&#10;&#10;Two level types exist (`dunning_level_type`):&#10;  - `DUNNING`         — a standard escalation step with configurable rules and actions.&#10;                        `dunning_levels_order = 0` is the &quot;No Dunning Level&quot; baseline.&#10;  - `DEBT_COLLECTION` — the terminal level representing handoff to an external debt&#10;                        collection agency. Has no configurable dunning rules.&#10;&#10;Join from `fct_dunning_step.dunning_level_id` to obtain the level's position in the&#10;escalation sequence and its type. Archived levels may appear on historical&#10;`fct_dunning_step` rows but are no longer assigned to new dunning steps." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="dunning_level_id" nullable="false" remarks="Primary key of this table. Uniquely identifies this dunning level." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="dunning_level_id" foreignKey="erp_v2_fct_dunning_step_dunning_level_id__erp_v2_dim_dunning_level_dunning_level_id_fkey_c44a94e02894" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_dunning_step"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="dunning_levels_order" nullable="true" remarks="Position of this level in the escalation sequence within its configuration template.&#10;`0` represents the &quot;No Dunning Level&quot; baseline (no dunning action triggered yet).&#10;Higher values indicate later stages in the escalation ladder." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="dunning_level_type" nullable="true" remarks="The type of this dunning level, derived from the JPA single-table inheritance&#10;discriminator column.&#10;&#10;#### Values&#10;* `DUNNING`         — a standard dunning escalation level with configurable rules&#10;* `DEBT_COLLECTION` — the terminal level for external debt collection handoff" size="20" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="dunning_configuration_template_id" nullable="true" remarks="The dunning configuration template that defines the escalation ladder this level belongs to." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="is_archived" nullable="true" remarks="Whether this dunning level has been archived (soft-deleted). Archived levels are no longer assigned to new dunning steps but may still appear on historical fct_dunning_step rows." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="6" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="dunning_level_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_employee" remarks="Table contains all employees and their relevant information" schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="employee_id" nullable="false" remarks="The primary key of this table. System column calculated by the source System." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="employee_id" foreignKey="erp_v2_fct_contract_employee_id__erp_v2_dim_employee_employee_id_fkey_54e92a4e8fd8" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract"/>
            <child catalog="enterprise_4e" column="employee_id" foreignKey="erp_v2_fct_employee_access_employee_id__erp_v2_dim_employee_employee_id_fkey_fa344728f5ff" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_employee_access"/>
            <child catalog="enterprise_4e" column="employee_id" foreignKey="erp_v2_fct_pos_saleposition_employee_id__erp_v2_dim_employee_employee_id_fkey_8b35542bf6cc" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_pos_saleposition"/>
            <child catalog="enterprise_4e" column="employee_id" foreignKey="erp_v2_fct_service_usage_employee_id__erp_v2_dim_employee_employee_id_fkey_1e52486423bf" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_service_usage"/>
            <child catalog="enterprise_4e" column="employee_id" foreignKey="erp_v2_fct_trainer_appointment_employee_id__erp_v2_dim_employee_employee_id_fkey_ff80f2048c74" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_trainer_appointment"/>
            <child catalog="enterprise_4e" column="employee_id" foreignKey="erp_v2_fct_trainer_class_appointments_employee_id__erp_v2_dim_employee_employee_id_fkey_5658994255ec" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_trainer_class_appointments"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="firstname" nullable="true" remarks="First name" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="lastname" nullable="true" remarks="Last name" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="date_of_birth" nullable="true" remarks="Date of birth. For unknown values, the default value is 1900-01-01" size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="gender" nullable="true" remarks="Gender" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="employee_number" nullable="true" remarks="Employee number" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="username" nullable="true" remarks="The username of the employee in the ERP system." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="phone" nullable="true" remarks="Phone" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="additional_phone" nullable="true" remarks="Additional phone" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="email" nullable="true" remarks="Email" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="address_country" nullable="true" remarks="Country where employee lives" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="address_city" nullable="true" remarks="City where employee lives" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="address_street" nullable="true" remarks="Street where employee lives" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="address_house_number" nullable="true" remarks="House number where employee lives" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="address_zip" nullable="true" remarks="Zip where employee lives" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="working_time_model" nullable="true" remarks="Working model of the employee" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="status" nullable="true" remarks="Employment status of the employee. Possible values: ACTIVE (currently active), DEACTIVATED (soft-deactivated; triggers appointment and shift cleanup in the application)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="managed_by" nullable="true" remarks="Indicates how the employee account is managed. Possible values: ERP (native internal account), ACTIVE_DIRECTORY (Azure AD / SSO-managed), ACTIVE_DIRECTORY_CUSTOM (AD with custom configuration)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="18" name="business_role" nullable="true" remarks="Business role of the employee within the studio organisation. Possible values: STUDIO_OWNER, STUDIO_MANAGER, TRAINER, SERVICE_EMPLOYEE, ADMINISTRATION_OR_FINANCE, MARKETING. NULL values are filled with UNKNOWN." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="19" name="is_archived" nullable="true" remarks="Whether this employee is permanently removed." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="20" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="21" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="employee_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_idle_period_property" remarks="Additional dimensional information about an idle period. A junk dimension containing the properties that describe how an idle period was configured and what its effects are on the customer's contract and gym access." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="idle_period_property_id" nullable="false" remarks="The primary key of this table. Generated by MD5 hash of all property columns." size="256" type="varchar" typeCode="12">
            <child catalog="enterprise_4e" column="idle_period_property_id" foreignKey="erp_v2_fct_idle_period_idle_period_property_id__erp_v2_dim_idle_period_property_idle_period_property_id_fkey_1532dc02200b" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_idle_period"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="organization_unit_id" nullable="true" remarks="The gym (organization_unit) where this idle period configuration applies." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_dim_idle_period_property_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_bcec297cd3be" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="type" nullable="true" remarks="Specifying how the idle period was created in the source system. One of: `MEMBER_IDLE_PERIOD` (Idle Period was set on the customer, likely by their request), `CONTRACT_IDLE_PERIOD`, `CONTRACT_TRIAL_PERIOD` (Idle Period was set on specific contract(s) of a customer, likely by their request), `BONUS_PERIOD` (Idle Period was set on a contract of a customer, likely as a 'reward' by the gym)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="reduces_idle_period_contingent" nullable="true" remarks="Whether the contractually agreed on contingent of idle time of the customer is reduced." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="extends_cancelation_period" nullable="true" remarks="Whether the contractually agreed on time, until the customer can cancel a related contract, is extended." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="extends_contract_period" nullable="true" remarks="Whether the agreed on time until a related contract ends is extended." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="permits_studio_entry" nullable="true" remarks="Whether the customer can still enter the gym (checkin). Always true for `type=BONUS_PERIOD`." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="reason" nullable="true" remarks="An explanation why this idle period is used (e.g., 'Customer broke their leg', 'Free month as birthday present')." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="reason_type" nullable="true" remarks="Structured classification of the idle period reason. Null when no structured reason is assigned." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="10" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="idle_period_property_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_inclusive_contingent" remarks="A contingent defining how often a service can be used, included in a customer's contract. An inclusive contingent belongs to one of five variety types: RATE (linked to a standard contract tariff), MODULE_RATE (linked to a module tariff), TAG (linked to a customer tag), RATE_CODE (linked to a rate code), or AGGREGATOR (linked to an external aggregator). Only RATE and MODULE_RATE varieties have a rate reference; TAG, RATE_CODE, and AGGREGATOR varieties have no associated rate." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="inclusive_contingent_id" nullable="false" remarks="The primary key of this table. System column calculated by the source System." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="inclusive_contingent_id" foreignKey="erp_v2_fct_class_event_inclusive_contingent_id__erp_v2_dim_inclusive_contingent_inclusive_contingent_id_fkey_94ae8bcc3b4a" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_class_event"/>
            <child catalog="enterprise_4e" column="inclusive_contingent_id" foreignKey="erp_v2_fct_customer_appointment_inclusive_contingent_id__erp_v2_dim_inclusive_contingent_inclusive_contingent__20a646d281e0" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_customer_appointment"/>
            <child catalog="enterprise_4e" column="inclusive_contingent_id" foreignKey="erp_v2_fct_service_usage_inclusive_contingent_id__erp_v2_dim_inclusive_contingent_inclusive_contingent_id_fkey_0d4538394108" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_service_usage"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="name" nullable="true" remarks="Name of the rate (contract tariff) this contingent belongs to. 'UNKNOWN' for contingents of variety type TAG, RATE_CODE, or AGGREGATOR which are not linked to a rate." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="duration_type" nullable="true" remarks="Duration period for which this contingent is active, e.g., DAY, MONTH, YEAR, etc." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="unit" nullable="true" remarks="Unit type: FLAT for unlimited usage or TIMES for a limited number of uses" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="num_of_usage" nullable="true" remarks="How many times this contingent can be used" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="validity_type" nullable="true" remarks="How long this contingent is valid" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="archived" nullable="true" remarks="Permanently removed but kept for historic relations." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="8" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="inclusive_contingent_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_lead_stage" remarks="A custom stage describing where a lead is in the pipeline." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="lead_stage_id" nullable="false" remarks="The primary key of this table. System column calculated by the source System." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="lead_stage_id" foreignKey="erp_v2_fct_lead_lifetime_lead_stage_id__erp_v2_dim_lead_stage_lead_stage_id_fkey_38cc29024b18" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_lead_lifetime"/>
            <child catalog="enterprise_4e" column="lead_stage_id" foreignKey="erp_v2_fct_lead_stage_history_lead_stage_id__erp_v2_dim_lead_stage_lead_stage_id_fkey_9ca022e7a4b5" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_lead_stage_history"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="stage_label" nullable="true" remarks="Name of this lead stage (e.g. &quot;New Inquiry&quot;, &quot;Contacted&quot;, &quot;Trial Booked&quot;)." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="stage_position" nullable="true" remarks="The ordering position of this stage within its pipeline. Lower values appear earlier in the funnel." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="stage_group_id" nullable="true" remarks="The pipeline (group of stages) this stage belongs to." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="stage_group_label" nullable="true" remarks="The name of the pipeline (group of stages) this stage belongs to." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="is_archived" nullable="true" remarks="Whether this stage has been archived and is no longer used in the active pipeline." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="7" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="lead_stage_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_loss_reason" remarks="The reasons available for explaining why a lead was lost." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="loss_reason_id" nullable="false" remarks="The primary key of the loss reason." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="loss_reason_id" foreignKey="erp_v2_fct_lead_stage_history_loss_reason_id__erp_v2_dim_loss_reason_loss_reason_id_fkey_5fca33474e52" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_lead_stage_history"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="name" nullable="true" remarks="The name of the reason a lead was lost." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="default_loss_reason" nullable="true" remarks="The system-defined default category for this loss reason, when available." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="4" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="loss_reason_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_opening_hours" remarks="General opening hours for organization units (gyms). Defines the regular operating hours for each gym by day of week in a range." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="opening_hours_id" nullable="false" remarks="The primary key of this table. System column." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="organization_unit_id" nullable="true" remarks="The organization unit (gym) that these opening hours apply to." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_dim_opening_hours_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_a8118e8ea847" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="day_of_week_from" nullable="true" remarks="The starting day of the week for this opening hours entry. Values: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="day_of_week_to" nullable="true" remarks="The ending day of the week for this opening hours entry. Values: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="time_from" nullable="true" remarks="The opening time for this day range. Stored as time (HH:MM:SS format)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="time_to" nullable="true" remarks="The closing time for this day range. Stored as time (HH:MM:SS format)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="7" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="opening_hours_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_organization_unit" remarks="A gym. The physical location at which people go to work out. But also the abstract entity to which customers sign up to." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="organization_unit_id" nullable="false" remarks="The primary key of this table. System column calculated by the source System." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_bridge_company_to_organization_unit_organization_unit_id__erp_v2_dim_organization_unit_organization_uni_51e5d48373ee" implied="false" onDeleteCascade="false" schema="erp_v2" table="bridge_company_to_organization_unit"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_bridge_discount_campaign_to_organization_unit_organization_unit_id__erp_v2_dim_organization_unit_organi_d2fbb7060fea" implied="false" onDeleteCascade="false" schema="erp_v2" table="bridge_discount_campaign_to_organization_unit"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_bridge_organization_unit_to_organization_unit_code_organization_unit_id__erp_v2_dim_organization_unit_o_508bb3291f6a" implied="false" onDeleteCascade="false" schema="erp_v2" table="bridge_organization_unit_to_organization_unit_code"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_bridge_product_to_organization_unit_organization_unit_id__erp_v2_dim_organization_unit_organization_uni_7f6dc1b876f7" implied="false" onDeleteCascade="false" schema="erp_v2" table="bridge_product_to_organization_unit"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_bridge_service_to_organization_unit_organization_unit_id__erp_v2_dim_organization_unit_organization_uni_93f5ab50f16a" implied="false" onDeleteCascade="false" schema="erp_v2" table="bridge_service_to_organization_unit"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_dim_cash_register_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_e6721b9ab5cd" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_cash_register"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_dim_closing_hours_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_82c34000fc77" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_closing_hours"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_dim_customer_communication_consent_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_17e4f8f0f3bc" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer_communication_consent"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_dim_customer_group_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_4fdcd4b09658" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer_group"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_dim_idle_period_property_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_bcec297cd3be" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_idle_period_property"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_dim_opening_hours_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_a8118e8ea847" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_opening_hours"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_dim_purchased_contingent_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_58fc0abfa10c" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_purchased_contingent"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_dim_studio_starter_package_adjustment_organization_unit_id__erp_v2_dim_organization_unit_organization_u_711bef1b21d1" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_studio_starter_package_adjustment"/>
            <child catalog="enterprise_4e" column="customer_organization_unit_id" foreignKey="erp_v2_fct_checkin_customer_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_add16c7191fc" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_checkin"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_checkin_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_53f443d15805" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_checkin"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_class_appointment_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_cde89206a5f0" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_class_appointment"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_class_event_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_e6ab28415bac" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_class_event"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_contract_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_b1c3c75d1a29" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_contract_cancellation_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_de00c0a9ddbb" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract_cancellation"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_contract_price_history_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_6f07537a3a43" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract_price_history"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_contract_term_dates_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_e13a283163ac" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract_term_dates"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_customer_appointment_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_0b29e6e45a12" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_customer_appointment"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_customer_studio_history_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fke_04abcb7d4338" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_customer_studio_history"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_employee_access_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_04e45decc79f" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_employee_access"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_idle_period_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_e20167bbb9db" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_idle_period"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_invoice_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_66c6d57ea319" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_invoice"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_lead_lifetime_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_88dd817d8549" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_lead_lifetime"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_lead_stage_history_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_2999e5217846" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_lead_stage_history"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_payment_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_4cd96431adf1" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_payment"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_payment_instrument_status_history_organization_unit_id__erp_v2_dim_organization_unit_organization_u_0950a3274251" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_payment_instrument_status_history"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_payment_run_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_6234eded60eb" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_payment_run"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_pos_saleposition_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_e2db3f4dc8ab" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_pos_saleposition"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_rate_bundle_term_availability_organization_unit_id__erp_v2_dim_organization_unit_organization_unit__3321960f897f" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_rate_bundle_term_availability"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_rate_term_payment_frequency_price_organization_unit_id__erp_v2_dim_organization_unit_organization_u_4c25ab6b3d1a" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_rate_term_payment_frequency_price"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_revenue_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_bab2228f7b9f" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_revenue"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_revenue_cash_based_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_4e9b78b78e53" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_revenue_cash_based"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_revenue_invoice_based_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_f1c5bda0cb26" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_revenue_invoice_based"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_service_usage_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_3e9a8bf6cb0e" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_service_usage"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_trainer_appointment_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_d785c878b6f4" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_trainer_appointment"/>
            <child catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_trainer_class_appointments_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id__53869137b108" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_trainer_class_appointments"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="studio_prefix" nullable="true" remarks="A unique identifier of the gym that is used as a prefix for the dim_customer.customer_number of it's customers." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="name" nullable="true" remarks="The name of the gym." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="street" nullable="true" remarks="The street name of the gym's address." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="house_number" nullable="true" remarks="The house number of the gym's address." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="zip" nullable="true" remarks="The postal code of the gym's address." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="city" nullable="true" remarks="The city of the gym's address." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="country" nullable="true" remarks="The country of the gym's address." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="17" id="8" name="latitude" nullable="true" remarks="The latitude coordinate of the gym's location in decimal degrees (WGS84)." size="17" type="float8" typeCode="8"/>
         <column autoUpdated="false" defaultValue="null" digits="17" id="9" name="longitude" nullable="true" remarks="The longitude coordinate of the gym's location in decimal degrees (WGS84)." size="17" type="float8" typeCode="8"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="tax_region" nullable="true" remarks="The 2-letter ISO 3166 abbreviation of the country&#10;the gym is located at." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="timezone" nullable="true" remarks="The name of the timezone the gym is located at. (Eg. Europe/Berlin)" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="archived" nullable="true" remarks="Permanently removed but kept for historic relations." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="disabled" nullable="true" remarks="Temporarily disabled, preventing new customers from signing up to this gym." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="15" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="organization_unit_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_organization_unit_code" remarks="A tag/code assigned to organization units (gyms) to group them." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="organization_unit_code_id" nullable="false" remarks="The primary key of this table. System column calculated by the source System." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="organization_unit_code_id" foreignKey="erp_v2_bridge_organization_unit_to_organization_unit_code_organization_unit_code_id__erp_v2_dim_organization_u_a47f3e8453ce" implied="false" onDeleteCascade="false" schema="erp_v2" table="bridge_organization_unit_to_organization_unit_code"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="name" nullable="true" remarks="The name of the organization unit code." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="color_hex" nullable="true" remarks="The color of the organization unit code in hexadecimal format displayed on the UI." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="4" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="organization_unit_code_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_payment_instrument" remarks="One row per stored payment method, resolving the customer whose account it belongs to. Standard instruments include cards, BACS/ACH/BECS direct debit, TWINT, and PayPal. The separate bank-account-backed direct-debit mechanism is represented as one `payment_instrument_type = 'BANK_ACCOUNT_DIRECT_DEBIT'` row per bank account, with lifecycle dates from the selected current mandate. This storage layer also underlies non-Swiss SEPA Direct Debit and Swiss LSV+/CH-DD processing; the warehouse label does not distinguish those downstream schemes. There is no flag identifying 'the' currently-used instrument when more than one row exists for a customer; consumers must interpret `current_status` and `is_archived` themselves. The status-history fact contains only standard payment-instrument events." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="payment_instrument_id" nullable="false" remarks="The primary key of this table. Positive for standard payment instruments (card, BACS/ACH/BECS, TWINT, PayPal); negative for `payment_instrument_type = 'BANK_ACCOUNT_DIRECT_DEBIT'` rows, whose synthetic identity is derived from the bank account and kept separate from positive standard instrument ids." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="payment_instrument_id" foreignKey="erp_v2_fct_payment_instrument_status_history_payment_instrument_id__erp_v2_dim_payment_instrument_payment_inst_c713c4fa9637" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_payment_instrument_status_history"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="customer_id" nullable="true" remarks="The customer whose account this payment instrument belongs to. Null in rare cases where the billing setup could not be linked back to an account. For `BANK_ACCOUNT_DIRECT_DEBIT` rows, ownership is resolved through the bank account's payer relationship and the reverse customer-to-payer relationship." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_dim_payment_instrument_customer_id__erp_v2_dim_customer_customer_id_fkey_1d94a658b247" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="paying_customer_id" nullable="true" remarks="The customer who actually pays for this instrument. Equals `customer_id` for `payment_responsibility_type` `SELF`/`UNKNOWN`; differs from it for `CUSTOMER` (e.g. a parent paying for a child's membership); null for `EXTERNAL` or an unresolved payer. For `BANK_ACCOUNT_DIRECT_DEBIT` rows, responsibility is `SELF`, so this equals `customer_id` when the account-owner path resolves." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_dim_payment_instrument_paying_customer_id__erp_v2_dim_customer_customer_id_fkey_2652b076ff2a" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="payment_responsibility_type" nullable="true" remarks="#### Who is financially responsible for this instrument. One of:&#10;* `SELF` — The account holder pays for themselves. Always this value for `BANK_ACCOUNT_DIRECT_DEBIT` rows, since the bank-account representation has no alternate-payer concept.&#10;* `CUSTOMER` — Another member pays on the account holder's behalf (see `paying_customer_id`).&#10;* `UNKNOWN` — Migrated/imported account; the specific arrangement is not known.&#10;* `EXTERNAL` — A non-member (e.g. a parent or guardian) pays on the account holder's behalf." size="64" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="payment_instrument_type" nullable="true" remarks="#### The type of payment instrument. One of:&#10;* `CREDIT_CARD` — Credit/debit card.&#10;* `BACS` — UK BACS direct debit mandate.&#10;* `ACH` — US ACH direct debit.&#10;* `BECS` — Australian BECS direct debit.&#10;* `TWINT` — TWINT mobile payment (Switzerland).&#10;* `PAYPAL` — PayPal billing agreement.&#10;* `BANK_ACCOUNT_DIRECT_DEBIT` — Bank-account-backed direct-debit mechanism represented separately from standard instruments. The same storage layer supports non-Swiss SEPA Direct Debit and Swiss LSV+/CH-DD processing; this warehouse label does not distinguish the operational scheme. `mandate_given_date`/`mandate_withdrawn_date` are populated for these rows." size="64" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="current_status" nullable="true" remarks="#### The current confirmation/validity state of this instrument. One of:&#10;* `WAITING_FOR_CONFIRMATION` — Created and awaiting confirmation from the customer/PSP. For `BANK_ACCOUNT_DIRECT_DEBIT` rows, also covers a mandate awaiting member signature/approval.&#10;* `IMPORTED_WAITING_FOR_PROCESSING` — Imported/migrated and awaiting PSP registration/tokenization following the import. Not applicable to `BANK_ACCOUNT_DIRECT_DEBIT` rows.&#10;* `CONFIRMED` — Confirmed and usable for charges. For `BANK_ACCOUNT_DIRECT_DEBIT` rows, also covers a mandate that has been physically signed.&#10;* `INVALID` — Can no longer be used (bank-rejected, disabled, charged back). For `BANK_ACCOUNT_DIRECT_DEBIT` rows, set when the bank account is inactive/archived or the selected mandate's withdrawal date is effective." size="64" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="payment_provider" nullable="true" remarks="The payment service provider (PSP) that issues and processes this instrument (e.g. Adyen, Stripe, Worldpay). Null for `BANK_ACCOUNT_DIRECT_DEBIT` rows, which represent the bank-account-backed mechanism rather than a PSP token." size="64" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="is_archived" nullable="true" remarks="Whether this payment instrument is archived (no longer in active use). For `BANK_ACCOUNT_DIRECT_DEBIT` rows, this is the archive state of the bank account; a withdrawn mandate does not archive an otherwise reusable account." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="mandate_given_date" nullable="true" remarks="Only populated for `payment_instrument_type = 'BANK_ACCOUNT_DIRECT_DEBIT'` rows: the date the selected current mandate was granted. It is not an exhaustive history of mandates and is null for other payment instrument types." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="mandate_withdrawn_date" nullable="true" remarks="Only populated for `payment_instrument_type = 'BANK_ACCOUNT_DIRECT_DEBIT'` rows: the withdrawal/cancellation date of the selected current mandate, if present. The withdrawal affects `current_status` once effective; the field is null while that mandate is active and for other payment instrument types." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="11" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="payment_instrument_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_payment_run_property" remarks="A set of basic payment run booking properties" schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="payment_run_property_id" nullable="false" remarks="The primary key of this table." size="256" type="varchar" typeCode="12">
            <child catalog="enterprise_4e" column="payment_run_property_id" foreignKey="erp_v2_fct_payment_run_payment_run_property_id__erp_v2_dim_payment_run_property_payment_run_property_id_fkey_c34472c8a249" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_payment_run"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="provider" nullable="true" remarks="The payment run provider, for example `SEPA_XML`" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="status" nullable="true" remarks="#### The status of the payment run to which this booking belongs, grouped into a small set of business-relevant states. One of:&#10;* `PREPROCESSING` — Items are being collected and previewed; not yet confirmed by the operator.&#10;* `PENDING_VERIFICATION` — Preview is ready for operator review.&#10;* `PROCESSING` — Items are collected and the run is queued for submission.&#10;* `READY` — Confirmed and ready to be submitted to the payment processor.&#10;* `SUBMITTING` — Active submission to the payment provider is in progress.&#10;* `RETRYING` — A recoverable error occurred; the system is retrying.&#10;* `WAITING_FOR_CONFIRMATION` — Awaiting bank or provider confirmation.&#10;* `SUBMITTED` — All items have been submitted to the payment provider.&#10;* `FINALIZING` — Manual check before marking complete.&#10;* `COMPLETE` — **Final.** Successfully finished.&#10;* `ERROR` — **Final.** The run failed (covers both a provider-rejected run and an internal processing error).&#10;* `CANCEL_PROCESSING` — Cancellation is in progress.&#10;* `CANCELLED` — **Final.** Cancelled by the user.&#10;* `REVERT_CANCEL_PROCESSING` — A previously cancelled run is being reopened.&#10;* `REVERT_FROM_SUBMITTED_PROCESSING` — A previously submitted/completed run is being reopened." size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="booking_status" nullable="true" remarks="#### The status of the individual booking itself, grouped into a small set of business-relevant states. One of:&#10;* `EXCLUDED` — The booking was excluded from this run before collection was attempted (see `reason`).&#10;* `CREATED` — Booking created; not yet submitted for processing.&#10;* `PROCESSING` — Booking entries created and the item is queued or being processed.&#10;* `SUBMITTING` — Handed off to the payment provider; submission in progress.&#10;* `SUBMITTED` — Submitted to the payment provider; awaiting confirmation.&#10;* `RETRYING` — A recoverable error occurred; the system is retrying.&#10;* `COMPLETE` — **Final.** Successfully collected.&#10;* `ERROR` — **Final.** The booking failed (rejected by the payment provider or an internal error).&#10;* `CANCELLED` — **Final.** Cancelled before completion." size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="reason" nullable="true" remarks="The reason a booking did not result in a plain, successful collection. `null` for regular successfully-collected bookings. The set of possible values depends on what happened to the booking:&#10;&#10;#### Booking was excluded from the run before collection was attempted (52 values reachable — see mapping note below)&#10;12 reasons are specific to this scenario: `UNKNOWN`, `BANK_ACCOUNT`, `SEPA_MANDATE`, `CREDIT_CARD`, `COLLECTION_STOP`, `INVALID_ADDRESS`, `MEMBER_CASH`, `MEANWHILE_BALANCED`, `CUSTOMER_INVALID_DATA`, `CUSTOMER_ARCHIVED`, `INTERNAL_ERROR`, `CREDIT_CARD_EXPIRED`.&#10;The remaining 40 largely mirror the Finion Capital rejection reasons below (same underlying reason catalog), plus a few excluded-only additions: `PURCHASE_LIMIT`, `IBAN_BLACKLISTED`, `INVALID_IBAN`, `CLOSED_BANKACCOUNT`, `FRAUD`, `INSOLVENCY`, `DECEASED`, `INCOMPLETE_ADDRESS`, `INVALID_OR_MISSING_INFORMATION`, `CHARGED_BACK`, `ALREADY_PURCHASED`, `ALREADY_CHARGED_BACK`, `CONTESTED_CONTRACT`, `WITHDRAWN_MANDATE`, `TERMINATED_CONTRACT`, `IBAN_NOT_SEPA_DIRECT_DEBIT_CAPABLE`, `AMOUNT_EXCEEDS_LIMIT`, `NON_CONTRACTUAL`, `PURCHASING_SUSPENDED`, `INSTRUCTED_BY_STUDIO`, `MISSING_LIABLE_PERSON`, `IBAN_INVALID_SINCE_LAST_PAYMENT_RUN`, `ACCOUNT_CLOSED_BEFORE_COLLECTION`, `DEBT_OVERAGED`, `DUNNING_UNSUCCESSFUL`, `AUTOMATIC_CHARGEBACK`, `STUDIO_CLOSED_DOWN`, `REPEATED_INVALID_SEPA_MANDATE`, `SETTLEMENT_AGRREMENT` (**sic** — typo present in the source system, not a documentation error), `INVALID_SEPA_CREDITOR_ID`, `BACS_PAYMENT_INSTRUMENT_MISSING`, `BACS_RECURRING_REFERENCE_MISSING`, `PAYMENT_INSTRUMENT_MISSING`, `PAYMENT_INSTRUMENT_NOT_CONFIRMED`, `PAYMENT_INSTRUMENT_INVALID`, `UNSUPPORTED_DEBT_CLAIM_TYPE`, `PURCHASESTOP_FRAUD`, `ALREADY_REJECTED`, `MANUALLY_REJECTED`, `OTHER`.&#10;&#10;#### A Finion Capital claim was rejected, or a prior Finion Capital collection was charged back (38 values reachable — see mapping note below)&#10;Finion Capital (Sport Alliance's receivables-financing product, branded to studios as MemberCash) collects membership fees via SEPA Direct Debit, pays studios the full amount on the collection day, absorbs the default risk, and handles all dunning/debt collection. This section covers the reasons it rejects a claim outright or reverses one it already collected on.&#10;* `PURCHASE_LIMIT` — Claim not purchased: purchase limit or purchase stop in effect.&#10;* `INVALID_IBAN` — Invalid IBAN.&#10;* `CLOSED_BANKACCOUNT` — Bank account closed.&#10;* `FRAUD` — Fraud attempt.&#10;* `INSOLVENCY` — Member is insolvent.&#10;* `DECEASED` — Member deceased.&#10;* `INCOMPLETE_ADDRESS` — Address is incomplete.&#10;* `INVALID_ADDRESS` — Address is invalid.&#10;* `INVALID_OR_MISSING_INFORMATION` — Missing or invalid info (e.g. IBAN, address).&#10;* `CHARGED_BACK` — Claim was already charged back.&#10;* `ALREADY_PURCHASED` — Claim was already purchased.&#10;* `ALREADY_CHARGED_BACK` — Claim was already charged back previously.&#10;* `CONTESTED_CONTRACT` — Contract is contested.&#10;* `WITHDRAWN_MANDATE` — Direct debit mandate withdrawn.&#10;* `INVALID_SEPA_MANDATE` — Invalid SEPA mandate.&#10;* `IBAN_BLACKLISTED` — IBAN is on a blacklist (e.g. known for fraud).&#10;* `TERMINATED_CONTRACT` — Studio contract terminated.&#10;* `IBAN_NOT_SEPA_DIRECT_DEBIT_CAPABLE` — Bank does not participate in the SEPA direct debit scheme.&#10;* `AMOUNT_EXCEEDS_LIMIT` — Amount exceeds an allowed limit.&#10;* `NON_CONTRACTUAL` — Claim is not tied to a contract.&#10;* `PURCHASING_SUSPENDED` — Purchasing temporarily suspended.&#10;* `INSTRUCTED_BY_STUDIO` — Chargeback instructed by the studio.&#10;* `MISSING_LIABLE_PERSON` — Missing legal guardian/representative.&#10;* `IBAN_INVALID_SINCE_LAST_PAYMENT_RUN` — IBAN became invalid since the last payment run.&#10;* `ACCOUNT_CLOSED_BEFORE_COLLECTION` — Bank account was closed before collection.&#10;* `DEBT_OVERAGED` — Claim is too old to collect (aged debt).&#10;* `DUNNING_UNSUCCESSFUL` — Dunning process was unsuccessful.&#10;* `AUTOMATIC_CHARGEBACK` — Immediate automatic chargeback; no further collection desired.&#10;* `STUDIO_CLOSED_DOWN` — Chargeback because the studio closed due to a regulatory order.&#10;* `REPEATED_INVALID_SEPA_MANDATE` — SEPA mandate repeatedly invalid.&#10;* `SETTLEMENT_AGREEMENT` — Client agreed to charge back every reversal of a direct debit from the run.&#10;* `INVALID_SEPA_CREDITOR_ID` — Invalid creditor ID on the SEPA mandate; claim can be resubmitted after the mandate is fixed.&#10;* `UNSUPPORTED_DEBT_CLAIM_TYPE` — Unsupported debt claim type.&#10;* `PURCHASESTOP_FRAUD` — Purchase stop due to suspected fraud.&#10;* `ALREADY_REJECTED` — Claim was already rejected.&#10;* `MANUALLY_REJECTED` — Manually rejected.&#10;* `OTHER` — Any other reason.&#10;* `UNKNOWN` — Unknown.&#10;&#10;#### A direct debit or credit card payment was charged back (returned) by the bank or card scheme&#10;* `INSUFFICIENT_COVERING` — Insufficient funds to cover the charge.&#10;* `OPPOSITION` — Customer actively disputed the charge with their bank.&#10;* `INVALID_BANK_INFORMATION` — Bank account details were invalid or incorrect.&#10;* `INVALID_MANDATE` — SEPA mandate was invalid, expired, or revoked.&#10;* `AUTHORIZATION_DECLINED` — Authorization was declined by the issuing bank.&#10;* `INVALID_CARD` — Credit card number was invalid.&#10;* `CARD_EXPIRED` — Credit card had expired.&#10;* `REVOKED_BY_CUSTOMER` — Customer revoked the authorization.&#10;* `OTHER` — Catch-all for other return reasons." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="6" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="payment_run_property_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_product" remarks="Products sold at gyms, including both catalog products (pre-defined with variants like size, duration) and dynamic products (created ad-hoc during sale with minimal attributes). Covers physical merchandise, virtual services, vouchers, and consumption credits." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="product_id" nullable="false" remarks="Unique identifier for the product. For catalog products, derived from the product variant; for dynamic products, generated from the gym location and item number." size="256" type="varchar" typeCode="12">
            <child catalog="enterprise_4e" column="product_id" foreignKey="erp_v2_bridge_product_to_organization_unit_product_id__erp_v2_dim_product_product_id_fkey_f1fdb9e3c1ce" implied="false" onDeleteCascade="false" schema="erp_v2" table="bridge_product_to_organization_unit"/>
            <child catalog="enterprise_4e" column="product_id" foreignKey="erp_v2_dim_purchased_contingent_product_id__erp_v2_dim_product_product_id_fkey_f5546ee4072d" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_purchased_contingent"/>
            <child catalog="enterprise_4e" column="product_id" foreignKey="erp_v2_fct_invoice_product_id__erp_v2_dim_product_product_id_fkey_f56d6e53c597" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_invoice"/>
            <child catalog="enterprise_4e" column="product_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="fct_pos_saleposition"/>
            <child catalog="enterprise_4e" column="product_id" foreignKey="erp_v2_fct_revenue_product_id__erp_v2_dim_product_product_id_fkey_9ad64d17cb7b" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_revenue"/>
            <child catalog="enterprise_4e" column="product_id" foreignKey="erp_v2_fct_revenue_cash_based_product_id__erp_v2_dim_product_product_id_fkey_4a6772e67a8c" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_revenue_cash_based"/>
            <child catalog="enterprise_4e" column="product_id" foreignKey="erp_v2_fct_revenue_invoice_based_product_id__erp_v2_dim_product_product_id_fkey_4a10cc383354" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_revenue_invoice_based"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="type" nullable="true" remarks="Product category that determines how it's used and sold:&#10;* MATERIAL: Physical merchandise that can be purchased in-store (drinks, protein bars, gym equipment, apparel)&#10;* VIRTUAL: Virtual products linked to benefits or services (class fees, personal training sessions, facility access)&#10;* VOUCHER: Gift cards that can be redeemed for contracts or physical products&#10;* CONTRACT_VOUCHER: Special vouchers that enable use of a specific membership contract for a time period&#10;* CONSUMPTION_CREDIT: Pre-paid credit balance customers can use to purchase physical products&#10;* UNKNOWN: Type not specified (only for dynamic products created during sale)" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="variant_name" nullable="true" remarks="Specific variant specification of the product such as size, duration, or quantity (e.g., '1 Liter', '20 minutes', '10-pack'). Set to UNKNOWN for dynamic products." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="item_number" nullable="true" remarks="Human-readable product identifier used for inventory tracking and point-of-sale systems. Cleared when product is archived to allow reuse." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="archived" nullable="true" remarks="Whether this product has been retired and is no longer available for new sales. Archived products are retained for historical transaction records. Dynamic products cannot be archived." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="name" nullable="true" remarks="Display name of the product shown to customers and staff (e.g., 'Protein Shake', 'Day Pass', 'Locker Rental')." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="class_of_goods" nullable="true" remarks="Product classification for accounting, reporting, and inventory management purposes (e.g., beverages, supplements, services, vouchers). Set to UNKNOWN for dynamic products." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="7" name="list_price" nullable="true" remarks="Standard selling price for the product as defined in the product catalog. For dynamic products, reflects the price recorded at the time of sale." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="currency_code" nullable="true" remarks="ISO 4217 currency code for the list price (e.g., 'EUR', 'USD', 'CHF'). For dynamic products, reflects the currency recorded at the time of sale." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="usage_count" nullable="true" remarks="Number of uses or sessions included in the product purchase (e.g., 10 for a 10-visit pass). NULL for products without usage tracking." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="validity_type" nullable="true" remarks="How the product's validity period is calculated: ONE_TIME (single use), DAY (valid until end of day), or PERIOD (valid for specific duration). NULL for products without time restrictions." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="validity_term_value" nullable="true" remarks="Numeric portion of the validity duration (e.g., 3 for '3 months'). Combined with validity_term_unit. NULL for products without validity periods." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="validity_term_unit" nullable="true" remarks="Time unit for validity duration: DAY, WEEK, MONTH, or YEAR. Combined with validity_term_value. NULL for products without validity periods." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="expiry_term" nullable="true" remarks="Numeric portion of the expiration period after which the product can no longer be used (e.g., 12 for 'expires after 12 months'). Combined with expiry_term_unit. NULL for non-expiring products." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="expiry_term_unit" nullable="true" remarks="Time unit for expiration period: DAY, WEEK, MONTH, or YEAR. Combined with expiry_term. NULL for non-expiring products." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="service_id" nullable="true" remarks="The service (benefit) associated with this product. Applies primarily to VIRTUAL products that represent bookable services like classes, personal training sessions, or facility access. NULL for physical merchandise, vouchers, and dynamic products." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="service_id" foreignKey="erp_v2_dim_product_service_id__erp_v2_dim_service_service_id_fkey_292dad53b2fd" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_service"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="17" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="product_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_purchased_contingent" remarks="Service packages purchased by customers that grant access to specific services for a defined number of uses or duration.&#10;These are standalone purchases (not included in membership contracts) such as day passes, class packs, personal training packages, or time-based access.&#10;Tracks purchase details, remaining availability, expiration dates, and usage rates for revenue analysis and customer service optimization.&#10;&#10;To identify **day passes**: filter on contingent_type = 'CHECKIN_BASED' AND num_of_usage = 1. There is no explicit DAY_PASS enum value;&#10;day passes are distinguished from other CHECKIN_BASED packages by having num_of_usage = 1 and validity_type = 'DAY'.&#10;Day passes are sold at POS (not as contracts) and will have price IS NOT NULL when linked to a sale_position.&#10;To find day pass check-in redemptions, join to fct_service_usage on purchased_contingent_id." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="purchased_contingent_id" nullable="false" remarks="Unique identifier for the purchased service package." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="purchased_contingent_id" foreignKey="erp_v2_bridge_revenue_to_purchased_contingent_purchased_contingent_id__erp_v2_dim_purchased_contingent_purchas_f6a75d64c8cd" implied="false" onDeleteCascade="false" schema="erp_v2" table="bridge_revenue_to_purchased_contingent"/>
            <child catalog="enterprise_4e" column="purchased_contingent_id" foreignKey="erp_v2_fct_class_event_purchased_contingent_id__erp_v2_dim_purchased_contingent_purchased_contingent_id_fkey_895261d4114d" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_class_event"/>
            <child catalog="enterprise_4e" column="purchased_contingent_id" foreignKey="erp_v2_fct_customer_appointment_purchased_contingent_id__erp_v2_dim_purchased_contingent_purchased_contingent__753134259bc0" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_customer_appointment"/>
            <child catalog="enterprise_4e" column="purchased_contingent_id" foreignKey="erp_v2_fct_service_usage_purchased_contingent_id__erp_v2_dim_purchased_contingent_purchased_contingent_id_fkey_b32dd15cbc61" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_service_usage"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="name" nullable="true" remarks="Display name of the service package as shown to customers at point of sale (e.g., '10-Class Pass', 'Day Pass', '60-Minute Personal Training'). NULL for packages not created through a sale transaction." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="variant_name" nullable="true" remarks="Product variant specification indicating size, duration, or quantity (e.g., '10 sessions', '30 days', 'Single Entry'). NULL for packages not created through a sale transaction." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="item_number" nullable="true" remarks="Product identifier used for inventory and sales tracking across the organization. NULL for packages not created through a sale transaction." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="num_of_usage" nullable="true" remarks="Total number of times this package can be used as originally purchased (e.g., 10 for a 10-class pass, 1 for a day pass). For time-based packages, represents duration in minutes." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="5" name="price" nullable="true" remarks="Amount the customer paid for this service package at the time of purchase, potentially including discounts applied during the transaction. NULL for packages not created through a sale transaction." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="service_id" nullable="true" remarks="The specific service or benefit that this package grants access to (e.g., group fitness classes, personal training, sauna access)." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="service_id" foreignKey="erp_v2_dim_purchased_contingent_service_id__erp_v2_dim_service_service_id_fkey_abb1fd04e195" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_service"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="customer_id" nullable="true" remarks="The customer who owns this service package and can use the remaining credits." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_dim_purchased_contingent_customer_id__erp_v2_dim_customer_customer_id_fkey_3991af1b86ab" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="organization_unit_id" nullable="true" remarks="The gym location where this package was purchased. May determine where the package can be used depending on service access rules. NULL for packages not created through a sale transaction." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_dim_purchased_contingent_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_58fc0abfa10c" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="6" id="9" name="purchase_time" nullable="true" remarks="Exact date and time when the package was purchased, shown in the gym's local timezone for accurate business hours analysis. NULL for packages not created through a sale transaction." size="29" type="timestamp" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="product_id" nullable="true" remarks="" size="256" type="varchar" typeCode="12">
            <parent catalog="enterprise_4e" column="product_id" foreignKey="erp_v2_dim_purchased_contingent_product_id__erp_v2_dim_product_product_id_fkey_f5546ee4072d" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_product"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="contingent_type" nullable="true" remarks="How usage is measured: APPOINTMENT_BASED (counted by number of bookings/visits), TIME_BASED (measured in minutes of usage), CHECKIN_BASED (entry-based access), USAGE_BASED (general usage counting), BUNDLE_BASED (package of services), or BUDDY_BASED (allows bringing guests). Day passes use CHECKIN_BASED with num_of_usage = 1 — there is no separate DAY_PASS type." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="available_usages" nullable="true" remarks="Current number of remaining uses or minutes available. Decreases each time the customer uses the service. NULL if expired or fully consumed." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="duration_in_minutes" nullable="true" remarks="For time-based packages, the total minutes of access included. NULL for count-based packages like class passes or day tickets." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="validity_type" nullable="true" remarks="How the usage validity window is calculated: ONE_TIME (single use with no extended validity), DAY (valid until end of day), or PERIOD (valid for a specified duration)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="validity_term_value" nullable="true" remarks="The numeric portion of the validity duration (e.g., 30 for '30 days', 3 for '3 months'). Combined with validity_term_unit. NULL for packages without time-based validity." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="validity_term_unit" nullable="true" remarks="Time unit for validity period: DAY, WEEK, MONTH, or YEAR. Combined with validity_term_value to determine how long each usage remains valid after consumption." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="expiry_date" nullable="true" remarks="The last date this package can be used. After this date, any remaining usage credits are forfeited and cannot be redeemed." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="18" name="usages_valid_until" nullable="true" remarks="For packages with per-usage validity windows, the timestamp when already-consumed uses expire in the local timezone of the studio. Applies to packages where each use has its own validity period." size="29" type="timestamp" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="19" name="valid_from" nullable="true" remarks="The date and time from which this purchased contingent becomes available for use, shown in the gym's local timezone. If not set, the contingent is available immediately upon purchase. Paired with expiry_date to define the overall activation window of the contingent." size="29" type="timestamp" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="20" name="usage_rate" nullable="true" remarks="Proportion of the package that has been consumed, from 0.0 (completely unused) to 1.0 (fully exhausted). Useful for identifying abandoned or underutilized packages." size="5" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="21" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="22" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="purchased_contingent_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_rate" remarks="A rate (Tarif) is a membership tariff template configured by a gym operator, defining pricing, billing frequency, and contract terms. Customers are signed up to contracts based on a rate." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="rate_id" nullable="false" remarks="The primary key of this table. System column calculated by the source System." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="rate_id" foreignKey="erp_v2_bridge_rate_to_rate_code_rate_id__erp_v2_dim_rate_rate_id_fkey_9ee2eae02ce4" implied="false" onDeleteCascade="false" schema="erp_v2" table="bridge_rate_to_rate_code"/>
            <child catalog="enterprise_4e" column="rate_id" foreignKey="erp_v2_dim_contract_voucher_definition_rate_id__erp_v2_dim_rate_rate_id_fkey_c565bcfd10eb" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_contract_voucher_definition"/>
            <child catalog="enterprise_4e" column="rate_id" foreignKey="erp_v2_dim_contract_voucher_rate_discount_period_rate_id__erp_v2_dim_rate_rate_id_fkey_0f1b67906738" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_contract_voucher_rate_discount_period"/>
            <child catalog="enterprise_4e" column="rate_id" foreignKey="erp_v2_dim_rate_localized_rate_id__erp_v2_dim_rate_rate_id_fkey_3be38d4e221e" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate_localized"/>
            <child catalog="enterprise_4e" column="rate_id" foreignKey="erp_v2_dim_rate_term_configuration_rate_id__erp_v2_dim_rate_rate_id_fkey_8aa80a16b5a9" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate_term_configuration"/>
            <child catalog="enterprise_4e" column="rate_id" foreignKey="erp_v2_dim_rate_term_payment_frequency_rate_id__erp_v2_dim_rate_rate_id_fkey_24eaf2a75a7c" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate_term_payment_frequency"/>
            <child catalog="enterprise_4e" column="rate_id" foreignKey="erp_v2_dim_studio_starter_package_adjustment_rate_id__erp_v2_dim_rate_rate_id_fkey_e4f8e5600d4a" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_studio_starter_package_adjustment"/>
            <child catalog="enterprise_4e" column="rate_id" foreignKey="erp_v2_fct_contract_rate_id__erp_v2_dim_rate_rate_id_fkey_6c24ad00ff02" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract"/>
            <child catalog="enterprise_4e" column="rate_id" foreignKey="erp_v2_fct_contract_cancellation_rate_id__erp_v2_dim_rate_rate_id_fkey_58640f8358c5" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract_cancellation"/>
            <child catalog="enterprise_4e" column="rate_id" foreignKey="erp_v2_fct_idle_period_rate_id__erp_v2_dim_rate_rate_id_fkey_bce65a5cca84" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_idle_period"/>
            <child catalog="enterprise_4e" column="rate_id" foreignKey="erp_v2_fct_invoice_rate_id__erp_v2_dim_rate_rate_id_fkey_e147c9be7ad9" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_invoice"/>
            <child catalog="enterprise_4e" column="rate_id" foreignKey="erp_v2_fct_rate_term_payment_frequency_price_rate_id__erp_v2_dim_rate_rate_id_fkey_d81de4569261" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_rate_term_payment_frequency_price"/>
            <child catalog="enterprise_4e" column="rate_id" foreignKey="erp_v2_fct_rate_term_payment_frequency_price_adjustment_rate_id__erp_v2_dim_rate_rate_id_fkey_4fa4778e2590" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_rate_term_payment_frequency_price_adjustment"/>
            <child catalog="enterprise_4e" column="rate_id" foreignKey="erp_v2_fct_revenue_rate_id__erp_v2_dim_rate_rate_id_fkey_e8c4ce28fc0c" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_revenue"/>
            <child catalog="enterprise_4e" column="rate_id" foreignKey="erp_v2_fct_revenue_invoice_based_rate_id__erp_v2_dim_rate_rate_id_fkey_3aa5475d9fe8" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_revenue_invoice_based"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="contract_type" nullable="true" remarks="#### Of which type contracts of this rate should be&#10;* CONTRACT: The main contract of a customer&#10;* MODULE: Services a customer can book additionally (eg a subscription for drinks)&#10;* FLAT_FEE: Fees to enable one-time access to a service" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="name" nullable="true" remarks="The internal name given to this rate by a user." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="active" nullable="true" remarks="(Temporarily) set to a non-functional state, pausing creation of new contracts using this rate." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="archived" nullable="true" remarks="Permanently removed but kept for history." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="6" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="rate_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_rate_bundle" remarks="Rate bundle (offer) header that defines which contract package can be sold via online channels and the contract timing rules tied to it." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="rate_bundle_id" nullable="false" remarks="The primary key of this table. System column calculated by the source System." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="rate_bundle_id" foreignKey="erp_v2_bridge_rate_bundle_to_company_rate_bundle_id__erp_v2_dim_rate_bundle_rate_bundle_id_fkey_ca45bd926733" implied="false" onDeleteCascade="false" schema="erp_v2" table="bridge_rate_bundle_to_company"/>
            <child catalog="enterprise_4e" column="rate_bundle_id" foreignKey="erp_v2_bridge_rate_bundle_to_payment_choice_rate_bundle_id__erp_v2_dim_rate_bundle_rate_bundle_id_fkey_c53498fca3fa" implied="false" onDeleteCascade="false" schema="erp_v2" table="bridge_rate_bundle_to_payment_choice"/>
            <child catalog="enterprise_4e" column="rate_bundle_id" foreignKey="erp_v2_dim_discount_campaign_scope_rate_bundle_id__erp_v2_dim_rate_bundle_rate_bundle_id_fkey_36f09d6ebe50" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_discount_campaign_scope"/>
            <child catalog="enterprise_4e" column="rate_bundle_id" foreignKey="erp_v2_dim_rate_bundle_term_rate_bundle_id__erp_v2_dim_rate_bundle_rate_bundle_id_fkey_cfaee6d7ef31" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate_bundle_term"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="is_archived" nullable="true" remarks="Whether the rate bundle is archived." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="limited_offering_start_date" nullable="true" remarks="Start date for when the offer can be presented." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="limited_offering_end_date" nullable="true" remarks="End date for when the offer can be presented." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="contract_start_type" nullable="true" remarks="How the contract start date is determined for this offer." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="start_date_of_use_type" nullable="true" remarks="How the start date of use is determined for this offer." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="7" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="rate_bundle_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_rate_bundle_term" remarks="Payment-term options for a rate bundle, such as monthly or term-based variants, including the payment frequency used to charge customers." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="rate_bundle_term_id" nullable="false" remarks="The primary key of this table. System column calculated by the source System." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="rate_bundle_term_id" foreignKey="erp_v2_dim_discount_campaign_scope_rate_bundle_term_id__erp_v2_dim_rate_bundle_term_rate_bundle_term_id_fkey_460c2f074767" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_discount_campaign_scope"/>
            <child catalog="enterprise_4e" column="rate_bundle_term_id" foreignKey="erp_v2_fct_contract_rate_bundle_term_id__erp_v2_dim_rate_bundle_term_rate_bundle_term_id_fkey_4651a84a9af7" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract"/>
            <child catalog="enterprise_4e" column="rate_bundle_term_id" foreignKey="erp_v2_fct_rate_bundle_term_availability_rate_bundle_term_id__erp_v2_dim_rate_bundle_term_rate_bundle_term_id__63dbe9cd5551" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_rate_bundle_term_availability"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="rate_bundle_id" nullable="true" remarks="The rate bundle that owns the term." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_bundle_id" foreignKey="erp_v2_dim_rate_bundle_term_rate_bundle_id__erp_v2_dim_rate_bundle_rate_bundle_id_fkey_cfaee6d7ef31" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate_bundle"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="rate_term_payment_frequency_id" nullable="true" remarks="The payment frequency configuration used by the bundle term." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_term_payment_frequency_id" foreignKey="erp_v2_dim_rate_bundle_term_rate_term_payment_frequency_id__erp_v2_dim_rate_term_payment_frequency_rate_term_p_47bf3f42eb8b" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate_term_payment_frequency"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="rate_term_configuration_id" nullable="true" remarks="The rate term configuration associated with the bundle term." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_term_configuration_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_rate_term_configuration"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="is_archived" nullable="true" remarks="Whether the bundle term is archived." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="6" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="rate_bundle_term_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_rate_code" remarks="Rate codes (tags) that can be assigned to rates for categorization and filtering purposes." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="rate_code_id" nullable="false" remarks="The primary key, represent the id of a rate_code" size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="rate_code_id" foreignKey="erp_v2_bridge_rate_to_rate_code_rate_code_id__erp_v2_dim_rate_code_rate_code_id_fkey_dd41198c328b" implied="false" onDeleteCascade="false" schema="erp_v2" table="bridge_rate_to_rate_code"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="description" nullable="true" remarks="The Rate Code Description. Defaults to 'UNKNOWN' when not provided." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="name" nullable="true" remarks="The rate code name" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="color_hex" nullable="true" remarks="Hex color code used to visually represent the rate code in UIs (e.g. #FF5733)." size="7" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="active" nullable="true" remarks="Whether the rate code is currently available for assignment to new rates." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="archived" nullable="true" remarks="Whether the rate code has been permanently archived (kept for history)." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="7" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="rate_code_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_rate_localized" remarks="The localized version of a rate, defining translated information of a rate per locale. One rate can have multiple localized versions." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="rate_localized_id" nullable="false" remarks="The primary key of this table." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="rate_id" nullable="true" remarks="The foreign key to the rate table." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_id" foreignKey="erp_v2_dim_rate_localized_rate_id__erp_v2_dim_rate_rate_id_fkey_3be38d4e221e" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="locale" nullable="true" remarks="The locale representing the language and region for which the rate is translated, formatted as a combination of ISO-639 language code and ISO-3166 country code (e.g., `de_DE`)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="public_name" nullable="true" remarks="The public name given to this rate for this locale by a user." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="description" nullable="true" remarks="The description given to this rate for this locale by a user." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="6" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="rate_localized_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_rate_term_configuration" remarks="Configuration of contract terms, extensions, cancellations and idle periods for a rate. This table details the rules governing the lifecycle of a contract associated with a specific rate, including initial duration, renewal policies, cancellation notice periods, and allowances for pausing the contract (idle periods)." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="rate_term_configuration_id" nullable="false" remarks="Primary key of this table. System column calculated by the source System." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="rate_term_configuration_id" foreignKey="erp_v2_dim_contract_voucher_rate_discount_period_rate_term_configuration_id__erp_v2_dim_rate_term_configuratio_0956186ce754" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_contract_voucher_rate_discount_period"/>
            <child catalog="enterprise_4e" column="rate_term_configuration_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_rate_bundle_term"/>
            <child catalog="enterprise_4e" column="rate_term_configuration_id" foreignKey="erp_v2_dim_rate_term_payment_frequency_rate_term_configuration_id__erp_v2_dim_rate_term_configuration_rate_ter_f9b701626c3d" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate_term_payment_frequency"/>
            <child catalog="enterprise_4e" column="rate_term_configuration_id" foreignKey="erp_v2_dim_studio_starter_package_adjustment_rate_term_configuration_id__erp_v2_dim_rate_term_configuration_ra_af781dd95291" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_studio_starter_package_adjustment"/>
            <child catalog="enterprise_4e" column="rate_term_configuration_id" foreignKey="erp_v2_fct_rate_term_payment_frequency_price_rate_term_configuration_id__erp_v2_dim_rate_term_configuration_ra_1d03f4728b27" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_rate_term_payment_frequency_price"/>
            <child catalog="enterprise_4e" column="rate_term_configuration_id" foreignKey="erp_v2_fct_rate_term_payment_frequency_price_adjustment_rate_term_configuration_id__erp_v2_dim_rate_term_confi_f1a2952e2290" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_rate_term_payment_frequency_price_adjustment"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="rate_id" nullable="true" remarks="The rate (tariff) to which these configuration rules apply." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_id" foreignKey="erp_v2_dim_rate_term_configuration_rate_id__erp_v2_dim_rate_rate_id_fkey_8aa80a16b5a9" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="is_archived" nullable="true" remarks="Indicates whether this rate term configuration has been archived." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="term" nullable="true" remarks="The initial duration of the contract. Combined with `term_unit`, this defines the minimum commitment period." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="term_unit" nullable="true" remarks="The time unit for the initial contract duration. One of [`DAY`, `WEEK`, `MONTH`, `YEAR`]." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="cancelation_period" nullable="true" remarks="The notice period required for cancellation before the term ends. Combined with `cancelation_period_unit` to specify the minimum notice period before contract end." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="cancelation_period_unit" nullable="true" remarks="The time unit for the cancellation notice period. One of [`DAY`, `WEEK`, `MONTH`, `YEAR`]." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="extension_fixed_term" nullable="true" remarks="The duration by which the contract is automatically extended if not cancelled. Combined with `extension_fixed_term_unit` to define the renewal period length." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="extension_fixed_term_unit" nullable="true" remarks="The time unit for the automatic extension duration. One of [`DAY`, `WEEK`, `MONTH`, `YEAR`]." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="extension_type" nullable="true" remarks="#### The logic applied for contract extension. One of &#10;* `NONE`: no automatic renewal&#10;* `SUBSEQUENT_RATE_DETAIL`: a new contract is created at the end of the term&#10;* `TERM_EXTENSION`: the contract updates its end date by the fixed extension term" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="cancelation_strategy" nullable="true" remarks="#### The strategy defining how cancellations are handled. One of:&#10;  * `TERM`: contract ends at the end of the current term after the cancellation period&#10;  * `RECEIPT_DATE`: contract ends on the receipt date plus the cancellation period" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="11" name="starter_package" nullable="true" remarks="One-time setup fee charged when a contract is created. This is a monetary amount that can be 0 for no fee, or a positive value representing the enrollment/activation cost." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="idle_period_name" nullable="true" remarks="The name of the associated idle period configuration, describing the policy for pausing the contract (e.g., `Standard Idle Period`, `TrainPlus Freeze`)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="idle_period_reference_period" nullable="true" remarks="#### The reference period over which idle time limits are calculated. One of : &#10;  * `CONTRACT_YEAR`: counts from the contract start date &#10;  * `CALENDAR_YEAR`: uses calendar year boundaries" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="idle_period_max_term_per_reference_period" nullable="true" remarks="The maximum total duration of idle time allowed within a single reference period. Measured in the default temporal unit of the idle period configuration. NULL means no limit." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="idle_period_max_consecutive_term" nullable="true" remarks="The maximum duration allowed for a single continuous idle period. Measured in the default temporal unit of the idle period configuration. NULL means no limit." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="idle_period_submission_deadline_days" nullable="true" remarks="The minimum number of days in advance a customer must request an idle period before it can begin." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="idle_period_type" nullable="true" remarks="The effect of the idle period on the contract. One of [`CHARGE_FREE_WITHOUT_EXTENSION`, `CHARGE_FREE_WITH_EXTENSION`, `FULLY_CHARGED_WITH_EXTENSION`, `PARTIALLY_CHARGED_WITH_EXTENSION`, `PARTIALLY_CHARGED_WITHOUT_EXTENSION`]. CHARGE_FREE_WITH_EXTENSION extends the contract end date by the idle period duration at no cost, CHARGE_FREE_WITHOUT_EXTENSION pauses without extending the contract, FULLY_CHARGED charges the full amount during idle period, PARTIALLY_CHARGED applies a reduced charge." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="18" name="idle_period_amount" nullable="true" remarks="The cost charged to the customer for taking an idle period, if any. Amount in the organization units currency." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="19" name="idle_period_entrance_lock" nullable="true" remarks="Indicates whether the customer is blocked from entering the studio during the idle period. True means no physical access allowed." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="20" name="idle_period_unlimited_allowed" nullable="true" remarks="Indicates whether the customer is allowed an unlimited number of idle periods, overriding the max_term_per_reference_period and max_consecutive_term limits." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="21" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="22" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="rate_term_configuration_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_rate_term_payment_frequency" remarks="Payment frequency options available for rate terms, including price, cadence, and calculation settings." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="rate_term_payment_frequency_id" nullable="false" remarks="Primary key of the payment frequency configuration." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="rate_term_payment_frequency_id" foreignKey="erp_v2_dim_contract_voucher_rate_discount_period_rate_term_payment_frequency_id__erp_v2_dim_rate_term_payment__f347a8726f1b" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_contract_voucher_rate_discount_period"/>
            <child catalog="enterprise_4e" column="rate_term_payment_frequency_id" foreignKey="erp_v2_dim_rate_bundle_term_rate_term_payment_frequency_id__erp_v2_dim_rate_term_payment_frequency_rate_term_p_47bf3f42eb8b" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate_bundle_term"/>
            <child catalog="enterprise_4e" column="rate_term_payment_frequency_id" foreignKey="erp_v2_fct_rate_term_payment_frequency_price_rate_term_payment_frequency_id__erp_v2_dim_rate_term_payment_freq_54f1456d7341" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_rate_term_payment_frequency_price"/>
            <child catalog="enterprise_4e" column="rate_term_payment_frequency_id" foreignKey="erp_v2_fct_rate_term_payment_frequency_price_adjustment_rate_term_payment_frequency_id__erp_v2_dim_rate_term_p_f114d3930fb7" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_rate_term_payment_frequency_price_adjustment"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="rate_term_configuration_id" nullable="true" remarks="The rate term configuration this payment frequency belongs to." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_term_configuration_id" foreignKey="erp_v2_dim_rate_term_payment_frequency_rate_term_configuration_id__erp_v2_dim_rate_term_configuration_rate_ter_f9b701626c3d" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate_term_configuration"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="rate_id" nullable="true" remarks="The rate connected to this payment frequency." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_id" foreignKey="erp_v2_dim_rate_term_payment_frequency_rate_id__erp_v2_dim_rate_rate_id_fkey_24eaf2a75a7c" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="payment_frequency_type" nullable="true" remarks="Type of payment frequency. Possible values: FREE, NON_RECURRING, RECURRING, TERM_BASED, MONTH_DAY." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="4" name="payment_frequency_price" nullable="true" remarks="Standard price for this payment frequency" size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="payment_frequency_value" nullable="true" remarks="Value associated with the frequency unit" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="payment_frequency_unit" nullable="true" remarks="Unit of the payment frequency. Possible values: DAY, WEEK, MONTH, YEAR." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="is_archived" nullable="true" remarks="Whether this configuration is archived" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="9" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="rate_term_payment_frequency_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_revenue_group" remarks="A hierarchical categorization of revenues into a broad main_group and a finer grained sub_group." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="revenue_group_id" nullable="false" remarks="The primary key of this table." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="revenue_group_id" foreignKey="erp_v2_fct_revenue_revenue_group_id__erp_v2_dim_revenue_group_revenue_group_id_fkey_9c8d22346f1b" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_revenue"/>
            <child catalog="enterprise_4e" column="revenue_group_id" foreignKey="erp_v2_fct_revenue_cash_based_revenue_group_id__erp_v2_dim_revenue_group_revenue_group_id_fkey_cb3674ae5b59" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_revenue_cash_based"/>
            <child catalog="enterprise_4e" column="revenue_group_id" foreignKey="erp_v2_fct_revenue_invoice_based_revenue_group_id__erp_v2_dim_revenue_group_revenue_group_id_fkey_5faa1ef0796f" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_revenue_invoice_based"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="main_group" nullable="true" remarks="Categorizing income into 3 broad types:&#10;* CHARGES_SALES: positive income of any contracts or services&#10;* DEDUCTION: mostly negative income reducing amounts made from CHARGES_SALES&#10;* FEES: mostly positive income made from penalties&#10;&#10;Additionally `UNCATEGORIZED` might temporarily appear while new transaction types are being mapped." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="sub_group" nullable="true" remarks="Categorizing the main_group in finer details:&#10;&#10;##### CHARGES_SALES&#10;* ADDITIONAL_CHARGE: Additional income related to contracts&#10;* ADDITIONAL_MODULE: Income of customers booking more modules to their main contract&#10;* DEPOSIT: Income of deposits (eg bottles)&#10;* FLAT_FEE: Income of fees, customers have to pay additionally to their main contract&#10;* MEMBERSHIP_FEE: Income of main contracts&#10;* REST_PERIOD_CONTRIBUTION: Income of charges made of customers putting their contract into an inactive &quot;idle period&quot;&#10;* SALE_OF_GOODS_AND_SERVICES: Income of selling a product (see product_name) or service (eg `Shower 1x`) with no product explicitly set up&#10;* STARTER_PACKAGE: Income of the initial/setup fee of a contract&#10;&#10;##### DEDUCTION&#10;* CREDIT: Amount granted to someone, most often because of an illness&#10;* DEBT_CLAIM_REDUCTION: Amount discounting previous charges&#10;* DEBT_CLAIM_REVERSAL: Amount cancelling previous charges&#10;* DERECOGNITION: Loss of previous charges. A customer did not pay and the charge is written off as bad debt. Use this sub_group to measure bad debt in fct_revenue.&#10;* REFUND_OF_DEPOSIT: Loss of a deposit (eg bottles) being returned&#10;* VOUCHER_EXPIRATION: Income of a multi-purpose voucher being expired.&#10;&#10;##### FEES&#10;* BANKING_FEE: Income/Cost of fees related to payments&#10;* DUNNING_PENALTY_FEE: Income of charges made to a customers not paying on time&#10;* OTHER_FEE: Income of charges like address-requests or compensations in case of damages" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="4" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="revenue_group_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_service" remarks="A general service (a class, a personal training, the replacement of a member card...), &#10;that can be provided to a customer. The service could be included in the customers &#10;contract(s), with a limiting contingent (eg when its a Sauna subscription) or be &#10;booked individually (eg when its a class)." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="service_id" nullable="false" remarks="The primary key of this table. System column calculated by the source System." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="service_id" foreignKey="erp_v2_bridge_service_to_organization_unit_service_id__erp_v2_dim_service_service_id_fkey_027ea9035df6" implied="false" onDeleteCascade="false" schema="erp_v2" table="bridge_service_to_organization_unit"/>
            <child catalog="enterprise_4e" column="service_id" foreignKey="erp_v2_dim_product_service_id__erp_v2_dim_service_service_id_fkey_292dad53b2fd" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_product"/>
            <child catalog="enterprise_4e" column="service_id" foreignKey="erp_v2_dim_purchased_contingent_service_id__erp_v2_dim_service_service_id_fkey_abb1fd04e195" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_purchased_contingent"/>
            <child catalog="enterprise_4e" column="service_id" foreignKey="erp_v2_fct_customer_appointment_service_id__erp_v2_dim_service_service_id_fkey_615003f02b3b" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_customer_appointment"/>
            <child catalog="enterprise_4e" column="service_id" foreignKey="erp_v2_fct_service_usage_service_id__erp_v2_dim_service_service_id_fkey_252e7c8293c0" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_service_usage"/>
            <child catalog="enterprise_4e" column="service_id" foreignKey="erp_v2_fct_trainer_appointment_service_id__erp_v2_dim_service_service_id_fkey_b6c7f57ca44b" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_trainer_appointment"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="name" nullable="true" remarks="The name of the service" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="description" nullable="true" remarks="The description of the service. NULLs are filled with `UNKNOWN`." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="category_name" nullable="true" remarks="A common group (both user defined or system-given) this service can be &#10;categorized into (eg. `functionaltraining`, `wellness`, `consulting`). &#10;NULLs are filled with `UNKNOWN`." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="purchasing_type" nullable="true" remarks="How customers can pay to use this service. One of &#10;[`CONSUMPTION_CREDIT`, `DIRECT_DEBIT`, `LATER`, `FORBIDDEN`]" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="free_usage" nullable="true" remarks="Whether or not the service is free (derived from booking_option_type = 'FREE_USAGE')" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="studio_access_type" nullable="true" remarks="For who this service is available, such as:&#10;* MAIN_STUDIO: service is only provided at the customers home studio (the studio, that's related to his main contract)&#10;* ALL_STUDIOS: service is provided at all studios the customer can access&#10;* RESTRICTED_STUDIOS: service is only provided at a specific set of studios to the customer" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="archived" nullable="true" remarks="Permanently removed but kept for historic relations." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="booking_option_type" nullable="true" remarks="How a service can be booked:&#10;* USAGE_REQUIRES_CONTINGENT: service can be booked only with a usage of a purchased or inclusive contingent e.g via using a voucher or a specific tariff of the contract that user has&#10;* FREE_USAGE: service can be booked without any cost in contingent&#10;* DISPLAY_ONLY: used for MySports. Customers are not able to book this class. They can only see when this class will take place" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="service_type" nullable="true" remarks="Customer-facing service type that describes how a service is used or booked.&#10;Magicline groups services into usage, time, appointment, and check-in concepts; this mart exposes the business types below.&#10;- BUNDLE_BASED: A service consumed as part of a bundled offering.&#10;- USAGE_BASED: A service consumed one unit at a time, such as a visit from a usage pack.&#10;- CHECK_IN_BASED: A day ticket or entry service triggered by a facility check-in.&#10;- CLASS_BASED: A group class or course booking.&#10;- APPOINTMENT_BASED: A one-to-one appointment service defined by duration and required resources." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="11" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="service_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_studio_starter_package_adjustment" remarks="Studio-specific overrides for the one-time starter package fee charged at membership sign-up.&#10;Each row defines a custom fee for a specific gym and rate term configuration, overriding the&#10;default fee on the rate term (dim_rate_term_configuration.starter_package).&#10;Only gyms with an explicit override have a row here; the absence of a row means the rate term&#10;default applies." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="studio_starter_package_adjustment_id" nullable="false" remarks="The primary key of this table. System-generated identifier of the adjustment per studio." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="rate_id" nullable="true" remarks="The rate (tariff) for which this adjustment rule applies." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_id" foreignKey="erp_v2_dim_studio_starter_package_adjustment_rate_id__erp_v2_dim_rate_rate_id_fkey_e4f8e5600d4a" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="rate_term_configuration_id" nullable="true" remarks="The rate term configuration for which this starter package amount applies." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_term_configuration_id" foreignKey="erp_v2_dim_studio_starter_package_adjustment_rate_term_configuration_id__erp_v2_dim_rate_term_configuration_ra_af781dd95291" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate_term_configuration"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="organization_unit_id" nullable="true" remarks="The organization unit (gym) where this starter package amount applies." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_dim_studio_starter_package_adjustment_organization_unit_id__erp_v2_dim_organization_unit_organization_u_711bef1b21d1" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="2" id="4" name="amount" nullable="true" remarks="The studio-specific override for the one-time starter package fee. Overrides the default fee defined on the rate term configuration. A value of 0.0 means the studio has explicitly waived the fee." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="valid_from" nullable="true" remarks="The date from which this studio-specific starter package adjustment applies." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="valid_until" nullable="true" remarks="The date until which this studio-specific starter package adjustment applies." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="is_archived" nullable="true" remarks="Whether this studio-specific starter package adjustment has been archived." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="9" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="studio_starter_package_adjustment_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="dim_trainer_appointment_status" remarks="Lookup table for status values of trainer assignments to appointments" schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="trainer_appointment_status_id" nullable="false" remarks="The primary key of this table. System column calculated by DataOps." size="256" type="varchar" typeCode="12">
            <child catalog="enterprise_4e" column="trainer_appointment_status_id" foreignKey="erp_v2_fct_trainer_class_appointments_trainer_appointment_status_id__erp_v2_dim_trainer_appointment_status_tra_487e44118838" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_trainer_class_appointments"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="status" nullable="true" remarks="Status of trainer assignment to appointment:&#10;* BOOKED: the trainer is available for the appointment&#10;* DESIRED: the trainer is planned/not available for the appointment&#10;* APPOINTMENT_CANCELED: appointment was cancelled" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="3" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="trainer_appointment_status_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="fct_checkin" remarks="Each row represents a single gym visit by a customer. A visit is recorded at the gym the customer checked into (organization_unit_id). If a customer visits a gym other than their home gym, this is called a cross-club visit.&#10;&#10;To identify cross-club visits: compare organization_unit_id (the visited gym) with customer_organization_unit_id (the customer's home gym). If they differ, the visit is a cross-club visit.&#10;&#10;Note: when a customer has privacy settings enabled, their customer_id is masked. If their data was removed due to the data retention period configured in the ERP system, both customer_id and customer_organization_unit_id may be NULL." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="checkin_id" nullable="false" remarks="The primary key of this table. System column calculated by the source System." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="1" name="checkin_time" nullable="true" remarks="The local timestamp at which the checkin happened." size="29" type="timestamp" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="2" name="checkout_time" nullable="true" remarks="The local timestamp at which the customer left the gym again (if he left)." size="29" type="timestamp" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="checkin_date_id" nullable="true" remarks="The date at which the checkin happened" size="10" type="int4" typeCode="4">
            <parent catalog="enterprise_4e" column="date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_date"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="checkout_date_id" nullable="true" remarks="The date at which the checkout happened (if it happened)." size="10" type="int4" typeCode="4">
            <parent catalog="enterprise_4e" column="date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_date"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="organization_unit_id" nullable="true" remarks="The gym (organization_unit) which the customer visited." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_checkin_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_53f443d15805" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="customer_organization_unit_id" nullable="true" remarks="The gym (organization_unit) the customer originally signed up to (their home gym). Can be used to identify cross-club visits: when this differs from organization_unit_id, the check-in is a cross-club visit." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_checkin_customer_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_add16c7191fc" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="customer_id" nullable="true" remarks="The person who visited. Set to NULL when privacy masking applies. Also NULL when customer data was removed due to data retention." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_checkin_customer_id__erp_v2_dim_customer_customer_id_fkey_7952116f2b18" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="device_id" nullable="true" remarks="The machine registering the checkin. Null if person was directly checked-in through Website (without a device)." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="device_id" foreignKey="erp_v2_fct_checkin_device_id__erp_v2_dim_device_device_id_fkey_8a1ae26194f0" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_device"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="has_privacy_config" nullable="true" remarks="Indicates whether privacy configuration applies to this record. When TRUE, customer_id is masked to NULL. customer_organization_unit_id is not masked by this flag, but may still be NULL if customer data was removed due to data retention." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="11" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="checkin_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="fct_class_appointment" remarks="Class appointment fact table" schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="class_appointment_id" nullable="false" remarks="Primary key for class appointment" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="organization_unit_id" nullable="true" remarks="Foreign key to organization unit" size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_class_appointment_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_cde89206a5f0" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="class_id" nullable="true" remarks="Foreign key to class" size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="class_id" foreignKey="erp_v2_fct_class_appointment_class_id__erp_v2_dim_class_class_id_fkey_0eb0a68fdacf" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_class"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="appointment_id" nullable="true" remarks="Foreign key to appointment" size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="appointment_id" foreignKey="erp_v2_fct_class_appointment_appointment_id__erp_v2_dim_appointment_appointment_id_fkey_f4e53bd6c753" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_appointment"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="created_date_id" nullable="true" remarks="Foreign key to date dimension - date when the class appointment was created (YYYYMMDD format)" size="10" type="int4" typeCode="4">
            <parent catalog="enterprise_4e" column="date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_date"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="start_date_id" nullable="true" remarks="Foreign key to date dimension - date when the class appointment starts (YYYYMMDD format)" size="10" type="int4" typeCode="4">
            <parent catalog="enterprise_4e" column="date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_date"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="end_date_id" nullable="true" remarks="Foreign key to date dimension - date when the class appointment ends (YYYYMMDD format)" size="10" type="int4" typeCode="4">
            <parent catalog="enterprise_4e" column="date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_date"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="created_date_time" nullable="true" remarks="DateTime when the class appointment was created" size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="start_date_time" nullable="true" remarks="DateTime when the class appointment starts" size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="end_date_time" nullable="true" remarks="DateTime when the class appointment ends" size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="num_participants" nullable="true" remarks="Number of participants booked for the class appointment" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="num_in_waiting_list" nullable="true" remarks="Number of participants in the waiting list for the class appointment" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="num_anonymous_participants" nullable="true" remarks="Number of anonymous participants booked for the class appointment" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="14" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="class_appointment_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="fct_class_event" remarks="Stores all customer events for class appointments such as booking or cancellations" schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="class_event_id" nullable="false" remarks="The primary key of this table. System column calculated by the source System." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="organization_unit_id" nullable="true" remarks="The studio where the appointment event took place" size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_class_event_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_e6ab28415bac" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="appointment_id" nullable="true" remarks="The ID of the appointment where a customer wants to participate" size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="appointment_id" foreignKey="erp_v2_fct_class_event_appointment_id__erp_v2_dim_appointment_appointment_id_fkey_ef6408601227" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_appointment"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="start_date_id" nullable="true" remarks="Start date of appointment" size="10" type="int4" typeCode="4">
            <parent catalog="enterprise_4e" column="date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_date"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="end_date_id" nullable="true" remarks="End date of appointment" size="10" type="int4" typeCode="4">
            <parent catalog="enterprise_4e" column="date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_date"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="event_date_id" nullable="true" remarks="The date when the appointment event was created" size="10" type="int4" typeCode="4">
            <parent catalog="enterprise_4e" column="date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_date"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="event_date_time" nullable="true" remarks="The timestamp when the appointment event was created" size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="class_id" nullable="true" remarks="The ID of the related class for the appointment" size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="class_id" foreignKey="erp_v2_fct_class_event_class_id__erp_v2_dim_class_class_id_fkey_608cf7f8dd85" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_class"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="customer_id" nullable="true" remarks="The ID of the customer" size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_class_event_customer_id__erp_v2_dim_customer_customer_id_fkey_a00da0c26bf7" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="inclusive_contingent_id" nullable="true" remarks="The ID of the inclusive contingent which was used for booking. If NULL, inclusive contingent was not used to book a class" size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="inclusive_contingent_id" foreignKey="erp_v2_fct_class_event_inclusive_contingent_id__erp_v2_dim_inclusive_contingent_inclusive_contingent_id_fkey_94ae8bcc3b4a" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_inclusive_contingent"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="purchased_contingent_id" nullable="true" remarks="The ID of the purchased contingent which was used for booking. If NULL, purchased contingent was not used to book a class" size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="purchased_contingent_id" foreignKey="erp_v2_fct_class_event_purchased_contingent_id__erp_v2_dim_purchased_contingent_purchased_contingent_id_fkey_895261d4114d" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_purchased_contingent"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="class_event_property_id" nullable="true" remarks="Appointment event properties, e.g., status of the event (BOOKED, CANCELED), source - from which system the event was triggered, whether it was booked for free or not" size="256" type="varchar" typeCode="12">
            <parent catalog="enterprise_4e" column="class_event_property_id" foreignKey="erp_v2_fct_class_event_class_event_property_id__erp_v2_dim_class_event_property_class_event_property_id_fkey_2f246406031f" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_class_event_property"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="13" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="class_event_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="fct_contract" remarks="The contract between a customer and a gym (organization_unit). Includes different contract_types ([CONTRACT, MODULE, FLAT_FEE] see `dim_rate.contract_type`) and reversed contracts (see `is_reversed`)." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="contract_id" nullable="false" remarks="The primary key of this table. System column calculated by the source System." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="contract_id" foreignKey="erp_v2_dim_customer_group_contract_id__erp_v2_fct_contract_contract_id_fkey_f3bb8a9435ed" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer_group"/>
            <child catalog="enterprise_4e" column="main_contract_id" foreignKey="erp_v2_fct_contract_main_contract_id__erp_v2_fct_contract_contract_id_fkey_3bac2f809e19" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract"/>
            <child catalog="enterprise_4e" column="subsequent_contract_id" foreignKey="erp_v2_fct_contract_subsequent_contract_id__erp_v2_fct_contract_contract_id_fkey_067fa8c35887" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract"/>
            <child catalog="enterprise_4e" column="contract_id" foreignKey="erp_v2_fct_contract_price_history_contract_id__erp_v2_fct_contract_contract_id_fkey_7ec3efc38ad2" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract_price_history"/>
            <child catalog="enterprise_4e" column="contract_id" foreignKey="erp_v2_fct_contract_term_dates_contract_id__erp_v2_fct_contract_contract_id_fkey_212b7c43ac65" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract_term_dates"/>
            <child catalog="enterprise_4e" column="contract_id" foreignKey="erp_v2_fct_contract_voucher_contract_id__erp_v2_fct_contract_contract_id_fkey_ba952ea0cd6e" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract_voucher"/>
            <child catalog="enterprise_4e" column="contract_id" foreignKey="erp_v2_fct_idle_period_contract_id__erp_v2_fct_contract_contract_id_fkey_310391a1376b" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_idle_period"/>
            <child catalog="enterprise_4e" column="contract_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="fct_invoice"/>
            <child catalog="enterprise_4e" column="contract_id" foreignKey="erp_v2_fct_revenue_contract_id__erp_v2_fct_contract_contract_id_fkey_c41c7b632840" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_revenue"/>
            <child catalog="enterprise_4e" column="contract_id" foreignKey="erp_v2_fct_revenue_cash_based_contract_id__erp_v2_fct_contract_contract_id_fkey_c182b8d8ecd4" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_revenue_cash_based"/>
            <child catalog="enterprise_4e" column="contract_id" foreignKey="erp_v2_fct_revenue_invoice_based_contract_id__erp_v2_fct_contract_contract_id_fkey_4059737dd498" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_revenue_invoice_based"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="imported_contract_number" nullable="true" remarks="The contract number as it was set in a previous system the contract was imported from. Only set if it was specifically required in the import-process." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="third_party_id" nullable="true" remarks="A unique identifier of the contract in a third-party system. This is used to link the contract to a third-party system, like a CRM or ERP system." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="main_contract_id" nullable="true" remarks="The related main (membership) contract, if this contract is a module or flat fee that can only be booked in addition to a membership." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="contract_id" foreignKey="erp_v2_fct_contract_main_contract_id__erp_v2_fct_contract_contract_id_fkey_3bac2f809e19" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="is_reversed" nullable="true" remarks="Indicates if the contract has been reversed, effectively nullifying any associated payments and treating the contract as if it never existed in the originating system." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="created_date_id" nullable="true" remarks="Date when the contract was added to the Systems database. Contracts might be imported into the System after the actual sign/conclusion date. There is no information when a contract was actually signed/concluded because it's not provided on the migration stage to the System." size="10" type="int4" typeCode="4">
            <parent catalog="enterprise_4e" column="date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_date"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="start_date_id" nullable="true" remarks="Date when the contract starts." size="10" type="int4" typeCode="4">
            <parent catalog="enterprise_4e" column="date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_date"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="start_date_of_use_id" nullable="true" remarks="Date when the customer can already visit the facility. If the customer is allowed to use the gym before the actual contract starts this column contains a date which is before the `start_date_id` of the contract. Otherwise this column is equal to `start_date_id`." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="end_date_id" nullable="true" remarks="Date when the contract ends." size="10" type="int4" typeCode="4">
            <parent catalog="enterprise_4e" column="date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_date"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="first_booking_date" nullable="true" remarks="The date scheduled for the contract's first charge, based on the contract's payment frequency and billing configuration. Is `Null` for a small share of contracts where this has not yet been calculated. For contracts migrated from a previous system, this value is known to be occasionally inconsistent with the contract's own start and end dates, since it reflects the source system's calculation at the time of migration rather than a live re-derivation. This value is populated as-is regardless of `is_reversed`; consumers should filter or flag reversed contracts (`is_reversed = true`) separately if they need to exclude them." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="cancellation_date_id" nullable="true" remarks="Date when a contracts cancellation comes into effect, ending the contract. Is `Null` for contracts which are not cancelled." size="10" type="int4" typeCode="4">
            <parent catalog="enterprise_4e" column="date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_date"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="cancellation_receipt_date_id" nullable="true" remarks="The date when the receipt of cancellation was provided. Is `Null` for contracts which are not cancelled." size="10" type="int4" typeCode="4">
            <parent catalog="enterprise_4e" column="date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_date"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="pre_cancellation_end_date_id" nullable="true" remarks="The contract end date before cancellation. Is `Null` for contracts which are not cancelled." size="10" type="int4" typeCode="4">
            <parent catalog="enterprise_4e" column="date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_date"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="rate_id" nullable="true" remarks="The tariff of the contract generating an income." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_id" foreignKey="erp_v2_fct_contract_rate_id__erp_v2_dim_rate_rate_id_fkey_6c24ad00ff02" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="organization_unit_id" nullable="true" remarks="The gym (organization_unit) to which the customer and therefore the contract belongs." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_contract_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_b1c3c75d1a29" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="employee_id" nullable="true" remarks="The employee responsible for making the customer sign the contract. Falls back to the employee whose user account created the contract when no explicit employee assignment exists. Is `Null` only when neither can be resolved." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="employee_id" foreignKey="erp_v2_fct_contract_employee_id__erp_v2_dim_employee_employee_id_fkey_54e92a4e8fd8" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_employee"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="employee_id_source" nullable="true" remarks="The source of `employee_id`: `CONTRACT_EMPLOYEE` when explicitly associated with the contract, or `CONTRACT_CREATOR` when resolved from the user account that created the contract. Is `Null` when no employee can be resolved." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="customer_id" nullable="true" remarks="The person who the contract belongs to. Is set to `Null` when privacy settings come into effect." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_contract_customer_id__erp_v2_dim_customer_customer_id_fkey_37033086980d" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="18" name="contract_property_id" nullable="true" remarks="ID of the contract property, e.g signature_status, disabled, etc." size="256" type="varchar" typeCode="12">
            <parent catalog="enterprise_4e" column="contract_property_id" foreignKey="erp_v2_fct_contract_contract_property_id__erp_v2_dim_contract_property_contract_property_id_fkey_ed2c046c6e2a" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_contract_property"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="19" name="contract_term_id" nullable="true" remarks="ID of the contract term." size="256" type="varchar" typeCode="12">
            <parent catalog="enterprise_4e" column="contract_term_id" foreignKey="erp_v2_fct_contract_contract_term_id__erp_v2_dim_contract_term_contract_term_id_fkey_313196804702" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_contract_term"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="20" name="contract_cancellation_reason_id" nullable="true" remarks="The reason why the contract was cancelled. Is `Null` for contracts which are not cancelled." size="256" type="varchar" typeCode="12">
            <parent catalog="enterprise_4e" column="contract_cancellation_reason_id" foreignKey="erp_v2_fct_contract_contract_cancellation_reason_id__erp_v2_dim_contract_cancellation_reason_contract_cancella_2593f16b1f8a" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_contract_cancellation_reason"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="21" name="company_id" nullable="true" remarks="The partner company (Corporate Fitness) assigned to this contract directly or by a voucher effective at the current date." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="company_id" foreignKey="erp_v2_fct_contract_company_id__erp_v2_dim_company_company_id_fkey_8ca1239364d9" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_company"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="22" name="discount_campaign_id" nullable="true" remarks="The discount campaign that was active when this contract was concluded and whose discount was applied. NULL for the vast majority of contracts (feature not yet widely used in production). Use dim_discount_campaign to access campaign details such as name, validity window, and voucher interoperability mode." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="discount_campaign_id" foreignKey="erp_v2_fct_contract_discount_campaign_id__erp_v2_dim_discount_campaign_discount_campaign_id_fkey_acd88b13dfa5" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_discount_campaign"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="23" name="contract_payment_frequency_id" nullable="true" remarks="The setting of how often and how much is paid for this contract." size="256" type="varchar" typeCode="12">
            <parent catalog="enterprise_4e" column="contract_payment_frequency_id" foreignKey="erp_v2_fct_contract_contract_payment_frequency_id__erp_v2_dim_contract_payment_frequency_contract_payment_freq_9af692569944" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_contract_payment_frequency"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="24" name="rate_bundle_term_id" nullable="true" remarks="The rate bundle term the contract was sold with, resolved from the accepted contract proposal. NULL for imported or legacy contracts that were not created through a proposal." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_bundle_term_id" foreignKey="erp_v2_fct_contract_rate_bundle_term_id__erp_v2_dim_rate_bundle_term_rate_bundle_term_id_fkey_4651a84a9af7" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate_bundle_term"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="25" name="subsequent_contract_id" nullable="true" remarks="The follow-up contract created after this contract expires, linked via a contract switch. NULL if no subsequent contract exists." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="contract_id" foreignKey="erp_v2_fct_contract_subsequent_contract_id__erp_v2_fct_contract_contract_id_fkey_067fa8c35887" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="6" id="26" name="cancellation_fee" nullable="true" remarks="Amount of fee that a customer must pay for the cancellation. Is `Null` for contracts which are not cancelled." size="23" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="17" id="27" name="original_monthly_price" nullable="true" remarks="The estimated price, amortized over the contracts (initial) term, that has to be paid for this contract each month. By the **original contract settings**, without taking adjustments or contract starts in between payment periods into account. See fct_revenue for more accurate data." size="17" type="float8" typeCode="8"/>
         <column autoUpdated="false" defaultValue="null" digits="17" id="28" name="current_monthly_price" nullable="true" remarks="The estimated price, amortized over the contracts term, that has to be paid for this contract each month. Taking adjustments until the current date but not contract starts in between payment periods into account. See fct_revenue for more accurate data." size="17" type="float8" typeCode="8"/>
         <column autoUpdated="false" defaultValue="null" digits="17" id="29" name="original_total_price" nullable="true" remarks="The estimated price, that has to be paid for this contracts (initial) term in total. By the **original contract settings**, without taking adjustments or contract starts in between payment periods into account. See fct_revenue for more accurate data." size="17" type="float8" typeCode="8"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="30" name="last_date_before_contract_renewal" nullable="true" remarks="The last date that the user can cancel the contract ordinarily before automatic renewal or contract switch. Value is null for non-recurring contracts." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="31" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="32" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="contract_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="fct_contract_cancellation" remarks="DEPRECATED. Use fct_contract instead. Records each contract cancellation event, capturing the cancellation reason, effective dates, associated fee, customer, organization unit, and tariff rate. Use this table to analyze cancellation patterns, churn drivers, and associated revenue impact." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="contract_cancellation_id" nullable="false" remarks="Primary key for contract cancellation" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="cancellation_reason_id" nullable="true" remarks="Foreign key to cancellation reason - the reason why the contract was canceled" size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="cancellation_reason_id" foreignKey="erp_v2_fct_contract_cancellation_cancellation_reason_id__erp_v2_dim_cancellation_reason_cancellation_reason_id_842390f8bf91" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_cancellation_reason"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="organization_unit_id" nullable="true" remarks="Foreign key to the organization unit (gym) associated with the customer of the canceled contract" size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_contract_cancellation_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_de00c0a9ddbb" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="2" id="3" name="fee" nullable="true" remarks="Amount of fee that a customer must pay for the cancellation" size="23" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="currency_id" nullable="true" remarks="Currency code in which the cancellation fee is denominated (e.g. EUR)" size="256" type="varchar" typeCode="12">
            <parent catalog="enterprise_4e" column="currency_id" foreignKey="erp_v2_fct_contract_cancellation_currency_id__erp_v2_dim_currency_currency_id_fkey_f92da2de7845" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_currency"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="cancellation_receipt_date_id" nullable="true" remarks="Foreign key to date dimension - the date when the receipt of cancellation was provided (YYYYMMDD format)" size="10" type="int4" typeCode="4">
            <parent catalog="enterprise_4e" column="date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_date"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="pre_cancellation_end_date_id" nullable="true" remarks="Foreign key to date dimension - the contract end date before cancellation (YYYYMMDD format)" size="10" type="int4" typeCode="4">
            <parent catalog="enterprise_4e" column="date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_date"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="cancellation_date_id" nullable="true" remarks="Foreign key to date dimension - date when the contract cancellation comes into effect (YYYYMMDD format)" size="10" type="int4" typeCode="4">
            <parent catalog="enterprise_4e" column="date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_date"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="contract_end_date_id" nullable="true" remarks="Foreign key to date dimension - the end date of the contract (YYYYMMDD format)" size="10" type="int4" typeCode="4">
            <parent catalog="enterprise_4e" column="date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_date"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="customer_id" nullable="true" remarks="Foreign key to customer" size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_contract_cancellation_customer_id__erp_v2_dim_customer_customer_id_fkey_6b34f21d3ca5" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="contract_cancellation_property_id" nullable="true" remarks="Foreign key to contract cancellation property" size="256" type="varchar" typeCode="12">
            <parent catalog="enterprise_4e" column="contract_cancellation_property_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_contract_cancellation_property"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="rate_id" nullable="true" remarks="The tariff of the contract generating an income" size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_id" foreignKey="erp_v2_fct_contract_cancellation_rate_id__erp_v2_dim_rate_rate_id_fkey_58640f8358c5" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="13" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="contract_cancellation_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="fct_contract_price_history" remarks="The new price and price change information whenever the price of a contract is adjusted. The current_price of a contract can be built with condition `valid_from_date &gt;= CURRENT_DATE &lt; valid_to_date`" schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="contract_price_history_id" nullable="false" remarks="The primary key of this table. System column calculated by the source System." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="contract_id" nullable="true" remarks="The contract the price change is about." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="contract_id" foreignKey="erp_v2_fct_contract_price_history_contract_id__erp_v2_fct_contract_contract_id_fkey_7ec3efc38ad2" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="customer_id" nullable="true" remarks="The customer the contract and price change belong to." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_contract_price_history_customer_id__erp_v2_dim_customer_customer_id_fkey_b2ed05f46d44" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="organization_unit_id" nullable="true" remarks="The studio the customer and price change belong to." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_contract_price_history_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_6f07537a3a43" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="2" id="4" name="price" nullable="true" remarks="The absolute new price charged for the contract (in frequency of the related dim_contract_payment_frequency). This price combine values paid by customer and optional part covered by company." size="23" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="valid_from_date" nullable="true" remarks="The date from when the `price` becomes valid, inclusive." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="valid_to_date" nullable="true" remarks="The date until which the `price` is valid for, exclusive. Price changes with no expiration date will be set to `valid_to_date=2199-01-01`." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="is_final" nullable="true" remarks="Whether the price is the final price of the day, the customer will be charged for. Only relevant if there are multiple price changes on the same day." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="order_index" nullable="true" remarks="The order at which price changes are applied, starting from 0. If there are multiple price changes per day, the order of application can be determined by this column." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="9" name="price_change" nullable="true" remarks="The percentage or absolute change of the previous price compared to this one. Or NULL if the price was statically set to a new value. Depending on `charge_adjustment_type`." size="23" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="charge_adjustment_type" nullable="true" remarks="#### The way how a new price is calculated using the defined price change. One of: &#10;* BASIC_AMOUNT: The price is set to a new absolute value, `price_change=NULL`.&#10;* RELATIVE: The price is set to the previous price multiplied by the `price_change` as a percentage.&#10;* ABSOLUTE: The price is set to the previous price plus the `price_change`." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="declaration_type" nullable="true" remarks="#### Using what rules a price change was declared. One of: &#10;* INITIAL: Not a price change but the original price of a contract.&#10;* DYNAMIC_ADJUSTMENT: A price changing rule set in the System came into effect.&#10;* EXPIRED: The expiration of a dynamic adjustment restoring the previous price.&#10;* EXTENSION_TERM: The term of the contract was extended with a new price.&#10;* AGE_BASED_ADJUSTMENT: The customer reached an age falling into a new price group." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="dynamic_adjustment_origin" nullable="true" remarks="#### The origin of the dynamic adjustment that caused the price change. One of: &#10;* INITIAL: Not an adjustment but the original contract price.&#10;* IMPORTED: Price Adjustment was imported from another system.&#10;* UNKNOWN: Not a dynamic adjustment.&#10;* BULK_OPERATION: The price change was part of a bulk operation set by a user.&#10;* MANUAL: The price change was individually set by a user.&#10;* DISCOUNT_VOUCHER: The price change was caused by a discount voucher. Either to a customer or to a company. (Legacy for values before 2024-09-20).&#10;* B2B_DISCOUNT_VOUCHER: The price change was caused by a discount voucher given to a company.&#10;* B2C_DISCOUNT_VOUCHER: The price change was caused by a discount voucher given to a customer.&#10;* RATE: The price change was executed on rate-level.&#10;* CONTRACT_OFFER: The price change was part of a contract offer." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="13" name="customer_price" nullable="true" remarks="The part of the price that customer will be charged for (in frequency of the related dim_contract_payment_frequency). There could be another part of the price, that would be paid by company that client is part of." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="14" name="customer_price_change" nullable="true" remarks="The percentage or absolute change of the previous customer_price compared to this one. Or NULL if the price was statically set to a new value)" size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="15" name="company_price" nullable="true" remarks="The part of the price that company connected to customer will be charged for (in frequency of the related dim_contract_payment_frequency). There could be another part of the price, that would be paid by the customer" size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="16" name="company_price_change" nullable="true" remarks="The percentage or absolute change of the previous company_price compared to this one. Or NULL if the price was statically set to a new value)" size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="18" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="contract_price_history_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="fct_contract_term_dates" remarks="Each individual contract term of a customer." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="contract_term_id" nullable="false" remarks="The primary key of this table. System column calculated by the source System." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="contract_id" nullable="true" remarks="Contract connected to this term" size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="contract_id" foreignKey="erp_v2_fct_contract_term_dates_contract_id__erp_v2_fct_contract_contract_id_fkey_212b7c43ac65" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="customer_id" nullable="true" remarks="Customer that holds this contract" size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_contract_term_dates_customer_id__erp_v2_dim_customer_customer_id_fkey_62bfcf6248f3" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="organization_unit_id" nullable="true" remarks="The gym (organization_unit) for which contract was generated." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_contract_term_dates_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_e13a283163ac" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="start_date" nullable="true" remarks="The date at which this contract term started." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="end_date" nullable="true" remarks="The date at which this contract term ended." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="7" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="contract_term_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="fct_contract_voucher" remarks="A voucher code that can be applied to a contract to get a discount or credit. Only includes vouchers that have been redeemed or withdrawn. Represents the actual usage of a voucher." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="contract_voucher_id" nullable="false" remarks="The primary key of this table. System column calculated by the source system." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="contract_voucher_id" foreignKey="erp_v2_dim_contract_voucher_rate_discount_period_contract_voucher_id__erp_v2_fct_contract_voucher_contract_vou_e703b72da57c" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_contract_voucher_rate_discount_period"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="contract_id" nullable="true" remarks="The contract this voucher is applied to. Null if the voucher was withdrawn before it could be redeemed." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="contract_id" foreignKey="erp_v2_fct_contract_voucher_contract_id__erp_v2_fct_contract_contract_id_fkey_ba952ea0cd6e" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="contract_voucher_definition_id" nullable="true" remarks="The voucher definition this voucher was generated from." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="contract_voucher_definition_id" foreignKey="erp_v2_fct_contract_voucher_contract_voucher_definition_id__erp_v2_dim_contract_voucher_definition_contract_vo_0c28e7e59b34" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_contract_voucher_definition"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="company_id" nullable="true" remarks="The partner company this voucher is associated with." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="company_id" foreignKey="erp_v2_fct_contract_voucher_company_id__erp_v2_dim_company_company_id_fkey_9ee647363011" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_company"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="campaign_id" nullable="true" remarks="The campaign this voucher is associated with." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="campaign_id" foreignKey="erp_v2_fct_contract_voucher_campaign_id__erp_v2_dim_campaign_campaign_id_fkey_00f5f09da640" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_campaign"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="6" id="5" name="redemption_date" nullable="true" remarks="Date when the voucher was redeemed and applied to a contract." size="29" type="timestamp" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="6" name="withdrawn_date" nullable="true" remarks="Date when the voucher was withdrawn/cancelled. Withdrawn vouchers are no longer valid." size="29" type="timestamp" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="7" name="effective_start_date" nullable="true" remarks="Start date when the voucher benefits become effective." size="29" type="timestamp" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="8" name="effective_end_date" nullable="true" remarks="End date when the voucher benefits are no longer effective." size="29" type="timestamp" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="voucher_code" nullable="true" remarks="The unique code of this voucher." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="voucher_number" nullable="true" remarks="A human readable key assigned to this voucher." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="is_reversed" nullable="true" remarks="Whether this voucher has been reversed, nullifying its effects." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="archived" nullable="true" remarks="Whether this voucher has been permanently removed but kept for historic relations." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="contract_voucher_type" nullable="true" remarks="#### The type of benefit this voucher provides.&#10;One of:&#10;* CREDIT: Fixed amount credit applied to the customer's account.&#10;* DISCOUNT: Discount applied to the contract.&#10;* CONTRACT: Voucher tied to a specific contract that is free of charge.&#10;* COMPANY_FEE_SPLIT: Partner company pays part of the fee." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="14" name="credit_amount" nullable="true" remarks="The credit amount provided by this voucher, if type is CREDIT." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="legacy_discount_type" nullable="true" remarks="The type of discount: ABSOLUTE or PERCENTAGE. Note: This field is deprecated, use dim_contract_voucher_rate_discount_period instead." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="16" name="legacy_discount_absolute_amount" nullable="true" remarks="The absolute discount amount if discount_type is ABSOLUTE. Note: This field is deprecated, use dim_contract_voucher_rate_discount_period instead." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="17" name="legacy_discount_percentage" nullable="true" remarks="The percentage discount if discount_type is PERCENTAGE. Note: This field is deprecated, use dim_contract_voucher_rate_discount_period instead." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="18" name="company_fee_split_type" nullable="true" remarks="The type of company fee split: ABSOLUTE or PERCENTAGE." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="19" name="company_fee_split_absolute_amount" nullable="true" remarks="The absolute amount the company pays if company_fee_split_type is ABSOLUTE." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="20" name="company_fee_split_percentage" nullable="true" remarks="The percentage the company pays if company_fee_split_type is PERCENTAGE." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="21" name="applies_to_starter_package" nullable="true" remarks="Whether the voucher definition applies to the starter package. Derived from the voucher definition associated with this voucher." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="22" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="23" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="contract_voucher_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="fct_customer_appointment" remarks="An appointment (class, trial session or personal training) by the customer(s) taking part in it. Note: There can be multiple customers per appointment, leading to multiple entries of the same `appointment_id`." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="customer_appointment_id" nullable="false" remarks="The primary key of this table. System column calculated by the source System." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="organization_unit_id" nullable="true" remarks="The studio where the appointment takes place." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_customer_appointment_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_0b29e6e45a12" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="appointment_id" nullable="true" remarks="The unique appointment in the calendar. With useful information about it, eg. its `status`." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="appointment_id" foreignKey="erp_v2_fct_customer_appointment_appointment_id__erp_v2_dim_appointment_appointment_id_fkey_24da8b99b36c" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_appointment"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="customer_id" nullable="true" remarks="The customer who participates in this appointment." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_customer_appointment_customer_id__erp_v2_dim_customer_customer_id_fkey_7869556c7673" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="service_id" nullable="true" remarks="The pre-defined service this appointment is about, e.g., class, single appointment with a trainer, trial session, or null if no service was assigned." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="service_id" foreignKey="erp_v2_fct_customer_appointment_service_id__erp_v2_dim_service_service_id_fkey_615003f02b3b" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_service"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="start_date" nullable="true" remarks="The date when the appointment starts." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="end_date" nullable="true" remarks="The date when the appointment ends." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="7" name="start_date_time" nullable="true" remarks="The local timestamp at which the appointment starts." size="29" type="timestamp" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="8" name="end_date_time" nullable="true" remarks="The local timestamp at which the appointment ends." size="29" type="timestamp" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="booking_status" nullable="true" remarks="The stage of the booking:&#10;* BOOKED: Customer had contingent and successfully booked the appointment&#10;* CANCELED: Customer booked before but canceled it afterwards&#10;* WAITING_LIST: Customer had contingent but the appointment's max_participants were already reached. If someone cancels, they will be able to book again." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="participant_status" nullable="true" remarks="The reported status of the customer's physical presence:&#10;* PARTICIPATING: The customer was reported to be present at the appointment&#10;* NOT_PARTICIPATING: The customer was reported to be not present at the appointment&#10;* UNSET: Nothing was reported back about the physical presence of the customer at the appointment" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="booking_source" nullable="true" remarks="Through which system this appointment was booked:&#10;* WEBCLIENT: Appointment booked on Systems Website by employee.&#10;* CONNECT_API: Appointment booked via the Systems public API (e.g. tenant website)&#10;* OPEN_API: Appointment booked via Partner Integration.&#10;* PUBLIC_API_LEGACY: Appointment booked via a deprecated API (e.g. tenant website)&#10;* MYSPORTS: Appointment booked via Mysports/Branded App or mysports.com&#10;* TOUCHPOINT: Appointment booked via Touchpoint, a self service solution enabling members to book additional modules via touch screen in the studio.&#10;* ONLINE_CHECKOUT_PAGE: Appointment booked via Studio Pages feature (See Settings &gt; Websites &gt; Studio pages)&#10;* DEVICE: Appointment booked via physical device in the studio, that is able to register customers. e.g. a Turnstile." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="contingent_type" nullable="true" remarks="What type of contingent was used to book this appointment. Is `FREE` when no contingent needed to be used and the booking did not incur any costs to the customer." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="purchased_contingent_id" nullable="true" remarks="The purchased contingent which was used for booking. If NULL purchased contingent was not used to book the appointment." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="purchased_contingent_id" foreignKey="erp_v2_fct_customer_appointment_purchased_contingent_id__erp_v2_dim_purchased_contingent_purchased_contingent__753134259bc0" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_purchased_contingent"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="inclusive_contingent_id" nullable="true" remarks="The inclusive contingent which was used for booking. If NULL inclusive contingent was not used to book the appointment." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="inclusive_contingent_id" foreignKey="erp_v2_fct_customer_appointment_inclusive_contingent_id__erp_v2_dim_inclusive_contingent_inclusive_contingent__20a646d281e0" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_inclusive_contingent"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="16" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="customer_appointment_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="fct_customer_referral" remarks="Tracks customer referrals showing which customers recruited new members. Includes both automatically accepted referrals and those requiring manual review through referral proposals. Used for analyzing referral program effectiveness, premium redemption patterns, and relationship-based growth." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="customer_referral_id" nullable="false" remarks="Primary key - unique identifier for each customer referral record." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="referring_customer_id" nullable="true" remarks="The customer who made the referral and may receive rewards." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_customer_referral_referring_customer_id__erp_v2_dim_customer_customer_id_fkey_9ed5c601064c" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="referred_customer_id" nullable="true" remarks="The new customer who was referred and may receive welcome rewards." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_customer_referral_referred_customer_id__erp_v2_dim_customer_customer_id_fkey_10688aacefae" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="is_premium_redeemed" nullable="true" remarks="Indicates whether any premium reward has been redeemed by either the referring or referred customer." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="relationship" nullable="true" remarks="How the referring customer knows the referred customer." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="source_event" nullable="true" remarks="The business event that triggered this referral reward eligibility." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="waiting_period_days" nullable="true" remarks="Number of days the referred customer must remain active before rewards can be redeemed." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="7" name="referral_created_date" nullable="true" remarks="Date and time when the referral was recorded, localized to the referring customer's home studio timezone." size="29" type="timestamp" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="8" name="waiting_period_end_date" nullable="true" remarks="Date when the waiting period ends and rewards become redeemable, localized to the referring customer's home studio timezone." size="29" type="timestamp" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="referral_status" nullable="true" remarks="Approval status for referrals. AUTO_ACCEPTED indicates no manual review was needed, other values indicate the proposal went through manual review process." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="manual_referral_source" nullable="true" remarks="Where the manually reviewed referral proposal originated from. Only populated for referrals that went through the manual review process." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="manual_rejected_reason" nullable="true" remarks="Customer-facing explanation for why a referral proposal was rejected." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="manual_internal_rejected_reason" nullable="true" remarks="Internal notes about why a referral proposal was rejected, not visible to customers." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="14" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="customer_referral_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="fct_customer_studio_history" remarks="Tracks the history of customers' associations with studios over time, including start and end dates of these relationships." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="customer_studio_history_id" nullable="false" remarks="The primary key of this table." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="customer_id" nullable="true" remarks="The customer who has a relationship with the studio." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_customer_studio_history_customer_id__erp_v2_dim_customer_customer_id_fkey_87a3526d7c02" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="organization_unit_id" nullable="true" remarks="The studio (organization unit) that the customer is associated with." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_customer_studio_history_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fke_04abcb7d4338" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="start_date" nullable="true" remarks="The date when the customer's relationship with this studio began." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="end_date" nullable="true" remarks="The date when the customer's relationship with this studio ended. NULL indicates the relationship is still active." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="archived" nullable="true" remarks="Whether this studio history entry has been archived." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="7" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="customer_studio_history_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="fct_dunning_step" remarks="Fact table for dunning steps recorded by the Magicline dunning engine.&#10;Each row represents one dunning action for a customer, whether triggered&#10;automatically by a scheduled dunning run or manually by studio staff.&#10;&#10;A customer may have multiple rows over time. No deduplication is applied —&#10;each source row maps to exactly one row here.&#10;&#10;**Collection stop filtering:**&#10;To identify customers with an active dunning-triggered collection stop&#10;as of a reference date:&#10;&#10;```sql&#10;collection_stop IS TRUE&#10;AND dunning_date &lt;= '&lt;ref_date&gt;'&#10;AND (withdrawn_date IS NULL OR withdrawn_date::date &gt; '&lt;ref_date&gt;')&#10;```&#10;&#10;For the current (live) state only:&#10;&#10;```sql&#10;collection_stop IS TRUE AND withdrawn_date IS NULL&#10;```&#10;&#10;**Important:** This table covers only dunning-engine-triggered collection&#10;stops. Manual stops configured by studio operators are stored in&#10;`dim_customer_dunning_configuration` (collection_stop_limit_type).&#10;Combine both sources for a complete collection stop picture." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="dunning_step_id" nullable="false" remarks="Primary key of this table. Uniquely identifies a single dunning step." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="previous_dunning_step_id" foreignKey="erp_v2_fct_dunning_step_previous_dunning_step_id__erp_v2_fct_dunning_step_dunning_step_id_fkey_fb40e3240ab7" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_dunning_step"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="customer_id" nullable="true" remarks="The customer this dunning step applies to." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_dunning_step_customer_id__erp_v2_dim_customer_customer_id_fkey_1879304da46c" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="dunning_level_id" nullable="true" remarks="The dunning level reached at this step. NULL for legacy records or steps without an explicit level. Join to dim_dunning_level for the level's position and type." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="dunning_level_id" foreignKey="erp_v2_fct_dunning_step_dunning_level_id__erp_v2_dim_dunning_level_dunning_level_id_fkey_c44a94e02894" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_dunning_level"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="previous_dunning_step_id" nullable="true" remarks="FK to the preceding dunning step for this customer (self-reference). Forms a chain of dunning steps over time. NULL for the first step in a customer's dunning history." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="dunning_step_id" foreignKey="erp_v2_fct_dunning_step_previous_dunning_step_id__erp_v2_fct_dunning_step_dunning_step_id_fkey_fb40e3240ab7" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_dunning_step"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="dunning_date" nullable="true" remarks="The date the dunning step was executed." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="collection_stop" nullable="true" remarks="Whether payment collection is halted for this customer as a result of this dunning step.&#10;Source NULL values are coalesced to false.&#10;&#10;A stop is active as of a reference date when:&#10;`collection_stop IS TRUE AND dunning_date &lt;= ref_date AND (withdrawn_date IS NULL OR withdrawn_date::date &gt; ref_date)`" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="service_stop" nullable="true" remarks="Whether the customer's access to the studio was locked as a result of this dunning step." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="withdrawn_date" nullable="true" remarks="The timestamp at which this dunning step was withdrawn (resolved, reversed, or superseded).&#10;NULL means the step is still active." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="8" name="amount" nullable="true" remarks="The outstanding amount at the time this dunning step was recorded." size="23" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="origin" nullable="true" remarks="The source that triggered this dunning step.&#10;&#10;#### Values&#10;* `MANUAL_DUNNING` — triggered manually by a studio user&#10;* `DUNNING_RUN` — triggered by a scheduled automated dunning run&#10;* `CHARGE_BACK` — triggered by a payment chargeback&#10;* `DEBT_COLLECTION` — triggered by the debt collection process&#10;* `IMPORT` — imported from an external source" size="50" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="transferred_to_debt_collection_service_provider" nullable="true" remarks="Whether this dunning step resulted in the debt being transferred to an external debt collection service provider." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="extraordinary_contract_cancelation" nullable="true" remarks="Whether this dunning step triggered an extraordinary (out-of-term) contract cancellation." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="contract_rest_maturity" nullable="true" remarks="Whether this dunning step triggered early collection of the remaining contract value (Restfälligkeit). The full outstanding contract amount becomes immediately due." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="contract_cancellation_damage_compensation" nullable="true" remarks="Whether damage compensation was charged as part of a contract cancellation triggered by this dunning step." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="communication_sent_immediately" nullable="true" remarks="Whether the dunning communication (letter, email, or SMS) was dispatched immediately&#10;rather than queued for batched sending. NULL for legacy rows predating this flag.&#10;&#10;A non-NULL value indicates that a dunning communication was configured for this step.&#10;`true` = sent immediately; `false` = queued for batch dispatch." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="undo_contract_cancelation_when_debt_claims_paid" nullable="true" remarks="Whether the extraordinary contract cancellation triggered by this dunning step should be automatically reversed once all outstanding debt claims are settled." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="17" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="dunning_step_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="fct_employee_access" remarks="Role based access control information showing which employee has access to which organization unit (studio) through which role. This table represents the access permissions configured in the ERP system." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="employee_access_id" nullable="false" remarks="The primary key of this table." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="organization_unit_id" nullable="true" remarks="The gym (organization_unit) to which the employee has access." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_employee_access_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_04e45decc79f" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="employee_id" nullable="true" remarks="The employee who has access to the organization unit." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="employee_id" foreignKey="erp_v2_fct_employee_access_employee_id__erp_v2_dim_employee_employee_id_fkey_fa344728f5ff" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_employee"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="role_name" nullable="true" remarks="The name of the role granted to the employee for this organization unit." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="4" name="access_created_at" nullable="true" remarks="The timestamp when the access permission was created." size="29" type="timestamp" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="6" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="employee_access_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="fct_idle_period" remarks="A timeframe in which a customer does not have to pay for their contract(s). Includes member idle periods, contract idle periods, trial periods, and bonus periods." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="idle_period_id" nullable="false" remarks="The primary key of this table. System column calculated by the source System." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="shared_contract_idle_period_id" foreignKey="erp_v2_fct_idle_period_shared_contract_idle_period_id__erp_v2_fct_idle_period_idle_period_id_fkey_42fe563cf0ca" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_idle_period"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="organization_unit_id" nullable="true" remarks="The gym (organization_unit) in which the customer went idle." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_idle_period_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_e20167bbb9db" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="customer_id" nullable="true" remarks="The person who went idle." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_idle_period_customer_id__erp_v2_dim_customer_customer_id_fkey_f8f5fa2aadee" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="rate_id" nullable="true" remarks="The rate of the (main) contract which is on idle, if this idle_period is about a specific contract." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_id" foreignKey="erp_v2_fct_idle_period_rate_id__erp_v2_dim_rate_rate_id_fkey_bce65a5cca84" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="contract_id" nullable="true" remarks="The (main) contract which is on idle, if this idle_period is about a specific contract." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="contract_id" foreignKey="erp_v2_fct_idle_period_contract_id__erp_v2_fct_contract_contract_id_fkey_310391a1376b" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="idle_period_property_id" nullable="true" remarks="Additional values describing this idle period." size="256" type="varchar" typeCode="12">
            <parent catalog="enterprise_4e" column="idle_period_property_id" foreignKey="erp_v2_fct_idle_period_idle_period_property_id__erp_v2_dim_idle_period_property_idle_period_property_id_fkey_1532dc02200b" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_idle_period_property"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="start_date_id" nullable="true" remarks="The first date at which the idle period is valid." size="10" type="int4" typeCode="4">
            <parent catalog="enterprise_4e" column="date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_date"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="end_date_id" nullable="true" remarks="The last date at which the idle period is valid." size="10" type="int4" typeCode="4">
            <parent catalog="enterprise_4e" column="date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_date"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="2" id="8" name="charge_amount" nullable="true" remarks="The fee charged for this period, instead of the usual contract fee." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="currency_id" nullable="true" remarks="The system of money in which the charge amount is denominated." size="256" type="varchar" typeCode="12">
            <parent catalog="enterprise_4e" column="currency_id" foreignKey="erp_v2_fct_idle_period_currency_id__erp_v2_dim_currency_currency_id_fkey_331a01d0c42d" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_currency"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="idle_period_fee_calculation_type" nullable="true" remarks="Determines how the fee for the idle period is calculated.&#10;&#10;#### Values&#10;* `NONE` — no fee charged&#10;* `ABSOLUTE` — a fixed amount is charged&#10;* `RELATIVE` — a percentage of the regular contract rate is charged (only valid for contract idle periods)&#10;* `TERM_BASED` — a per-sub-term fee applies, enabling recurring billing" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="11" name="idle_period_fee_calculation_percentage" nullable="true" remarks="The percentage of the regular contract rate charged during the idle period. Only populated when idle_period_fee_calculation_type is RELATIVE." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="12" name="idle_period_fee_calculation_amount" nullable="true" remarks="The fixed monetary amount charged for the idle period. Only populated when idle_period_fee_calculation_type is ABSOLUTE." size="23" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="idle_period_fee_calculation_term_unit" nullable="true" remarks="The time unit of each billing sub-term when the fee calculation is term-based. Only populated when idle_period_fee_calculation_type is TERM_BASED.&#10;&#10;#### Values&#10;* `DAY` — each sub-term is one or more days&#10;* `WEEK` — each sub-term is one or more weeks&#10;* `MONTH` — each sub-term is one or more months&#10;* `YEAR` — each sub-term is one or more years" size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="idle_period_fee_calculation_term_value" nullable="true" remarks="The numeric duration of each billing sub-term when the fee calculation is term-based. Only populated when idle_period_fee_calculation_type is TERM_BASED." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="unlimited" nullable="true" remarks="Indicates whether the idle period is open-ended with no fixed end date." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="recurring_idle_period_charges" nullable="true" remarks="Indicates whether the fee is charged repeatedly for each sub-term throughout the idle period. Only relevant when idle_period_fee_calculation_type is TERM_BASED." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="shared_contract_idle_period_id" nullable="true" remarks="Reference to the parent idle period that controls this sub-contract idle period. When set, this record is a module sub-contract freeze linked to and controlled by a main contract freeze." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="idle_period_id" foreignKey="erp_v2_fct_idle_period_shared_contract_idle_period_id__erp_v2_fct_idle_period_idle_period_id_fkey_42fe563cf0ca" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_idle_period"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="18" name="used_free_terms_in_days" nullable="true" remarks="The number of free (no-charge) days already consumed from the idle period configuration allowance at the time this idle period was created." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="19" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="20" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="idle_period_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="fct_invoice" remarks="Invoice fact table. Each row represents one invoice position, enriched with contract and company data. Covers regular invoice runs, MySports receipts, and imported invoices." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="invoice_id" nullable="false" remarks="Primary key of this table. Unique identifier of the invoice position (position-level grain, not invoice-level)." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="invoice_id" foreignKey="erp_v2_fct_revenue_invoice_based_invoice_id__erp_v2_fct_invoice_invoice_id_fkey_316170475d2a" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_revenue_invoice_based"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="invoice_entity_id" nullable="true" remarks="Technical identifier of the invoice this position belongs to" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="invoice_number" nullable="true" remarks="Human-readable invoice reference number shown on the invoice document. Null for some imported invoices." size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="invoice_created_date" nullable="true" remarks="Timestamp when the invoice record was created in the system" size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="invoice_date" nullable="true" remarks="Date on which the invoice was formally issued. Null for MySports receipts and some imported invoices." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="invoice_status" nullable="true" remarks="Current lifecycle status of the invoice.&#10;* DRAFT: Invoice is a draft — not yet finalized; can be deleted but not yet sent.&#10;* CREATED: Invoice finalized but not yet sent to recipient.&#10;* SENT: Invoice has been sent to recipient.&#10;* CANCELLED: Invoice has been cancelled.&#10;* PAID: Invoice has been fully paid. Set for standard invoices upon successful bank transfer processing.&#10;* PARTIALLY_PAID: Invoice has received partial payment. Set for standard invoices when a bank transfer partially covers the outstanding amount." size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="invoice_type_discriminator" nullable="true" remarks="Technical subtype of the invoice, distinguishing automated invoice runs, manual debt claims, MySports receipts, and imported invoices.&#10;* INVOICE_RUN: Standard automated invoice run issued to customer.&#10;* COMPANY: Automated invoice run issued to company (B2B).&#10;* MANUAL_DEBT_CLAIM: Manually created debt claim invoice.&#10;* DIRECT: Direct debt claim invoice with no payment deadline.&#10;* MYSPORTS: MySports online payment receipt.&#10;* MYSPORTS_ACCOUNT_BALANCE: MySports account balance receipt.&#10;* MYSPORTS_CONSUMPTION_CREDIT: MySports consumption credit receipt.&#10;* IMPORTED: Externally imported historical invoice." size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="invoice_type" nullable="true" remarks="Document classification of the invoice.&#10;* INVOICE: Standard outgoing invoice (debit document). Set for invoice runs and manual debt claims.&#10;* REFUND: Credit note / refund invoice. Exclusively on MySports account balance reversal receipts that carry a reference_invoice_id.&#10;* PAYMENT_RECEIPT: Payment receipt document. Set for MySports receipts (MYSPORTS and MYSPORTS_ACCOUNT_BALANCE types)." size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="8" name="invoice_gross_amount" nullable="true" remarks="Total gross amount of the invoice across all positions including tax. Null for some imported invoices." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="currency_id" nullable="true" remarks="Currency in which the invoice amounts are denominated. Null for some imported invoices." size="255" type="varchar" typeCode="12">
            <parent catalog="enterprise_4e" column="currency_id" foreignKey="erp_v2_fct_invoice_currency_id__erp_v2_dim_currency_currency_id_fkey_572bc6bb4efa" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_currency"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="payment_deadline_days" nullable="true" remarks="Number of days from the invoice date by which payment is due. Typically 0 for standard invoices (immediate payment), 30 for manual debt claims. Null for MySports receipts and some imported invoices." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="external_qr_link" nullable="true" remarks="External URL encoded as a QR code on the invoice for electronic invoicing flows. Null when electronic invoicing is not applicable." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="customer_id" nullable="true" remarks="Identifier of the customer who was invoiced. Null for company-only invoices where no individual customer is associated." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_invoice_customer_id__erp_v2_dim_customer_customer_id_fkey_6bae03ba04a1" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="company_id" nullable="true" remarks="Identifier of the company associated with this invoice. Null for individual/non-corporate invoices." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="company_id" foreignKey="erp_v2_fct_invoice_company_id__erp_v2_dim_company_company_id_fkey_744909276350" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_company"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="organization_unit_id" nullable="true" remarks="Identifier of the studio or organization unit that issued the invoice" size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_invoice_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_66c6d57ea319" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="reference_invoice_id" nullable="true" remarks="Identifier of the original invoice that this invoice reverses or refunds. Only set when invoice_type = 'REFUND' (i.e. on MySports account balance reversal receipts). NULL for all other invoice types." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="position_name" nullable="true" remarks="Display name of the line item as shown on the invoice" size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="position_type" nullable="true" remarks="Technical subtype of the invoice position, distinguishing invoice run positions, MySports receipts, and imported positions.&#10;* INVOICE_RUN: Position from automated invoice run.&#10;* MANUAL_DEBT_CLAIM: Position from manual debt claim.&#10;* DIRECT: Position from direct debt claim.&#10;* MYSPORTS: Position for MySports sales.&#10;* MYSPORTS_ACCOUNT_BALANCE: Position for account balance receipt.&#10;* MYSPORTS_CONSUMPTION_CREDIT: Position for consumption credit.&#10;* IMPORTED: Position from imported invoice." size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="18" name="position_status" nullable="true" remarks="Lifecycle status of the invoice position. NULL only for MYSPORTS_ACCOUNT_BALANCE positions. MYSPORTS positions carry status ACTIVE.&#10;* DRAFT: Position is a draft — not yet finalized.&#10;* ACTIVE: Position is active (default state). Applies to INVOICE_RUN, MYSPORTS, and MANUAL_DEBT_CLAIM positions.&#10;* DISCONNECTED: Position has been disconnected from its booking entry.&#10;* CANCELLED: Position has been cancelled." size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="19" name="position_subline" nullable="true" remarks="Secondary description or sub-label shown beneath the main position name on the invoice. Null when no sub-label was specified." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="20" name="position_gross_amount" nullable="true" remarks="Gross amount of this invoice position including tax (net_amount + tax_amount)" size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="21" name="position_net_amount" nullable="true" remarks="Net amount of this invoice position excluding tax" size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="22" name="position_tax_amount" nullable="true" remarks="Tax amount applied to this invoice position" size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="23" name="position_tax_percentage" nullable="true" remarks="Tax rate applied to this invoice position, expressed as a percentage" size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="24" name="position_order" nullable="true" remarks="Display order of this position within the invoice" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="25" name="contract_id" nullable="true" remarks="Identifier of the contract linked to this invoice position. Null when the position has no associated booking entry or the booking entry has no contract (e.g. MySports positions, payment-type booking entries)." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="contract_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="fct_contract"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="26" name="service_period_start_date" nullable="true" remarks="Start date of the service period this invoice position covers. Null when the position has no associated booking entry." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="27" name="service_period_end_date" nullable="true" remarks="End date of the service period this invoice position covers. Null when the position has no associated booking entry." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="28" name="product_id" nullable="true" remarks="Links this invoice position to the product that was sold. Only populated for positions associated with a product sale (physical goods, vouchers, or services purchased individually). Null for membership charges and positions without a linked product." size="255" type="varchar" typeCode="12">
            <parent catalog="enterprise_4e" column="product_id" foreignKey="erp_v2_fct_invoice_product_id__erp_v2_dim_product_product_id_fkey_f56d6e53c597" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_product"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="29" name="rate_id" nullable="true" remarks="Identifier of the rate plan linked to the contract. Null when contract_id is null." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_id" foreignKey="erp_v2_fct_invoice_rate_id__erp_v2_dim_rate_rate_id_fkey_e147c9be7ad9" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="30" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="31" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="invoice_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="fct_lead_lifetime" remarks="One row per customer, tracking their journey from first contact to becoming&#10;a member (or being marked as lost). Every customer has a row — including&#10;prospects who never signed a contract.&#10;&#10;Data comes from two sources (see `lead_source`):&#10;  - `LEAD_MANAGEMENT`: The customer was actively managed in the Lead&#10;    Management section. Start and end dates come from the lead record.&#10;  - `FIRST_CONTRACT_FALLBACK`: The customer was not managed in Lead&#10;    Management. The customer creation date is used as the start and the&#10;    first contract date as the end. A customer with no contract will have&#10;    `lead_status = PENDING` indefinitely.&#10;&#10;Use this table to answer: how many leads converted this month, how long&#10;did conversion take, which campaigns drove the most wins, and which leads&#10;are currently pending." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="lead_lifetime_id" nullable="false" remarks="Primary key of this table. Equals `customer_id` — one row per customer." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="organization_unit_id" nullable="true" remarks="The gym (organization_unit) where the lead was initiated at (locally or online)." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_lead_lifetime_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_88dd817d8549" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="customer_id" nullable="true" remarks="The customer this lead journey belongs to. Every customer has exactly one row." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_lead_lifetime_customer_id__erp_v2_dim_customer_customer_id_fkey_8e5fc9fefb54" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="campaign_id" nullable="true" remarks="The campaign the lead was associated with or `NULL`." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="campaign_id" foreignKey="erp_v2_fct_lead_lifetime_campaign_id__erp_v2_dim_campaign_campaign_id_fkey_791cdefd0cec" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_campaign"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="6" id="4" name="lead_start_date_time" nullable="true" remarks="Local timestamp in studio timezone when the lead process started.&#10;For `FIRST_CONTRACT_FALLBACK` rows this is when the customer record was created." size="29" type="timestamp" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="lead_start_date" nullable="true" remarks="Local date in studio timezone when the lead process started.&#10;For `FIRST_CONTRACT_FALLBACK` rows this is the customer creation date." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="6" name="lead_finish_date_time" nullable="true" remarks="Local timestamp in studio timezone when the lead process ended (win or loss).&#10;For `FIRST_CONTRACT_FALLBACK` rows this is when the first contract was created.&#10;`NULL` for leads still in progress." size="29" type="timestamp" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="lead_finish_date" nullable="true" remarks="Local date in studio timezone when the lead process ended.&#10;For `FIRST_CONTRACT_FALLBACK` rows this is the first contract creation date.&#10;`NULL` for leads still in progress." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="lead_source" nullable="true" remarks="How this row's dates are sourced. One of:&#10;* `LEAD_MANAGEMENT`: The customer was actively managed in Lead Management. Dates come from the lead record.&#10;* `FIRST_CONTRACT_FALLBACK`: The customer was not managed in Lead Management. Dates are derived from the customer creation and first contract records." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="lead_status" nullable="true" remarks="The final status of the lead process. One of:&#10;* `PENDING`: Lead process is still ongoing (no final status yet).&#10;* `WIN`: Lead process was successful, customer signed a contract.&#10;* `LOSS`: Lead process was not successful, only applicable to LEAD_MANAGEMENT sourced leads." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="lead_classification" nullable="true" remarks="The current classification assigned to the lead, such as HOT or COLD. NULL when the lead has not been classified or for fallback rows." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="source_campaign" nullable="true" remarks="DEPRECATED! Use campaign_id. The name of a campaign the lead was associated with. Or `NONE`." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="loss_reason" nullable="true" remarks="The reason picked if the lead was set to `lead_status=LOSS` or `UNKNOWN` if no specific reason is available." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="lead_stage_id" nullable="true" remarks="The current stage the lead is in, as configured in the studio's lead pipeline.&#10;`NULL` for `FIRST_CONTRACT_FALLBACK` rows, which are not managed on a pipeline board." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="lead_stage_id" foreignKey="erp_v2_fct_lead_lifetime_lead_stage_id__erp_v2_dim_lead_stage_lead_stage_id_fkey_38cc29024b18" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_lead_stage"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="first_seen_date" nullable="true" remarks="UTC timestamp when a staff member first opened/viewed this lead. `NULL` if never viewed or not applicable." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="progress_started_date" nullable="true" remarks="UTC timestamp when the first meaningful action was taken on this lead (e.g. moved on the pipeline board, contacted). `NULL` if no action has been taken yet." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="last_contact_date" nullable="true" remarks="UTC timestamp of the most recent contact attempt with this lead. `NULL` if never contacted." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="18" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="lead_lifetime_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="fct_lead_stage_history" remarks="The chronological history of lead stages assigned to leads, including when each stage started and ended.&#10;One row per stage assignment. Sourced from the ERP table `lead_phase_journal_entry`." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="lead_stage_history_id" nullable="false" remarks="The primary key of this lead stage history entry." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="previous_lead_stage_history_id" foreignKey="erp_v2_fct_lead_stage_history_previous_lead_stage_history_id__erp_v2_fct_lead_stage_history_lead_stage_history_81d986e9c6d6" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_lead_stage_history"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="customer_id" nullable="true" remarks="The customer associated with the lead that occupied the stage." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_lead_stage_history_customer_id__erp_v2_dim_customer_customer_id_fkey_4f92f3f5c4c9" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="organization_unit_id" nullable="true" remarks="The studio associated with the lead." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_lead_stage_history_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_2999e5217846" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="lead_stage_id" nullable="true" remarks="The lead stage represented by this history entry." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="lead_stage_id" foreignKey="erp_v2_fct_lead_stage_history_lead_stage_id__erp_v2_dim_lead_stage_lead_stage_id_fkey_9ca022e7a4b5" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_lead_stage"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="status" nullable="true" remarks="The lead status while this stage entry was active." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="stage_start_date_time" nullable="true" remarks="UTC timestamp when the lead entered this stage, as recorded by the ERP." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="stage_end_date_time" nullable="true" remarks="UTC timestamp when the lead entered its next stage, as recorded by the ERP. NULL indicates the lead is currently in this stage." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="previous_lead_stage_history_id" nullable="true" remarks="The preceding stage history entry for this lead, when available." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="lead_stage_history_id" foreignKey="erp_v2_fct_lead_stage_history_previous_lead_stage_history_id__erp_v2_fct_lead_stage_history_lead_stage_history_81d986e9c6d6" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_lead_stage_history"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="loss_reason_id" nullable="true" remarks="The loss reason associated with this stage, when available." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="loss_reason_id" foreignKey="erp_v2_fct_lead_stage_history_loss_reason_id__erp_v2_dim_loss_reason_loss_reason_id_fkey_5fca33474e52" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_loss_reason"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="won_date_time" nullable="true" remarks="UTC timestamp when the lead was marked as won, as recorded by the ERP. NULL if the lead was not won during this stage." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="lost_date_time" nullable="true" remarks="UTC timestamp when the lead was marked as lost, as recorded by the ERP. NULL if the lead was not lost during this stage." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="12" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="lead_stage_history_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="fct_payment" remarks="All payment events across all channels — standard payments, consumption credits, and voucher credits — with payment provider and type classification resolved.&#10;Includes reversals, chargebacks, and payouts. A single payment may produce multiple rows if it maps to different transaction contexts (product_id, payment_method, payment_brand).&#10;Use unallocated_amount &gt; 0 to identify payments whose credit has not been fully applied to a debt claim. Use unallocated_amount = 0 for fully matched payments.&#10;Payment provider and type resolution depends on the booking entry channel:&#10;* For payment-run entries and their chargebacks: provider and type are determined by the&#10;  payment run's configured provider (e.g., FinionPay, FinionCapital, XML, Booking).&#10;* For all other booking entry types: provider and type are determined by the entry's&#10;  channel (e.g., Bank, Cash, POS, Debt Collection Agency)." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="payment_id" nullable="false" remarks="Surrogate primary key for this payment record. Derived from payment_internal_id and is_reversed." size="32" type="varchar" typeCode="12">
            <child catalog="enterprise_4e" column="payment_id" foreignKey="erp_v2_bridge_payment_to_payment_run_payment_id__erp_v2_fct_payment_payment_id_fkey_237755775dad" implied="false" onDeleteCascade="false" schema="erp_v2" table="bridge_payment_to_payment_run"/>
            <child catalog="enterprise_4e" column="payment_id" foreignKey="erp_v2_bridge_payment_to_revenue_payment_id__erp_v2_fct_payment_payment_id_fkey_4b31ff9bbf9f" implied="false" onDeleteCascade="false" schema="erp_v2" table="bridge_payment_to_revenue"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="payment_internal_id" nullable="true" remarks="The booking entry ID in the financial ledger. A single payment_internal_id may appear in multiple rows when the payment maps to different transaction contexts." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="customer_id" nullable="true" remarks="The customer associated with this payment. Available for most payment types where the customer is known. NULL for anonymous POS sales and some imported records." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_payment_customer_id__erp_v2_dim_customer_customer_id_fkey_e319be685fa2" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="organization_unit_id" nullable="true" remarks="The studio (gym) that owns this payment entry. Always populated." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_payment_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_4cd96431adf1" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="company_id" nullable="true" remarks="The corporate (B2B) company associated with this payment, if any. NULL for individual (B2C) customers." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="company_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_company"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="booking_date" nullable="true" remarks="The accounting date of this payment. This is the authoritative date used for financial reporting. Always populated." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="booking_number" nullable="true" remarks="Human-readable booking reference number from the financial ledger entry (e.g., 5000--0008-0000001). NULL for some payment types." size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="7" name="payment_amount" nullable="true" remarks="The gross amount of this payment as recorded in the financial ledger. Positive for incoming payments; negative for reversals and chargebacks." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="8" name="unallocated_amount" nullable="true" remarks="The portion of this payment's credit not yet linked to any debt claim. Zero means the payment is fully matched to revenue. NULL for reversal and chargeback rows." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="currency_id" nullable="true" remarks="ISO 4217 currency code for the payment amount (e.g., EUR, CHF, GBP)." size="3" type="varchar" typeCode="12">
            <parent catalog="enterprise_4e" column="currency_id" foreignKey="erp_v2_fct_payment_currency_id__erp_v2_dim_currency_currency_id_fkey_a06f02bdffbe" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_currency"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="is_reversed" nullable="true" remarks="True if this payment has been reversed by a subsequent entry. Allows filtering out reversed payments without anti-joining against chargeback or reversal rows." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="is_recovered" nullable="true" remarks="True when a chargeback or returned-debit entry affecting this payment is itself reversed, indicating the payment was recovered." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="charged_back_reason" nullable="true" remarks="Free-text bank return reason recorded when a payment is charged back. Populated only for chargeback rows (PAYMENT_RUN_ITEM_CHARGED_BACK, FINION_PAY_CHARGED_BACK). NULL otherwise." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="modification_reason" nullable="true" remarks="Reason text recorded when a payment entry was modified (e.g., manual corrections or adjustments by studio staff). NULL for unmodified entries." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="custom_description" nullable="true" remarks="Free-text description attached to the payment entry by the studio (e.g., notes about the payment purpose or context). NULL when not provided." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="provider_transaction_id" nullable="true" remarks="The transaction reference ID(s) assigned by the payment provider, aggregated per payment. Multiple transaction IDs for the same payment context are concatenated. NULL when no provider reference is available." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="payment_provider" nullable="true" remarks="The payment provider that processed this transaction.&#10;For payment-run entries and their chargebacks: determined by the payment run's configured provider (e.g., FinionPay, FinionCapital, XML, Booking).&#10;For all other booking entry types: determined by the entry's channel (e.g., Bank, Cash, FinionPAY, Debt Collection Agency, Universal).&#10;NULL when no provider could be resolved." size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="payment_type" nullable="true" remarks="The payment type classification.&#10;For payment-run entries and their chargebacks: determined by the payment run's configured provider (e.g., SEPA, Credit Card, LSV, TWINT, BACS).&#10;For all other booking entry types: determined by the entry's channel (e.g., Transfer, Cash, Terminal Payment, Chargeback, Payout).&#10;NULL when no type could be resolved." size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="18" name="payment_brand" nullable="true" remarks="The card scheme or payment brand as reported by the payment provider (e.g., mc for Mastercard, visa, IDEAL). Populated for third-party online payments where the provider reports a card brand. NULL for cash, bank transfer, payment run items, and other non-card channels." size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="19" name="transaction_source" nullable="true" remarks="Identifies the channel or mechanism through which the transaction was processed (e.g., Payment Run, Payment Run Chargeback, Online Payment, POS, POS Debt Claim Payment). Multiple sources for the same payment are comma-separated. NULL when no transaction source could be resolved." size="255" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="20" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="21" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="payment_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="fct_payment_instrument_status_history" remarks="Full history of status changes for customers' standard stored payment methods (credit/debit cards, direct debit, TWINT, PayPal, and similar instruments), including invalidation reasons and bank-reported chargeback details. Used to identify when and why a payment method became unusable so it can be followed up on. This table does not include bank-account-backed direct-debit rows from `dim_payment_instrument`: the separate mandate path has no equivalent status-event history, so those changes cannot be reconstructed here." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="payment_instrument_status_history_id" nullable="false" remarks="The primary key of this table." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="payment_instrument_id" nullable="true" remarks="The payment instrument whose status changed. Always a standard payment instrument id (positive) — bank-account direct-debit rows in `dim_payment_instrument` (negative ids) never appear here, see the table description above." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="payment_instrument_id" foreignKey="erp_v2_fct_payment_instrument_status_history_payment_instrument_id__erp_v2_dim_payment_instrument_payment_inst_c713c4fa9637" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_payment_instrument"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="customer_id" nullable="true" remarks="The customer whose account this payment instrument belongs to. Null in rare cases where the instrument's billing setup could not be linked back to an account." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_payment_instrument_status_history_customer_id__erp_v2_dim_customer_customer_id_fkey_c435bb107490" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="paying_customer_id" nullable="true" remarks="The customer who actually pays for this instrument. Equals `customer_id` for `payment_responsibility_type` `SELF`/`UNKNOWN`; differs from it for `CUSTOMER` (e.g. a parent paying for a child's membership); null for `EXTERNAL` (a non-member payer)." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_payment_instrument_status_history_paying_customer_id__erp_v2_dim_customer_customer_id_fkey_5618b8434946" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="payment_responsibility_type" nullable="true" remarks="#### Who is financially responsible for this instrument. One of:&#10;* `SELF` — The account holder pays for themselves.&#10;* `CUSTOMER` — Another member pays on the account holder's behalf (see `paying_customer_id`).&#10;* `UNKNOWN` — Migrated/imported account; the specific arrangement is not known.&#10;* `EXTERNAL` — A non-member (e.g. a parent or guardian) pays on the account holder's behalf." size="64" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="organization_unit_id" nullable="true" remarks="The studio (organization unit) of the customer who owns the payment instrument whose status changed." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_payment_instrument_status_history_organization_unit_id__erp_v2_dim_organization_unit_organization_u_0950a3274251" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="status" nullable="true" remarks="#### The new status value at this log entry. One of:&#10;* `WAITING_FOR_CONFIRMATION` — Created and awaiting confirmation from the customer/PSP.&#10;* `IMPORTED_WAITING_FOR_PROCESSING` — Imported/migrated and awaiting PSP registration/tokenization following the import.&#10;* `CONFIRMED` — Confirmed and usable for charges.&#10;* `INVALID` — Can no longer be used (bank-rejected, disabled, charged back)." size="64" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="invalid_reason" nullable="true" remarks="#### Populated when `status` is `INVALID`; explains why the instrument was invalidated. One of:&#10;* `RECURRING_TOKEN_DISABLED` — The PSP reported that the recurring token backing this instrument was disabled.&#10;* `CHARGEBACK` — The instrument was invalidated as a result of a chargeback. See `charged_back_reason` for detail." size="64" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="charged_back_reason" nullable="true" remarks="#### Populated when `invalid_reason` is `CHARGEBACK`; the specific chargeback reason reported by the bank/PSP. One of:&#10;* `INSUFFICIENT_COVERING` — Insufficient funds to cover the charge.&#10;* `OPPOSITION` — Customer actively disputed the charge with their bank.&#10;* `INVALID_BANK_INFORMATION` — Bank account details were invalid or incorrect (bank-rejected mandate/account).&#10;* `INVALID_MANDATE` — Direct debit mandate was invalid, expired, or revoked (bank-rejected mandate/account).&#10;* `AUTHORIZATION_DECLINED` — Authorization was declined by the issuing bank.&#10;* `INVALID_CARD` — Credit card number was invalid.&#10;* `CARD_EXPIRED` — Credit card had expired.&#10;* `REVOKED_BY_CUSTOMER` — Customer revoked the authorization.&#10;* `OTHER` — Catch-all for other return reasons." size="64" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="message" nullable="true" remarks="Free-text message with additional detail about this status transition (e.g. provider error message)." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="event_date_time" nullable="true" remarks="The UTC date and time at which this status transition occurred." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="12" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="payment_instrument_status_history_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="fct_payment_run" remarks="This table contains all payment run bookings together with information about the payment run itself. A payment run is a scheduled event where a financial institution attempts to collect money from the customers. It consists of individual payment run bookings, those that are regular, those that failed and those that were already excluded before and therefore technically do not represent actually processed bookings" schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="payment_run_id" nullable="false" remarks="The primary key of this table. System column calculated by the source System." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="organization_unit_id" nullable="true" remarks="The gym (organization_unit) for which the payment run booking was executed" size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_payment_run_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_6234eded60eb" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="created_date" nullable="true" remarks="UTC timestamp when the payment run was created." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="charge_until_date" nullable="true" remarks="Latest due date included in the payment run." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="effective_collection_date_id" nullable="true" remarks="The date at which the amount was actually collected" size="10" type="int4" typeCode="4">
            <parent catalog="enterprise_4e" column="date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_date"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="number" nullable="true" remarks="The payment run number" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="payment_run_property_id" nullable="true" remarks="ID of the payment run property" size="256" type="varchar" typeCode="12">
            <parent catalog="enterprise_4e" column="payment_run_property_id" foreignKey="erp_v2_fct_payment_run_payment_run_property_id__erp_v2_dim_payment_run_property_payment_run_property_id_fkey_c34472c8a249" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_payment_run_property"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="booking_type" nullable="true" remarks="One of: `REGULAR_BOOKING` (amount was collected and can be returned later - see `booking_status`), `FAILED_BOOKING` (amount was tried to be collected and was returned - for the failure reasons see `dim_payment_run_property.reason`), `EXCLUDED_BOOKING` (amount is excluded from collection - for reasons see `dim_payment_run_property` table)" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="booking_number" nullable="true" remarks="The explicit number of the booking within a payment run with the specified number" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="customer_id" nullable="true" remarks="The person related to the booking" size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_payment_run_customer_id__erp_v2_dim_customer_customer_id_fkey_8bd139378cfb" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="2" id="10" name="amount" nullable="true" remarks="The amount tried (see `booking_type`) to be collected from the person" size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="currency_id" nullable="true" remarks="The system of money in which income was generated." size="256" type="varchar" typeCode="12">
            <parent catalog="enterprise_4e" column="currency_id" foreignKey="erp_v2_fct_payment_run_currency_id__erp_v2_dim_currency_currency_id_fkey_3e612dd303a5" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_currency"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="archived" nullable="true" remarks="Permanently removed but kept for historic relations" size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="14" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="payment_run_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="fct_pos_saleposition" remarks="Point-of-sale line items sales. Each row represents one sale position (line item) within a sale transaction (pos_sale_id)." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="pos_saleposition_id" nullable="false" remarks="The primary key of this table. Identifies a single line item within a sale." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="pos_saleposition_id" foreignKey="erp_v2_bridge_pos_saleposition_to_payment_pos_saleposition_id__erp_v2_fct_pos_saleposition_pos_saleposition_id_50c30e724329" implied="false" onDeleteCascade="false" schema="erp_v2" table="bridge_pos_saleposition_to_payment"/>
            <child catalog="enterprise_4e" column="pos_saleposition_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="fct_revenue_invoice_based"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="internal_payment_id" nullable="true" remarks="### DEPRECATED. Use `bridge_pos_saleposition_to_payment` instead, which preserves every active payment split for a sale position. This column collapses that to a single, most-recently created active link and loses granularity when a sale position is settled by more than one payment." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="pos_id" nullable="true" remarks="The parent sale transaction this line item belongs to." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="employee_id" nullable="true" remarks="The employee associated with the sale" size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="employee_id" foreignKey="erp_v2_fct_pos_saleposition_employee_id__erp_v2_dim_employee_employee_id_fkey_8b35542bf6cc" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_employee"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="organization_unit_id" nullable="true" remarks="The location where this sale occurred." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_pos_saleposition_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_e2db3f4dc8ab" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="cash_register_id" nullable="true" remarks="The cash register used for this sale, if applicable." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="cash_register_id" foreignKey="erp_v2_fct_pos_saleposition_cash_register_id__erp_v2_dim_cash_register_cash_register_id_fkey_9dc8c20076bd" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_cash_register"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="sale_type" nullable="true" remarks="The channel through which the sale was initiated.&#10;#### Values&#10;* **CASH_REGISTER** — Standard POS transaction at a physical register&#10;* **DEVICE** — Sale from a connected vending/device&#10;* **MYSPORTS_SALE** — Sale via MySports&#10;* **ONLINE_SALE** — Sale from the online shop / customer portal&#10;* **APPLICATION** — Sale from a third-party application" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="sale_position_type" nullable="true" remarks="The type of product or item sold in this line item.&#10;#### Values&#10;* **STOCK_PRODUCT** — Physical product from inventory&#10;* **ONLINE_OFFER** — Online offer purchase&#10;* **VOUCHER** — Voucher sale&#10;* **CONTRACT_VOUCHER** — Contract-linked voucher&#10;* **CONSUMPTION_CREDIT** — Consumption credit purchase&#10;* **CONSUMPTION_CREDIT_RECHARGE** — Consumption credit recharge&#10;* **DYNAMIC** — Ad-hoc product created during the sale&#10;* **BOTTLE_DEPOSIT** — Bottle deposit charge&#10;* **RETURNED_BOTTLE_DEPOSIT** — Returned bottle deposit refund" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="sales_time" nullable="true" remarks="Timestamp when this sale position was created." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="product_id" nullable="true" remarks="Key identifying the product. Linkable to dim_product." size="256" type="varchar" typeCode="12">
            <parent catalog="enterprise_4e" column="product_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_product"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="2" id="10" name="price" nullable="true" remarks="Unit price of the item before discounts." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="currency_code" nullable="true" remarks="ISO currency code for monetary amounts." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="12" name="tax_percent" nullable="true" remarks="Applicable tax rate as a percentage." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="13" name="discount_amount" nullable="true" remarks="Absolute discount amount applied to this line item." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="14" name="discount_percentage" nullable="true" remarks="Percentage discount applied to this line item." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="15" name="amount" nullable="true" remarks="Final monetary amount for this line item after discounts." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="term_of_validity" nullable="true" remarks="Validity duration value for voucher-type positions." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="term_of_validity_unit" nullable="true" remarks="Unit for the validity duration (e.g. DAY, MONTH, YEAR). Only populated for voucher positions." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="18" name="related_pos_saleposition_id" nullable="true" remarks="Reference to a related sale position, used for bottle deposit linkage." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="19" name="voucher_credit_amount" nullable="true" remarks="Amount paid via voucher credit for this line item." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="20" name="consumption_credit_amount" nullable="true" remarks="Amount paid via consumption credit for this line item." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="21" name="bonus_amount" nullable="true" remarks="Bonus amount applied to consumption credit positions." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="22" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="23" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="pos_saleposition_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="fct_rate_bundle_term_availability" remarks="Fact table listing which organization units can sell each rate bundle term per sales channel." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="rate_bundle_term_availability_id" nullable="false" remarks="The primary key of this table. Surrogate key built from the bundle term, organization unit and sales channel." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="rate_bundle_term_id" nullable="true" remarks="The rate bundle term available in the organization unit." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_bundle_term_id" foreignKey="erp_v2_fct_rate_bundle_term_availability_rate_bundle_term_id__erp_v2_dim_rate_bundle_term_rate_bundle_term_id__63dbe9cd5551" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate_bundle_term"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="organization_unit_id" nullable="true" remarks="The organization unit (gym) where the bundle term is available." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_rate_bundle_term_availability_organization_unit_id__erp_v2_dim_organization_unit_organization_unit__3321960f897f" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="sales_channel" nullable="true" remarks="The sales channel through which the bundle term is available. Indicates how the rate bundle can be sold." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="is_active" nullable="true" remarks="Whether the bundle term is active for the organization unit and sales channel based on the active rate bundle group configuration." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="6" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="rate_bundle_term_availability_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="fct_rate_term_payment_frequency_price" remarks="Reporting-ready term payment frequency prices with a default organization unit row, age bands (defaulting to 0-199), and optional term or month-day windows. final_price already applies organization unit and age adjustments.&#10;&#10;Each row represents a static base price for a given combination of payment frequency, organization unit, age band, and validity window. For dynamic modifications that alter the charge after specific trigger events (calendar date, contract extension, recurring interval, or limited period), see fct_rate_term_payment_frequency_price_adjustment, which shares the same rate_term_payment_frequency_id key." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="rate_term_payment_frequency_price_id" nullable="false" remarks="The primary key of this table. Surrogate key built from the rate term payment frequency dimensions." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="rate_term_payment_frequency_id" nullable="true" remarks="The payment frequency configuration the price belongs to." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_term_payment_frequency_id" foreignKey="erp_v2_fct_rate_term_payment_frequency_price_rate_term_payment_frequency_id__erp_v2_dim_rate_term_payment_freq_54f1456d7341" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate_term_payment_frequency"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="rate_term_configuration_id" nullable="true" remarks="The rate term configuration that owns the payment frequency." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_term_configuration_id" foreignKey="erp_v2_fct_rate_term_payment_frequency_price_rate_term_configuration_id__erp_v2_dim_rate_term_configuration_ra_1d03f4728b27" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate_term_configuration"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="rate_id" nullable="true" remarks="The rate (tariff) for which this price applies." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_id" foreignKey="erp_v2_fct_rate_term_payment_frequency_price_rate_id__erp_v2_dim_rate_rate_id_fkey_d81de4569261" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="organization_unit_id" nullable="true" remarks="The organization unit (gym) where the price applies. Null means the default price across all gyms." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_rate_term_payment_frequency_price_organization_unit_id__erp_v2_dim_organization_unit_organization_u_4c25ab6b3d1a" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="min_age" nullable="true" remarks="Minimum age (in years) for the price band. Defaults to 0 when no age band is configured." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="max_age" nullable="true" remarks="Maximum age (in years) for the price band. Defaults to 199 when no age band is configured." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="valid_from_calendar_day" nullable="true" remarks="Start date of the month-day pricing window. Stored on the year 2000 calendar to represent month/day; null when not month-day based." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="valid_to_calendar_day" nullable="true" remarks="End date of the month-day pricing window. Stored on the year 2000/2001 calendar for wraparound; null when not month-day based." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="valid_from_offset_value" nullable="true" remarks="Number of time units after the contract start when a term-based price begins." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="valid_from_offset_unit" nullable="true" remarks="Time unit used for the term-based offset value." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="valid_to_offset_days" nullable="true" remarks="Last day (inclusive) when the term-based price applies, counted in days from contract start. Null means no end date." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="is_archived" nullable="true" remarks="Indicates whether the rate term payment frequency for this price row has been archived." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="13" name="age_adjustment_price" nullable="true" remarks="Absolute price set for the age band when the adjustment type is ABSOLUTE." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="14" name="age_adjustment_discount" nullable="true" remarks="Percentage discount for the age band when the adjustment type is PERCENTAGE, defaulting to 0 when none applies." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="15" name="final_price" nullable="true" remarks="The computed price after organization unit and age adjustments." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="17" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="rate_term_payment_frequency_price_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="fct_rate_term_payment_frequency_price_adjustment" remarks="Dynamic price adjustment rules configured on a rate term payment frequency. Each row represents one rule that modifies the membership fee under specific conditions (a calendar date, a contract extension, a recurring interval, or a limited period). Rules define the adjustment type and value relative to the base price of the payment frequency; they are not pre-resolved to a final charge." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="rate_term_payment_frequency_price_adjustment_id" nullable="false" remarks="The primary key of this table. System-generated identifier of the dynamic adjustment rule." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="rate_term_payment_frequency_id" nullable="true" remarks="The recurring payment frequency this adjustment rule is attached to." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_term_payment_frequency_id" foreignKey="erp_v2_fct_rate_term_payment_frequency_price_adjustment_rate_term_payment_frequency_id__erp_v2_dim_rate_term_p_f114d3930fb7" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate_term_payment_frequency"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="rate_term_configuration_id" nullable="true" remarks="The rate term configuration that owns the payment frequency." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_term_configuration_id" foreignKey="erp_v2_fct_rate_term_payment_frequency_price_adjustment_rate_term_configuration_id__erp_v2_dim_rate_term_confi_f1a2952e2290" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate_term_configuration"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="rate_id" nullable="true" remarks="The rate (tariff) for which this adjustment rule applies." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_id" foreignKey="erp_v2_fct_rate_term_payment_frequency_price_adjustment_rate_id__erp_v2_dim_rate_rate_id_fkey_4fa4778e2590" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="rule_type" nullable="true" remarks="The type of trigger that activates this adjustment rule: DATE fires on a recurring calendar date, EXTENSION fires at contract renewal, INTERVAL fires after a fixed duration, PERIOD_LIMITED is active within a configured date range on the contract." size="64" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="repetition" nullable="true" remarks="Whether the rule fires once (ONCE) on the first eligible trigger date, or repeatedly (REPEAT) on every subsequent eligible trigger date." size="32" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="charge_adjustment_type" nullable="true" remarks="How the charge_adjustment_value is applied to the base price: RELATIVE adds or subtracts a percentage (value / 100), ABSOLUTE adds or subtracts a fixed amount, BASIC_AMOUNT overrides the charge entirely with the given value." size="64" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="7" name="charge_adjustment_value" nullable="true" remarks="The magnitude of the price adjustment. Interpreted according to charge_adjustment_type: a percentage for RELATIVE, a fixed currency amount for ABSOLUTE, or the exact override charge for BASIC_AMOUNT. Negative values represent discounts." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="apply_during_paid_period" nullable="true" remarks="Whether this adjustment rule fires even when the payment period has already been paid (true) or is skipped in that case (false)." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="allow_at_contract_start" nullable="true" remarks="Whether the first trigger of this rule may fall on the contract start date itself. When false, the first eligible date is pushed forward by one trigger interval." size="1" type="bool" typeCode="-7"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="month_day" nullable="true" remarks="For DATE rules only: the calendar day (as --MM-DD) on which the rule fires each year. Null for all other rule types." size="7" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="interval_value" nullable="true" remarks="For INTERVAL rules only: the numeric quantity of the interval after which the rule fires. Null for all other rule types." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="interval_unit" nullable="true" remarks="For INTERVAL rules only: the time unit for the interval value." size="16" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="14" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="rate_term_payment_frequency_price_adjustment_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="fct_revenue" remarks="The event of an accrued income (positive/negative) of&#10;contracts, sales and everything else. Nightly updated with entries&#10;of the past day. NOTE: multi-purpose vouchers (de: 'Wertgutscheine') are only&#10;considered once they are used or expired.&#10;&#10;Key use cases via dim_revenue_group:&#10;- Bad debt write-offs: join to dim_revenue_group and filter on sub_group = 'DERECOGNITION'. This represents charges that have been written off.&#10;- Dunning fees: filter on sub_group = 'DUNNING_PENALTY_FEE'. This shows fees charged to customers for late payment, but does NOT indicate which dunning stage a customer is in.&#10;- Membership fees: filter on sub_group = 'MEMBERSHIP_FEE' and join to dim_rate for additional information." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="revenue_id" nullable="false" remarks="Primary key for revenue" size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="revenue_id" foreignKey="erp_v2_bridge_payment_to_revenue_revenue_id__erp_v2_fct_revenue_revenue_id_fkey_cf88bdaea053" implied="false" onDeleteCascade="false" schema="erp_v2" table="bridge_payment_to_revenue"/>
            <child catalog="enterprise_4e" column="revenue_id" foreignKey="erp_v2_bridge_revenue_to_purchased_contingent_revenue_id__erp_v2_fct_revenue_revenue_id_fkey_8725c47a1b69" implied="false" onDeleteCascade="false" schema="erp_v2" table="bridge_revenue_to_purchased_contingent"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="accounting_date_id" nullable="true" remarks="Foreign key to accounting date" size="10" type="int4" typeCode="4">
            <parent catalog="enterprise_4e" column="date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_date"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="organization_unit_id" nullable="true" remarks="Foreign key to organization unit" size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_revenue_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_bab2228f7b9f" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="revenue_group_id" nullable="true" remarks="Foreign key to revenue group" size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="revenue_group_id" foreignKey="erp_v2_fct_revenue_revenue_group_id__erp_v2_dim_revenue_group_revenue_group_id_fkey_9c8d22346f1b" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_revenue_group"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="2" id="4" name="amount" nullable="true" remarks="Revenue amount" size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="5" name="net_amount" nullable="true" remarks="Net revenue amount" size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="currency_id" nullable="true" remarks="Foreign key to currency" size="256" type="varchar" typeCode="12">
            <parent catalog="enterprise_4e" column="currency_id" foreignKey="erp_v2_fct_revenue_currency_id__erp_v2_dim_currency_currency_id_fkey_61503c820a1c" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_currency"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="contract_id" nullable="true" remarks="The contract generating an income. Null if this revenue entry is not about a specific contract (eg a product was sold)." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="contract_id" foreignKey="erp_v2_fct_revenue_contract_id__erp_v2_fct_contract_contract_id_fkey_c41c7b632840" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="customer_id" nullable="true" remarks="Foreign key to customer" size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_revenue_customer_id__erp_v2_dim_customer_customer_id_fkey_813904625cce" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="rate_id" nullable="true" remarks="The tariff of the contract generating an income. Null if this revenue entry is not about a specific contract (eg a product was sold)." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_id" foreignKey="erp_v2_fct_revenue_rate_id__erp_v2_dim_rate_rate_id_fkey_e8c4ce28fc0c" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="product_id" nullable="true" remarks="Foreign key to product" size="256" type="varchar" typeCode="12">
            <parent catalog="enterprise_4e" column="product_id" foreignKey="erp_v2_fct_revenue_product_id__erp_v2_dim_product_product_id_fkey_9ad64d17cb7b" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_product"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="service_period_start_date" nullable="true" remarks="The start date of the service period associated with this revenue&#10;entry, such as the beginning of a billing cycle (eg. start of month)&#10;for a customers main contract. Or null if not associated with a&#10;service period (eg. sale of a product)." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="service_period_end_date" nullable="true" remarks="The end date of the service period associated with this revenue&#10;entry, such as the beginning of a billing cycle (eg. end of month)&#10;for a customers main contract. Or null if not associated with a&#10;service period (eg. sale of a product)." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="description" nullable="true" remarks="Description of revenue" size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="adjustment_type" nullable="true" remarks="##### Adjustment type that changes value of price:&#10;* IDLE_PERIOD -- Adjustment due to period when contract is inactive&#10;* CONTRACT_CANCELLATION-- Adjustment due to cancelation of contract&#10;* CONTRACT_REVERSAL -- Adjustment due to reversal of contract&#10;* CONTRACT_ADJUSTMENT -- Adjustment due to adjustment to contract&#10;* CONTRACT_ADJUSTMENT_CANCELLATION -- Overall reductions&#10;* CONTRACT_REST_MATURITY -- Used for all locked charges when contract gets rest maturity&#10;* BOOKING_ENTRY_REVERSAL-- Reversal of charge that is locked&#10;* BOOKING_ENTRY_REDUCTION -- Reduction of the original charge&#10;* CUSTOM -- Custom adjustment&#10;* CUSTOM_SINGLE_BOOKING_ENTRY -- Discount for single booking entry&#10;* CONSUMPTION_CREDIT_CONVERSION -- Adjustment due to normal credit conversion&#10;* CONSUMPTION_CREDIT_BONUS_CONVERSION --Adjustment due to bonus credit conversion&#10;* CHECKIN_DISCOUNT -- Discount for reaching a certain hours of check-ins for the month&#10;* CHARGED_BACK -- Return of payment&#10;* Null -- No Adjustment" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="credit_account_number" nullable="true" remarks="Account number on the credit side of the accounting posting." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="credit_account_name" nullable="true" remarks="Account name on the credit side of the accounting posting." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="debit_account_number" nullable="true" remarks="Account number on the debit side of the accounting posting." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="18" name="debit_account_name" nullable="true" remarks="Account name on the debit side of the accounting posting." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="19" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="20" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="revenue_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="fct_revenue_cash_based" remarks="This table records actual cash inflows related to revenue,&#10;providing a cash-basis accounting view. It captures when cash&#10;was physically received, including payment method details and&#10;electronic payment transaction information." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="revenue_cash_based_id" nullable="false" remarks="The primary key of this table. System column calculated by the source System." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="payment_revenue_cash_based_id" foreignKey="erp_v2_bridge_payment_to_revenue_payment_revenue_cash_based_id__erp_v2_fct_revenue_cash_based_revenue_cash_bas_0d2b3c544987" implied="false" onDeleteCascade="false" schema="erp_v2" table="bridge_payment_to_revenue"/>
            <child catalog="enterprise_4e" column="revenue_cash_based_id" foreignKey="erp_v2_bridge_payment_to_revenue_revenue_cash_based_id__erp_v2_fct_revenue_cash_based_revenue_cash_based_id_fk_4643f1995d21" implied="false" onDeleteCascade="false" schema="erp_v2" table="bridge_payment_to_revenue"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="payment_internal_id" nullable="true" remarks="The ID of the booking entry that settled this revenue line. For cash payments this equals fct_payment.payment_internal_id and can be used to join the two tables. For non-cash settlements (e.g. balance credit adjustments) the ID will not appear in fct_payment. To relate cash-based revenue to its originating payment, start from fct_revenue_cash_based and LEFT JOIN fct_payment ON fct_revenue_cash_based.payment_internal_id = fct_payment.payment_internal_id. To identify cash-based revenue rows with no matched payment, filter on WHERE fct_payment.payment_internal_id IS NULL." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="organization_unit_id" nullable="true" remarks="The gym (organization_unit) associated with this revenue." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_revenue_cash_based_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_4e9b78b78e53" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="payment_provider_transaction_id" nullable="true" remarks="External payment provider transaction ID from electronic payment systems like Stripe or Adyen (e.g. TXN12345)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="payment_transaction_type" nullable="true" remarks="Type of electronic payment transaction (e.g., SALE, REFUND)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="payment_transaction_brand" nullable="true" remarks="Payment brand/method for electronic transactions (e.g. visa, mc)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="customer_id" nullable="true" remarks="The customer who made the payment." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_revenue_cash_based_customer_id__erp_v2_dim_customer_customer_id_fkey_9fcfa77af3ae" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="payment_description" nullable="true" remarks="Description of the payment accounting entry." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="revenue_description" nullable="true" remarks="Description of the revenue accounting entry." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="accounting_date" nullable="true" remarks="The date when the payment was linked/unlinked to a debt." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="payment_date" nullable="true" remarks="The date when the payment was actually made." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="payment_method" nullable="true" remarks="Payment method (DIRECT_DEBIT, BANK_TRANSFER, CREDIT_CARD, CASH, etc.)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="third_party_supplier" nullable="true" remarks="Third party payment supplier if applicable." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="payment_account_number" nullable="true" remarks="Account number used for the payment." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="payment_account_name" nullable="true" remarks="Account name used for the payment." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="revenue_account_number" nullable="true" remarks="Revenue account number (contra account)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="revenue_account_name" nullable="true" remarks="Revenue account name (contra account)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="17" name="gross_amount" nullable="true" remarks="The gross amount of the cash movement (studio perspective)." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="18" name="net_amount" nullable="true" remarks="The net amount of the cash movement (studio perspective)." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="19" name="tax_amount" nullable="true" remarks="The tax amount of the cash movement (studio perspective)." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="20" name="tax_percent" nullable="true" remarks="The tax percentage applied." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="21" name="currency_id" nullable="true" remarks="The system of money in which the cash movement occurred." size="256" type="varchar" typeCode="12">
            <parent catalog="enterprise_4e" column="currency_id" foreignKey="erp_v2_fct_revenue_cash_based_currency_id__erp_v2_dim_currency_currency_id_fkey_2b0e240e4321" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_currency"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="22" name="revenue_group_id" nullable="true" remarks="Human readable grouping for accounting_transaction and credit_account_type, categorizing the type of revenue." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="revenue_group_id" foreignKey="erp_v2_fct_revenue_cash_based_revenue_group_id__erp_v2_dim_revenue_group_revenue_group_id_fkey_cb3674ae5b59" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_revenue_group"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="23" name="contract_id" nullable="true" remarks="The contract generating an income. Null if this revenue entry is not about a specific contract (eg a product was sold)." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="contract_id" foreignKey="erp_v2_fct_revenue_cash_based_contract_id__erp_v2_fct_contract_contract_id_fkey_c182b8d8ecd4" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="24" name="service_period_start_date" nullable="true" remarks="The start date of the service period associated with this revenue entry, such as the beginning of a billing cycle (eg. start of month) for a customers main contract. Or null if not associated with a service period (eg. sale of a product)." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="25" name="service_period_end_date" nullable="true" remarks="The end date of the service period associated with this revenue entry, such as the end of a billing cycle (eg. end of month) for a customers main contract. Or null if not associated with a service period (eg. sale of a product)." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="26" name="product_id" nullable="true" remarks="The product which was sold. Null if this revenue entry is not about the sale of a product (eg a contract generated income)." size="256" type="varchar" typeCode="12">
            <parent catalog="enterprise_4e" column="product_id" foreignKey="erp_v2_fct_revenue_cash_based_product_id__erp_v2_dim_product_product_id_fkey_4a6772e67a8c" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_product"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="27" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="28" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="revenue_cash_based_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="fct_revenue_invoice_based" remarks="Invoice-based accrued revenue. Revenue is recorded when postings are emitted by the&#10;invoicing process. Only generated for studios whose&#10;configuration enables INVOICE-based accounting. Use this for invoice-led&#10;revenue reporting and reconciliation against fct_invoice. Includes a&#10;joinable link to POS sale positions via pos_saleposition_id for&#10;POS line-item enrichment. For the standard accrual view use&#10;fct_revenue; for actual cash inflows use fct_revenue_cash_based." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="revenue_invoice_based_id" nullable="false" remarks="Primary key for invoice-based revenue. Identifies a single invoice-based accounting entry." size="19" type="int8" typeCode="-5">
            <child catalog="enterprise_4e" column="revenue_invoice_based_id" foreignKey="erp_v2_bridge_payment_to_revenue_revenue_invoice_based_id__erp_v2_fct_revenue_invoice_based_revenue_invoice_ba_454d87e51545" implied="false" onDeleteCascade="false" schema="erp_v2" table="bridge_payment_to_revenue"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="accounting_date" nullable="true" remarks="The date the invoice-based revenue entry was posted." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="organization_unit_id" nullable="true" remarks="The gym (organization_unit) associated with this revenue entry." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_revenue_invoice_based_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_f1c5bda0cb26" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="revenue_group_id" nullable="true" remarks="Human readable grouping for accounting_transaction and credit_account_type, categorizing the type of revenue." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="revenue_group_id" foreignKey="erp_v2_fct_revenue_invoice_based_revenue_group_id__erp_v2_dim_revenue_group_revenue_group_id_fkey_5faa1ef0796f" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_revenue_group"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="credit_account_number" nullable="true" remarks="Account number of the credit side of the double-entry booking (the revenue account credited)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="credit_account_name" nullable="true" remarks="Account name of the credit side of the double-entry booking (the revenue account credited)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="debit_account_number" nullable="true" remarks="Account number of the debit side of the double-entry booking (the receivable or cash account debited)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="debit_account_name" nullable="true" remarks="Account name of the debit side of the double-entry booking (the receivable or cash account debited)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="8" name="gross_amount" nullable="true" remarks="Gross revenue amount, sign-corrected so that revenue inflows are positive from a studio perspective." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="9" name="net_amount" nullable="true" remarks="Net revenue amount (gross minus tax), sign-corrected from a studio perspective." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="10" name="tax_amount" nullable="true" remarks="Tax portion of the revenue amount, sign-corrected from a studio perspective." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="2" id="11" name="tax_percent" nullable="true" remarks="Tax percentage applied to the revenue entry." size="19" type="numeric" typeCode="2"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="currency_id" nullable="true" remarks="The system of money in which the revenue was booked." size="256" type="varchar" typeCode="12">
            <parent catalog="enterprise_4e" column="currency_id" foreignKey="erp_v2_fct_revenue_invoice_based_currency_id__erp_v2_dim_currency_currency_id_fkey_946272c93489" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_currency"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="customer_id" nullable="true" remarks="The customer associated with this revenue entry. Null for non-customer revenue (e.g. anonymous product sales)." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_revenue_invoice_based_customer_id__erp_v2_dim_customer_customer_id_fkey_324f3c30b638" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="contract_id" nullable="true" remarks="The contract generating an income. Null if this revenue entry is not about a specific contract (eg a product was sold)." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="contract_id" foreignKey="erp_v2_fct_revenue_invoice_based_contract_id__erp_v2_fct_contract_contract_id_fkey_4059737dd498" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_contract"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="rate_id" nullable="true" remarks="The tariff of the contract generating an income. Null if this revenue entry is not about a specific contract (eg a product was sold)." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="rate_id" foreignKey="erp_v2_fct_revenue_invoice_based_rate_id__erp_v2_dim_rate_rate_id_fkey_3aa5475d9fe8" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_rate"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="product_id" nullable="true" remarks="The product associated with this revenue entry. Populated for goods sold via POS sale positions and for contract revenue with a product dimension. Null otherwise." size="256" type="varchar" typeCode="12">
            <parent catalog="enterprise_4e" column="product_id" foreignKey="erp_v2_fct_revenue_invoice_based_product_id__erp_v2_dim_product_product_id_fkey_4a10cc383354" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_product"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="service_period_start_date" nullable="true" remarks="The start date of the service period associated with this revenue entry, such as the beginning of a billing cycle for a customer's main contract. Null if not associated with a service period (e.g. sale of a product)." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="18" name="service_period_end_date" nullable="true" remarks="The end date of the service period associated with this revenue entry, such as the end of a billing cycle for a customer's main contract. Null if not associated with a service period (e.g. sale of a product)." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="19" name="adjustment_type" nullable="true" remarks="##### Adjustment type that changes value of price:&#10;* IDLE_PERIOD -- Adjustment due to period when contract is inactive&#10;* CONTRACT_CANCELLATION -- Adjustment due to cancellation of contract&#10;* CONTRACT_REVERSAL -- Adjustment due to reversal of contract&#10;* CONTRACT_ADJUSTMENT -- Adjustment due to adjustment to contract&#10;* CONTRACT_ADJUSTMENT_CANCELLATION -- Overall reductions&#10;* CONTRACT_REST_MATURITY -- Used for all locked charges when contract gets rest maturity&#10;* BOOKING_ENTRY_REVERSAL -- Reversal of charge that is locked&#10;* BOOKING_ENTRY_REDUCTION -- Reduction of the original charge&#10;* CUSTOM -- Custom adjustment&#10;* CUSTOM_SINGLE_BOOKING_ENTRY -- Discount for single booking entry&#10;* CONSUMPTION_CREDIT_CONVERSION -- Adjustment due to normal credit conversion&#10;* CONSUMPTION_CREDIT_BONUS_CONVERSION -- Adjustment due to bonus credit conversion&#10;* CHECKIN_DISCOUNT -- Discount for reaching a certain hours of check-ins for the month&#10;* CHARGED_BACK -- Return of payment&#10;* Null -- No Adjustment" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="20" name="description" nullable="true" remarks="Free-text description of the revenue entry." size="65535" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="21" name="invoice_id" nullable="true" remarks="The invoice position (fct_invoice grain) this revenue entry corresponds to, resolved via the underlying booking entry. Populated only when the booking entry maps to exactly one invoice position; otherwise null to avoid revenue duplication." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="invoice_id" foreignKey="erp_v2_fct_revenue_invoice_based_invoice_id__erp_v2_fct_invoice_invoice_id_fkey_316170475d2a" implied="false" onDeleteCascade="false" schema="erp_v2" table="fct_invoice"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="22" name="pos_saleposition_id" nullable="true" remarks="The POS sale position this revenue entry corresponds to. Populated when a sale in the cash register happens. Allows joining to fct_pos_saleposition for POS line-item details." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="pos_saleposition_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="fct_pos_saleposition"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="23" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="24" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="revenue_invoice_based_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="fct_service_usage" remarks="Individual transactions of customers consuming services at gyms. Represents each instance where a service is used, whether paid individually, &#10;from a purchased package (day pass, class pack), or included in a membership contract. Used for tracking service demand, package utilization, &#10;and revenue attribution across the business." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="service_usage_id" nullable="false" remarks="Unique identifier for this specific service usage transaction." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="created_user" nullable="true" remarks="Username of the staff member who recorded this service usage, or system identifier for automated/self-service entries (e.g., kiosk check-ins, mobile app bookings)." size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="service_id" nullable="true" remarks="The specific service or benefit consumed (e.g., group fitness class, sauna access, personal training session, equipment rental, tanning bed use)." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="service_id" foreignKey="erp_v2_fct_service_usage_service_id__erp_v2_dim_service_service_id_fkey_252e7c8293c0" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_service"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="customer_id" nullable="true" remarks="The customer who used the service. NULL if customer data was removed for privacy compliance or if usage was recorded anonymously." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="customer_id" foreignKey="erp_v2_fct_service_usage_customer_id__erp_v2_dim_customer_customer_id_fkey_3b345e479996" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_customer"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="organization_unit_id" nullable="true" remarks="The gym location where the service was consumed. NULL for imported historical data that lacks location information." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_service_usage_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_3e9a8bf6cb0e" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="employee_id" nullable="true" remarks="The staff member who facilitated or recorded the service usage (e.g., front desk agent, trainer). NULL for self-service usage like automated check-ins or online bookings." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="employee_id" foreignKey="erp_v2_fct_service_usage_employee_id__erp_v2_dim_employee_employee_id_fkey_1e52486423bf" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_employee"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="device_id" nullable="true" remarks="The physical device (e.g., turnstile, kiosk, or access terminal) that registered this service usage. NULL when the usage was initiated programmatically without a physical device." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="device_id" foreignKey="erp_v2_fct_service_usage_device_id__erp_v2_dim_device_device_id_fkey_c8141dcfec7f" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_device"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="inclusive_contingent_id" nullable="true" remarks="The membership benefit allowance used to pay for this service (e.g., included classes in a contract, bundled sauna access). NULL if service was paid separately." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="inclusive_contingent_id" foreignKey="erp_v2_fct_service_usage_inclusive_contingent_id__erp_v2_dim_inclusive_contingent_inclusive_contingent_id_fkey_0d4538394108" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_inclusive_contingent"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="purchased_contingent_id" nullable="true" remarks="The purchased package used to pay for this service (e.g., 10-class pass, day ticket, time-based access package). NULL if service was paid via membership or separately." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="purchased_contingent_id" foreignKey="erp_v2_fct_service_usage_purchased_contingent_id__erp_v2_dim_purchased_contingent_purchased_contingent_id_fkey_b32dd15cbc61" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_purchased_contingent"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="6" id="9" name="start_date_time" nullable="true" remarks="Date and time when the customer began using the service, in the gym's local timezone. For time-based services, marks the beginning of the usage period." size="29" type="timestamp" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="10" name="end_date_time" nullable="true" remarks="Date and time when the service usage concluded, in the gym's local timezone. Calculated by adding the service duration to start time. NULL for instantaneous services." size="29" type="timestamp" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="contingent_usages" nullable="true" remarks="Amount of credit consumed from the customer's package or allowance. For count-based services, typically 1 per use. For time-based services, represents minutes consumed (e.g., 30 for a 30-minute tanning session)." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="13" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="service_usage_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="fct_trainer_appointment" remarks="An appointment (class, trial session or personal training) by the trainer(s) leading it. Note: There can be multiple trainers per appointment, leading to multiple entries of the same `appointment_id`." schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="trainer_appointment_id" nullable="false" remarks="The primary key of this table. System column calculated by the source System." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="organization_unit_id" nullable="true" remarks="The studio where the appointment takes place." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_trainer_appointment_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id_fkey_d785c878b6f4" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="appointment_id" nullable="true" remarks="The unique appointment in the calendar. With useful information about it, eg. its `status`." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="appointment_id" foreignKey="erp_v2_fct_trainer_appointment_appointment_id__erp_v2_dim_appointment_appointment_id_fkey_4e3c9632486d" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_appointment"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="employee_id" nullable="true" remarks="The employee who is the trainer of this appointment." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="employee_id" foreignKey="erp_v2_fct_trainer_appointment_employee_id__erp_v2_dim_employee_employee_id_fkey_ff80f2048c74" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_employee"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="service_id" nullable="true" remarks="The pre-defined service this appointment is about. Or null if no service is assigned." size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="service_id" foreignKey="erp_v2_fct_trainer_appointment_service_id__erp_v2_dim_service_service_id_fkey_b6c7f57ca44b" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_service"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="start_date" nullable="true" remarks="The date when the appointment starts." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="end_date" nullable="true" remarks="The date when the appointment ends." size="13" type="date" typeCode="91"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="7" name="start_date_time" nullable="true" remarks="The local timestamp at which the appointment starts." size="29" type="timestamp" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="6" id="8" name="end_date_time" nullable="true" remarks="The local timestamp at which the appointment ends." size="29" type="timestamp" typeCode="93"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="9" name="trainer_status" nullable="true" remarks="BOOKED: the trainer is available for the appointment, DESIRED: the trainer is planned/not available for the appointment, APPOINTMENT_CANCELED: appointment was cancelled" size="256" type="varchar" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="10" name="num_booked_participants" nullable="true" remarks="How many customers successfully booked (and didn't cancel) this appointment" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="num_booked_waiting_list" nullable="true" remarks="How many customers tried to book this appointment, while it already reached its max_participants." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="num_anonymous_participants" nullable="true" remarks="How many people participated in this appointment, but did not book in advance. Eg. appointment started, they walked in and asked if they can join." size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="num_confirmed_participants" nullable="true" remarks="How many people were reported as physically present when the appointment started. (By their participant_status)." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="num_confirmed_missing_participants" nullable="true" remarks="How many of the booked participants were reported as physically not-present when the appointment started. (By their participant_status)." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="num_unconfirmed_participants" nullable="true" remarks="For how many of the booked participants, nothing about their physical presence was reported. (By their participant_status)." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="17" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="trainer_appointment_id" sequenceNumberInPK="1"/>
      </table>
      <table catalog="enterprise_4e" name="fct_trainer_class_appointments" remarks="### DEPRECATED. Use fct_trainer_appointment instead. Stores all appointments for trainers" schema="erp_v2" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="trainer_class_appointments_id" nullable="false" remarks="The primary key of this table. System column calculated by the source System." size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="organization_unit_id" nullable="true" remarks="The id of a studio where appointment take place" size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="organization_unit_id" foreignKey="erp_v2_fct_trainer_class_appointments_organization_unit_id__erp_v2_dim_organization_unit_organization_unit_id__53869137b108" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_organization_unit"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="start_date_id" nullable="true" remarks="The date when appointment starts" size="10" type="int4" typeCode="4">
            <parent catalog="enterprise_4e" column="date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_date"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="end_date_id" nullable="true" remarks="The date when appointment ends" size="10" type="int4" typeCode="4">
            <parent catalog="enterprise_4e" column="date_id" foreignKey="Implied Constraint" implied="true" onDeleteCascade="false" schema="erp_v2" table="dim_date"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="employee_id" nullable="true" remarks="The employee responsible for this appointment" size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="employee_id" foreignKey="erp_v2_fct_trainer_class_appointments_employee_id__erp_v2_dim_employee_employee_id_fkey_5658994255ec" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_employee"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="class_id" nullable="true" remarks="The id of a related class of the appointment" size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="class_id" foreignKey="erp_v2_fct_trainer_class_appointments_class_id__erp_v2_dim_class_class_id_fkey_40aa8e71a982" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_class"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="appointment_id" nullable="true" remarks="Appointment properties, e.g status of the appointment, number of max participants, planned participants, etc" size="19" type="int8" typeCode="-5">
            <parent catalog="enterprise_4e" column="appointment_id" foreignKey="erp_v2_fct_trainer_class_appointments_appointment_id__erp_v2_dim_appointment_appointment_id_fkey_03e54edf990b" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_appointment"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="trainer_appointment_status_id" nullable="true" remarks="Status of the employee for a specific appointment" size="256" type="varchar" typeCode="12">
            <parent catalog="enterprise_4e" column="trainer_appointment_status_id" foreignKey="erp_v2_fct_trainer_class_appointments_trainer_appointment_status_id__erp_v2_dim_trainer_appointment_status_tra_487e44118838" implied="false" onDeleteCascade="false" schema="erp_v2" table="dim_trainer_appointment_status"/>
         </column>
         <column autoUpdated="false" defaultValue="null" digits="0" id="8" name="last_updated" nullable="true" remarks="System column. UTC Timestamp at which entry was calculated (lags shortly behind source system)." size="35" type="timestamptz" typeCode="2014"/>
         <column autoUpdated="false" defaultValue="getdate()" digits="0" id="9" name="data_landing_time" nullable="false" remarks="System column. UTC timestamp assigned when a table batch is applied on Redshift. It represents warehouse landing order at table-batch granularity, not source event order. Usable to filter for incremental extractions." size="35" type="timestamptz" typeCode="2014"/>
         <primaryKey column="trainer_class_appointments_id" sequenceNumberInPK="1"/>
      </table>
   </tables>
</database>
