version: 2
models:
  - name: FANS_BY_ARTIST_ACCOUNT_CATEGORY_DBT
    description: '{{ doc("FANS_BY_ARTIST_ACCOUNT_CATEGORY_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
            - SEGMENT_NAME
            - CATEGORY
      - 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: SEGMENT_NAME
        description: Segment name from the super fan segmentation
        data_tests:
          - not_null
          - accepted_values:
              values: [ "NEW_FANS", "FANS_TO_WIN_BACK", "CASUAL_FANS", "ENGAGED_FANS", "SUPER_FANS" ]
      - name: CATEGORY
        description: Category used for grouping segmentation features
        data_tests:
          - not_null
          - accepted_values:
                values: [ "ADDED_ARTISTS_MUSIC", "CAMPAIGN_PARTICIPATION", "CONCERT_TICKET", "EMAIL_CAMPAIGN", "FOLLOW_ARTIST", "HEAVY_LISTENING", "LISTENING", "MERCH", "SIGN_UP", "FAN_CLUB", "CONTEST", "LIVE_STREAMING", "SMS_CAMPAIGN" ]
      - name: FANS_SHARE
        description: Share of fans who representing artist, account, segment and country grouping
        data_tests:
          - not_null
          - dbt_utils.expression_is_true:
              expression: '>= 0'
      - name: SEGMENT_FANS_COUNT
        description: Nr of fans per segment
        data_tests:
          - not_null
  - name: FANS_BY_ARTIST_ACCOUNT_CATEGORY_COUNTRY_DBT
    description: '{{ doc("FANS_BY_ARTIST_ACCOUNT_CATEGORY_COUNTRY_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
            - COUNTRY_ISO2
            - SEGMENT_NAME
            - CATEGORY
      - 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: SEGMENT_NAME
        description: Segment name from the super fan segmentation
        data_tests:
          - not_null
          - accepted_values:
              values: [ "NEW_FANS", "FANS_TO_WIN_BACK", "CASUAL_FANS", "ENGAGED_FANS", "SUPER_FANS" ]
      - name: FANS_COUNT
        description: Nr of fans used for aggregation
        data_tests:
          - not_null
      - name: CATEGORY
        description: Category used for grouping segmentation features
        data_tests:
          - not_null
          - accepted_values:
                values: [ "ADDED_ARTISTS_MUSIC", "CAMPAIGN_PARTICIPATION", "CONCERT_TICKET", "EMAIL_CAMPAIGN", "FOLLOW_ARTIST", "HEAVY_LISTENING", "LISTENING", "MERCH", "SIGN_UP", "FAN_CLUB", "CONTEST", "LIVE_STREAMING", "SMS_CAMPAIGN" ]
      - name: FANS_SHARE
        description: Share of fans who representing artist, account, segment and country grouping
        data_tests:
          - not_null
          - dbt_utils.expression_is_true:
              expression: '>= 0'
      - name: SEGMENT_FANS_COUNT
        description: Nr of fans per segment
        data_tests:
          - not_null
  - name: QA_FANS_BY_ARTIST_ACCOUNT_CATEGORY_DBT
    description: '{{ doc("QA_FANS_BY_ARTIST_ACCOUNT_CATEGORY_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
            - SEGMENT_NAME
            - CATEGORY
      - 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: SEGMENT_NAME
        description: Segment name from the super fan segmentation
        data_tests:
          - not_null
          - accepted_values:
              values: [ "NEW_FANS", "FANS_TO_WIN_BACK", "CASUAL_FANS", "ENGAGED_FANS", "SUPER_FANS" ]
      - name: CATEGORY
        description: Category used for grouping segmentation features
        data_tests:
          - not_null
          - accepted_values:
                values: [ "ADDED_ARTISTS_MUSIC", "CAMPAIGN_PARTICIPATION", "CONCERT_TICKET", "EMAIL_CAMPAIGN", "FOLLOW_ARTIST", "HEAVY_LISTENING", "LISTENING", "MERCH", "SIGN_UP", "FAN_CLUB", "CONTEST", "LIVE_STREAMING", "SMS_CAMPAIGN" ]
      - name: FANS_SHARE
        description: Share of fans who representing artist, account, segment and country grouping
        data_tests:
          - not_null
          - dbt_utils.expression_is_true:
              expression: '>= 0'
      - name: SEGMENT_FANS_COUNT
        description: Nr of fans per segment
        data_tests:
          - not_null
  - name: QA_FANS_BY_ARTIST_ACCOUNT_CATEGORY_COUNTRY_DBT
    description: '{{ doc("QA_FANS_BY_ARTIST_ACCOUNT_CATEGORY_COUNTRY_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
            - COUNTRY_ISO2
            - SEGMENT_NAME
            - CATEGORY
      - 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: SEGMENT_NAME
        description: Segment name from the super fan segmentation
        data_tests:
          - not_null
          - accepted_values:
              values: [ "NEW_FANS", "FANS_TO_WIN_BACK", "CASUAL_FANS", "ENGAGED_FANS", "SUPER_FANS" ]
      - name: CATEGORY
        description: Category used for grouping segmentation features
        data_tests:
          - not_null
          - accepted_values:
                values: [ "ADDED_ARTISTS_MUSIC", "CAMPAIGN_PARTICIPATION", "CONCERT_TICKET", "EMAIL_CAMPAIGN", "FOLLOW_ARTIST", "HEAVY_LISTENING", "LISTENING", "MERCH", "SIGN_UP", "FAN_CLUB", "CONTEST", "LIVE_STREAMING", "SMS_CAMPAIGN" ]
      - name: FANS_COUNT
        description: Nr of fans used for aggregation
        data_tests:
          - not_null
      - name: FANS_SHARE
        description: Share of fans who representing artist, account, segment and country grouping
        data_tests:
          - not_null
          - dbt_utils.expression_is_true:
              expression: '>= 0'
      - name: SEGMENT_FANS_COUNT
        description: Nr of fans per segment
        data_tests:
          - not_null
  - name: GLOBAL_FANS_BY_ARTIST_CATEGORY_DBT
    description: '{{ doc("GLOBAL_FANS_BY_ARTIST_CATEGORY_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - SEGMENT_NAME
            - CATEGORY
      - 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: SEGMENT_NAME
        description: Segment name from the super fan segmentation
        data_tests:
          - not_null
          - accepted_values:
              values: [ "NEW_FANS", "FANS_TO_WIN_BACK", "CASUAL_FANS", "ENGAGED_FANS", "SUPER_FANS" ]
      - name: CATEGORY
        description: Category used for grouping segmentation features
        data_tests:
          - not_null
          - accepted_values:
                values: [ "ADDED_ARTISTS_MUSIC", "CAMPAIGN_PARTICIPATION", "CONCERT_TICKET", "EMAIL_CAMPAIGN", "FOLLOW_ARTIST", "HEAVY_LISTENING", "LISTENING", "MERCH", "SIGN_UP", "FAN_CLUB", "CONTEST", "LIVE_STREAMING", "SMS_CAMPAIGN" ]
      - name: FANS_SHARE
        description: Share of fans who representing artist, account, segment and country grouping
        data_tests:
          - not_null
          - dbt_utils.expression_is_true:
              expression: '>= 0'
      - name: SEGMENT_FANS_COUNT
        description: Nr of fans per segment
        data_tests:
          - not_null
  - name: GLOBAL_FANS_BY_ARTIST_CATEGORY_COUNTRY_DBT
    description: '{{ doc("GLOBAL_FANS_BY_ARTIST_CATEGORY_COUNTRY_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - COUNTRY_ISO2
            - SEGMENT_NAME
            - CATEGORY
      - 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: SEGMENT_NAME
        description: Segment name from the super fan segmentation
        data_tests:
          - not_null
          - accepted_values:
              values: [ "NEW_FANS", "FANS_TO_WIN_BACK", "CASUAL_FANS", "ENGAGED_FANS", "SUPER_FANS" ]
      - name: FANS_COUNT
        description: Nr of fans used for aggregation
        data_tests:
          - not_null
      - name: CATEGORY
        description: Category used for grouping segmentation features
        data_tests:
          - not_null
          - accepted_values:
                values: [ "ADDED_ARTISTS_MUSIC", "CAMPAIGN_PARTICIPATION", "CONCERT_TICKET", "EMAIL_CAMPAIGN", "FOLLOW_ARTIST", "HEAVY_LISTENING", "LISTENING", "MERCH", "SIGN_UP", "FAN_CLUB", "CONTEST", "LIVE_STREAMING", "SMS_CAMPAIGN" ]
      - name: FANS_SHARE
        description: Share of fans who representing artist, account, segment and country grouping
        data_tests:
          - not_null
          - dbt_utils.expression_is_true:
              expression: '>= 0'
      - name: SEGMENT_FANS_COUNT
        description: Nr of fans per segment
        data_tests:
          - not_null
  - name: GLOBAL_FANS_BY_ARTIST_CATEGORY_SHARE_DBT
    description: '{{ doc("GLOBAL_FANS_BY_ARTIST_CATEGORY_SHARE_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - SEGMENT_NAME
            - CATEGORY
      - 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: SEGMENT_NAME
        description: Segment name from the super fan segmentation
        data_tests:
          - not_null
          - accepted_values:
              values: [ "NEW_FANS", "FANS_TO_WIN_BACK", "CASUAL_FANS", "ENGAGED_FANS", "SUPER_FANS" ]
      - name: FANS_PER_SEGMENT
        description: Nr of fans from segment
        data_tests:
          - not_null
      - name: FANS_PER_SEGMENT_CATEGORY
        description: Nr of fans from category
        data_tests:
          - not_null
      - name: CATEGORY
        description: Category used for grouping segmentation features
        data_tests:
          - not_null
          - accepted_values:
                values: [ "ADDED_ARTISTS_MUSIC", "CAMPAIGN_PARTICIPATION", "CONCERT_TICKET", "EMAIL_CAMPAIGN", "FOLLOW_ARTIST", "HEAVY_LISTENING", "LISTENING", "MERCH", "SIGN_UP", "FAN_CLUB", "CONTEST", "LIVE_STREAMING", "SMS_CAMPAIGN" ]
      - name: FANS_SHARE
        description: Share of fans who representing artist, account, segment and country grouping
        data_tests:
          - not_null
          - dbt_utils.expression_is_true:
              expression: '>= 0'
  - name: GLOBAL_FANS_BY_ARTIST_CATEGORY_COUNTRY_SHARE_DBT
    description: '{{ doc("GLOBAL_FANS_BY_ARTIST_CATEGORY_COUNTRY_SHARE_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - SEGMENT_NAME
            - CATEGORY
            - 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: SEGMENT_NAME
        description: Segment name from the super fan segmentation
        data_tests:
          - not_null
          - accepted_values:
              values: [ "NEW_FANS", "FANS_TO_WIN_BACK", "CASUAL_FANS", "ENGAGED_FANS", "SUPER_FANS" ]
      - name: COUNTRY_ISO2
        description: Country code in ISO2 format
        data_tests:
          - not_null
      - name: FANS_PER_SEGMENT
        description: Nr of fans from segment
        data_tests:
          - not_null
      - name: FANS_PER_SEGMENT_CATEGORY
        description: Nr of fans from category
        data_tests:
          - not_null
      - name: CATEGORY
        description: Category used for grouping segmentation features
        data_tests:
          - not_null
          - accepted_values:
                values: [ "ADDED_ARTISTS_MUSIC", "CAMPAIGN_PARTICIPATION", "CONCERT_TICKET", "EMAIL_CAMPAIGN", "FOLLOW_ARTIST", "HEAVY_LISTENING", "LISTENING", "MERCH", "SIGN_UP", "FAN_CLUB", "CONTEST", "LIVE_STREAMING", "SMS_CAMPAIGN" ]
      - name: FANS_SHARE
        description: Share of fans who representing artist, account, segment and country grouping
        data_tests:
          - not_null
          - dbt_utils.expression_is_true:
              expression: '>= 0'
  - name: FANS_BY_ARTIST_ACCOUNT_CATEGORY_SHARE_DBT
    description: '{{ doc("FANS_BY_ARTIST_ACCOUNT_CATEGORY_SHARE_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
            - SEGMENT_NAME
            - CATEGORY
      - 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: VENDOR_ID
        description: Vendor ID from Orchard
        data_tests:
          - not_null
      - name: SUBACCOUNT_ID
        description: Subaccount ID from Orchard
        data_tests:
          - not_null
      - name: SEGMENT_NAME
        description: Segment name from the super fan segmentation
        data_tests:
          - not_null
          - accepted_values:
              values: [ "NEW_FANS", "FANS_TO_WIN_BACK", "CASUAL_FANS", "ENGAGED_FANS", "SUPER_FANS" ]
      - name: FANS_PER_SEGMENT
        description: Nr of fans from segment
        data_tests:
          - not_null
      - name: FANS_PER_SEGMENT_CATEGORY
        description: Nr of fans from category
        data_tests:
          - not_null
      - name: CATEGORY
        description: Category used for grouping segmentation features
        data_tests:
          - not_null
          - accepted_values:
                values: [ "ADDED_ARTISTS_MUSIC", "CAMPAIGN_PARTICIPATION", "CONCERT_TICKET", "EMAIL_CAMPAIGN", "FOLLOW_ARTIST", "HEAVY_LISTENING", "LISTENING", "MERCH", "SIGN_UP", "FAN_CLUB", "CONTEST", "LIVE_STREAMING", "SMS_CAMPAIGN" ]
      - name: FANS_SHARE
        description: Share of fans who representing artist, account, segment and country grouping
        data_tests:
          - not_null
          - dbt_utils.expression_is_true:
              expression: '>= 0'
  - name: FANS_BY_ARTIST_ACCOUNT_CATEGORY_COUNTRY_SHARE_DBT
    description: '{{ doc("FANS_BY_ARTIST_ACCOUNT_CATEGORY_COUNTRY_SHARE_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
            - SEGMENT_NAME
            - CATEGORY
            - 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: VENDOR_ID
        description: Vendor ID from Orchard
        data_tests:
          - not_null
      - name: SUBACCOUNT_ID
        description: Subaccount ID from Orchard
        data_tests:
          - not_null
      - name: SEGMENT_NAME
        description: Segment name from the super fan segmentation
        data_tests:
          - not_null
          - accepted_values:
              values: [ "NEW_FANS", "FANS_TO_WIN_BACK", "CASUAL_FANS", "ENGAGED_FANS", "SUPER_FANS" ]
      - name: COUNTRY_ISO2
        description: Country code in ISO2 format
        data_tests:
          - not_null
      - name: FANS_PER_SEGMENT
        description: Nr of fans from segment
        data_tests:
          - not_null
      - name: FANS_PER_SEGMENT_CATEGORY
        description: Nr of fans from category
        data_tests:
          - not_null
      - name: CATEGORY
        description: Category used for grouping segmentation features
        data_tests:
          - not_null
          - accepted_values:
                values: [ "ADDED_ARTISTS_MUSIC", "CAMPAIGN_PARTICIPATION", "CONCERT_TICKET", "EMAIL_CAMPAIGN", "FOLLOW_ARTIST", "HEAVY_LISTENING", "LISTENING", "MERCH", "SIGN_UP", "FAN_CLUB", "CONTEST", "LIVE_STREAMING", "SMS_CAMPAIGN" ]
      - name: FANS_SHARE
        description: Share of fans who representing artist, account, segment and country grouping
        data_tests:
          - not_null
          - dbt_utils.expression_is_true:
              expression: '>= 0'
