version: 2
models:
  - name: FANS_BY_ARTIST_ACCOUNT_ENGAGEMENT_METRIC_DBT
    description: '{{ doc("FANS_BY_ARTIST_ACCOUNT_ENGAGEMENT_METRIC_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
      - dbt_expectations.expect_table_row_count_to_be_between:
          min_value: 1
    columns:
      - name: VENDOR_ID
        description: Vendor ID from Orchard
        data_tests:
          - not_null
      - name: SUBACCOUNT_ID
        description: Subaccount ID from Orchard
        data_tests:
          - not_null
      - name: GLOBAL_PARTICIPANT_ID
        description: Global participant ID from Orchard
        data_tests:
          - not_null
      - name: STREAMING_FANS_COUNT
        description: Count of lean forward streamers from Spotify
        data_tests:
          - not_null
      - name: FANSIFTER_FANS_COUNT
        description: Count of fans per artist and country
        data_tests:
          - not_null
      - name: ENGAGEMENT_RATIO
        description: Fan engagement ratio
        data_tests:
          - not_null
      - name: ENGAGEMENT_BENCHMARK
        description: Fan engagement benchmark as 10% of total lean forward streamers
        data_tests:
          - not_null
  - name: FANS_BY_ARTIST_ACCOUNT_ENGAGEMENT_METRIC_COUNTRY_DBT
    description: '{{ doc("FANS_BY_ARTIST_ACCOUNT_ENGAGEMENT_METRIC_COUNTRY_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
            - COUNTRY_ISO2
      - dbt_expectations.expect_table_row_count_to_be_between:
          min_value: 1
    columns:
      - name: VENDOR_ID
        description: Vendor ID from Orchard
        data_tests:
          - not_null
      - name: SUBACCOUNT_ID
        description: Subaccount ID from Orchard
        data_tests:
          - not_null
      - name: GLOBAL_PARTICIPANT_ID
        description: Global participant ID from Orchard
        data_tests:
          - not_null
      - name: COUNTRY_ISO2
        description: Country code in ISO2 format
        data_tests:
          - not_null
      - name: STREAMING_FANS_COUNT
        description: Count of lean forward streamers from Spotify
        data_tests:
          - not_null
      - name: FANSIFTER_FANS_COUNT
        description: Count of fans per artist and country
        data_tests:
          - not_null
      - name: ENGAGEMENT_RATIO
        description: Fan engagement ratio
        data_tests:
          - not_null
      - name: ENGAGEMENT_BENCHMARK
        description: Fan engagement benchmark as 10% of total lean forward streamers
        data_tests:
          - not_null
  - name: GLOBAL_FANS_BY_ARTIST_ENGAGEMENT_METRIC_DBT
    description: '{{ doc("GLOBAL_FANS_BY_ARTIST_ENGAGEMENT_METRIC_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
      - dbt_expectations.expect_table_row_count_to_be_between:
          min_value: 1
    columns:
      - name: GLOBAL_PARTICIPANT_ID
        description: Global participant ID from Orchard
        data_tests:
          - not_null
      - name: STREAMING_FANS_COUNT
        description: Count of lean forward streamers from Spotify
        data_tests:
          - not_null
      - name: FANSIFTER_FANS_COUNT
        description: Count of fans per artist and country
        data_tests:
          - not_null
      - name: ENGAGEMENT_RATIO
        description: Fan engagement ratio
        data_tests:
          - not_null
      - name: ENGAGEMENT_BENCHMARK
        description: Fan engagement benchmark as 10% of total lean forward streamers
        data_tests:
          - not_null
  - name: GLOBAL_FANS_BY_ARTIST_ENGAGEMENT_METRIC_COUNTRY_DBT
    description: '{{ doc("GLOBAL_FANS_BY_ARTIST_ENGAGEMENT_METRIC_COUNTRY_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - COUNTRY_ISO2
      - dbt_expectations.expect_table_row_count_to_be_between:
          min_value: 1
    columns:
      - name: GLOBAL_PARTICIPANT_ID
        description: Global participant ID from Orchard
        data_tests:
          - not_null
      - name: COUNTRY_ISO2
        description: Country code in ISO2 format
        data_tests:
          - not_null
      - name: STREAMING_FANS_COUNT
        description: Count of lean forward streamers from Spotify
        data_tests:
          - not_null
      - name: FANSIFTER_FANS_COUNT
        description: Count of fans per artist and country
        data_tests:
          - not_null
      - name: ENGAGEMENT_RATIO
        description: Fan engagement ratio
        data_tests:
          - not_null
      - name: ENGAGEMENT_BENCHMARK
        description: Fan engagement benchmark as 10% of total lean forward streamers
        data_tests:
          - not_null
