Skip to main content
version: 2

models:
  - name: dim_order_lines
    description: >
      Order line dimension for product-level attributes at line grain. Grain: One row per sm_order_line_key. No canonical date; _synced_at is a freshness timestamp (not for analysis). Critical filters: source_system for platform-specific line-item coverage. Key joins: dim_orders via sm_order_key (many:1); dim_product_variants via sm_product_variant_key (many:1).
    columns:
      - name: order_line_id
        description: >
          The ID of the order line.

      - name: order_line_price
        description: >
          The price of a single unit of the product at the time of purchase (before line-level discounts). Multiply by order_line_quantity to get total line revenue.

      - name: order_line_product_title
        description: >
          The title of the product variant that the order line represents.

      - name: order_line_product_variant_title
        description: >
          The title of the product variant that the order line represents.

      - name: order_line_quantity
        description: >
          The number of units of the product variant ordered in this line item. Used to calculate total line revenue (order_line_price * order_line_quantity).

      - name: product_id
        description: >
          Platform-specific product identifier from the source system. Links to the parent product that this line item's variant belongs to.

      - name: product_variant_id
        description: >
          A unique identifier for the product variant generated by the source system.

      - name: sku
        description: >
          The stock keeping unit (SKU) of the product variant.

      - name: sm_order_key
        description: >
          Stable SourceMedium order key. Unique per order. Key joins: `obt_order_lines` (1:many via `sm_order_key`); `dim_customers` (many:1 via `sm_customer_key`). Platform caveat: TikTok Shop coverage may be limited.

      - name: sm_order_line_key
        description: >
          Stable SourceMedium order line key. Unique per line. Key joins: `dim_order_lines` (1:1); `dim_orders` (many:1 via `sm_order_key`). Platform caveat: TikTok Shop coverage may be limited.

      - name: sm_product_key
        description: >
          Stable SourceMedium join key for products to related tables.

      - name: sm_product_variant_key
        description: >
          Stable SourceMedium join key for product variants to related tables.

      - name: sm_store_id
        description: >
          SourceMedium's unique store identifier. For Shopify stores, derived from the myshopify.com domain; for other platforms (Amazon, TikTok Shop, Walmart.com), uses platform-specific identifiers.

      - name: source_system
        description: >
          Originating platform for the record (e.g., Shopify, Amazon, TikTok Shop, Chargebee). Used for platform‑specific behavior and coverage.