version: 2

models:
  - name: fct_orders_placed
    description: >
      The fct_orders_placed is a fact table containing information about orders placed by customers.
    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_line_key
        description: >
          The unique order line key created by SourceMedium that can be used to join order line dimensions to related tables.
        tests:
          - not_null
          - unique

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

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

      - name: sm_product_variant_key
        description: >
          The unique product variant key created by SourceMedium that can be used to join product variant dimensions to related tables.
        tests:
          - not_null

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

      - name: order_created_at_local_datetime
        description: >
          The autogenerated date and time when the order was created, converted to the reporting timezone configured in SourceMedium.

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

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

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

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

      - name: order_line_quantity
        description: >
          The number of items that were originally purchased in an order.

      - name: order_line_price
        description: >
          The price of the items purchased in an order.

      - name: order_line_gross_sales
        description: >
          The number of items in an order multiplied by the price of those items.

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