version: 2

models:
  - name: dim_order_taxes
    description: >
      The dim_order_taxes table is a dimensional table containing information about taxes applied to orders.
    columns:
      - name: smcid
        description: >
          The SourceMedium ID of a store, which is derived from the store's myshopify.com domain.
        tests:
          - not_null

      - name: sm_order_tax_key
        description: >
          The unique order tax key created by SourceMedium that can be used to join order tax dimensions to related tables.
        tests:
          - not_null
          - unique

      - name: sm_order_line_key
        description: >
          The unique order line key created by SourceMedium that can be used to join order line dimensions to related tables.

      - name: sm_order_key
        description: >
          The unique order key created by SourceMedium that can be used to join order dimensions to related tables.

      - name: source_system
        description: >
          The e-commerce source system used to facilitate a customer's order.

      - name: order_line_id
        description: >
          The ID of the order line.

      - name: order_shipping_line_id
        description: >
          The ID of the shipping line.

      - name: order_id
        description: >
          The ID of the order.

      - name: tax_line_type
        description: >
          The type of tax (e.g., state, county, excise and use, sales) applied to an order line.

      - name: tax_line_entity
        description: >
          The line the tax applies to (e.g., shipping, order).

      - name: taxes
        description: >
          The amount of tax associated with a tax line entity, after discounts and before returns.

      - name: tax_line_rate
        description: >
          The proportion of the order price that the tax represents.

      - name: _synced_at
        description: >
          The date and time when SourceMedium last successfully synced the row of data.
        tests:
          - not_null