version: 2

models:
  - name: dim_customers
    description: >
      The dim_customers table is a dimensional table containing customer information derived from e-commerce transactions.
    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_customer_key
        description: >
          The unique customer key created by SourceMedium that can be used to join customer dimensions to related tables.
        tests:
        - not_null
        - unique

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

      - name: customer_id
        description: >
          The ID of the customer who placed the order.
        tests:
          - not_null

      - name: customer_created_at
        description: >
          The autogenerated date and time when the customer was created.

      - name: customer_updated_at
        description: >
          The autogenerated date and time when the customer was last modified.

      - name: customer_email
        description: >
          The customer's email.

      - name: customer_email_hashed
        description: >
          The customer's email hashed.

      - name: customer_first_name
        description: >
          The customer's first name.

      - name: customer_last_name
        description: >
          The customer's last name.

      - name: customer_tags_csv
        description: >
          An aggregated list of all tags associated with a customer.

      - name: customer_tags_array
        description: >
          An array of all tags associated with a customer.

      - name: has_customer_consented_to_marketing
        description: >
          Whether the customer has consented to receive marketing communications.

      - name: is_customer_email_verified
        description: >
          Whether the customer's email has been verified.

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