version: 2
models:
  - name: AUDIENCE_FILTERS_BY_FAN_ARTIST_ACCOUNT_DBT
    description: '{{ doc("AUDIENCE_FILTERS_BY_FAN_ARTIST_ACCOUNT_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - FAN_ID
            - GLOBAL_PARTICIPANT_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
      - dbt_expectations.expect_table_row_count_to_be_between:
          min_value: 1
    columns:
      - name: FAN_ID
        description: Id representing fan (SHA256 of a lowercase fan email)
        data_tests:
          - not_null
      - name: GLOBAL_PARTICIPANT_ID
        description: Id representing The Orchard Global Participant
        data_tests:
          - not_null
      - name: SUBACCOUNT_ID
        description: Subaccount ID
        data_tests:
          - not_null
      - name: VENDOR_ID
        description: Vendor ID
        data_tests:
          - not_null
      - name: TOTAL_SPEND
        description: Monetary value
      - name: LAST_EVENT_DATE
        description: Date representing when last event took place
        data_tests:
          - not_null
      - name: SEGMENT_NAME
        description: Name of the segment where fan was assigned based on scoring
        data_tests:
          - accepted_values:
              values: [ 'NEW_FANS', 'FANS_TO_WIN_BACK','CASUAL_FANS','ENGAGED_FANS','SUPER_FANS', 'SECONDARY_FANS', 'UNSEGMENTED_FANS']
              # This field is nullable
      - name: EMAIL_CONSENT
        description:  Boolean representing email campaign consent
        data_tests:
          - not_null
      - name: TEXT_CONSENT
        description:  Boolean representing text campaign consent
        data_tests:
          - not_null
  - name: AUDIENCE_FILTERS_BY_FAN_DBT
    description: '{{ doc("AUDIENCE_FILTERS_BY_FAN_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - FAN_ID
      - dbt_expectations.expect_table_row_count_to_be_between:
          min_value: 1
    columns:
      - name: FAN_ID
        description: Id representing fan (SHA256 of a lowercase fan email)
        data_tests:
          - not_null
      - name: DSP
        description: Array containing DSP names
      - name: GENRE_LISt
        description: Array of preferred genre values from CRM
      - name: FAN_LANGUAGE_LIST
        description: Array of ISO 639-1 language codes normalized from CRM
      - name: LANGUAGE_ORIGINAL
        description: Raw unsplit preferred language string from CRM
      - name: BIRTH_MONTH
        description: Uppercased three-letter month name of the fan's birth date (e.g. JAN, FEB)
        data_tests:
          - accepted_values:
              values: ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC']
              # This field is nullable
      - name: COUNTRY_ISO2
        description: ISO2 Country Code
      - name: REGION
        description: Name of the region
      - name: CITY
        description: Name of the fan city
      - name: LATITUDE
        description: Latitude in WGS84 system for city
      - name: LONGITUDE
        description: Longitude in WGS84 system for city
      - name: RETARGETING_CONSENT
        description: Boolean representing retargeting campaign consent
        data_tests:
          - not_null
  - name: AUDIENCE_FILTERS_DBT
    description: '{{ doc("AUDIENCE_FILTERS_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - FAN_ID
            - GLOBAL_PARTICIPANT_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
      - dbt_expectations.expect_table_row_count_to_be_between:
          min_value: 1
    columns:
      - name: FAN_ID
        description: Id representing fan (SHA256 of a lowercase fan email)
        data_tests:
          - not_null
      - name: GLOBAL_PARTICIPANT_ID
        description: Id representing The Orchard Global Participant
        data_tests:
          - not_null
      - name: VENDOR_ID
        description: Vendor ID
        data_tests:
          - not_null
      - name: SUBACCOUNT_ID
        description: Subaccount ID
        data_tests:
          - not_null
      - name: DSP
        description: Array containing DSP names
      - name: GENRE_LIST
        description: Array of preferred genre values from CRM
      - name: FAN_LANGUAGE_LIST
        description: Array of ISO 639-1 language codes normalized from CRM
      - name: LANGUAGE_ORIGINAL
        description: Raw unsplit preferred language string from CRM
      - name: BIRTH_MONTH
        description: Uppercased three-letter month name of the fan's birth date (e.g. JAN, FEB)
        data_tests:
          - accepted_values:
              values: ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC']
              # This field is nullable
      - name: COUNTRY_ISO2
        description: ISO2 Country Code
      - name: REGION
        description: Name of the region
      - name: CITY
        description: Name of the fan city
      - name: CITY_COORDINATES
        description: Snowflake geography object containing coordinates
      - name: RETARGETING_CONSENT
        description: Boolean representing retargeting campaign consent
        data_tests:
          - not_null
      - name: TOTAL_SPEND
        description: Monetary value
      - name: LAST_EVENT_DATE
        description: Date representing when last event took place
        data_tests:
          - not_null
      - name: SEGMENT_NAME
        description: Name of the segment where fan was assigned based on scoring
        data_tests:
          - accepted_values:
              values: [ 'NEW_FANS', 'FANS_TO_WIN_BACK','CASUAL_FANS', 'ENGAGED_FANS', 'SUPER_FANS', 'SECONDARY_FANS', 'UNSEGMENTED_FANS']
              # This field is nullable
      - name: EMAIL_CONSENT
        description: Boolean representing email campaign consent
        data_tests:
          - not_null
      - name: HEAVY_ROTATION
        description: Heavy Rotation Status
        data_tests:
          - not_null
          - accepted_values:
              values:
                - 'IN'
                - 'NOT_IN'
                - 'UNKNOWN'
      - name: IS_PRIMARY_FAN
        description: Boolean indicating if it's primary fan or not
  - name: AUDIENCE_FILTERS_BY_FAN_CUSTOM_LIST_ACCOUNT_DBT
    description: '{{ doc("AUDIENCE_FILTERS_BY_FAN_CUSTOM_LIST_ACCOUNT_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - FAN_ID
            - CUSTOM_LIST_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
      - dbt_expectations.expect_table_row_count_to_be_between:
          min_value: 1
    columns:
      - name: FAN_ID
        description: Id representing fan (SHA256 of a lowercase fan email)
        data_tests:
          - not_null
      - name: CUSTOM_LIST_ID
        description: Id representing custom list in the CRM
        data_tests:
          - not_null
      - name: SUBACCOUNT_ID
        description: Subaccount ID
        data_tests:
          - not_null
      - name: VENDOR_ID
        description: Vendor ID
        data_tests:
          - not_null
      - name: LAST_EVENT_DATE
        description: Date representing when last event took place
        data_tests:
          - not_null
      - name: EMAIL_CONSENT
        description:  Boolean representing email campaign consent
        data_tests:
          - not_null
  - name: AUDIENCE_FILTERS_CUSTOM_LIST_DBT
    description: '{{ doc("AUDIENCE_FILTERS_CUSTOM_LIST_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - FAN_ID
            - CUSTOM_LIST_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
      - dbt_expectations.expect_table_row_count_to_be_between:
          min_value: 1
    columns:
      - name: FAN_ID
        description: Id representing fan (SHA256 of a lowercase fan email)
        data_tests:
          - not_null
      - name: CUSTOM_LIST_ID
        description: Id representing custom list from CRM
        data_tests:
          - not_null
      - name: VENDOR_ID
        description: Vendor ID
        data_tests:
          - not_null
      - name: SUBACCOUNT_ID
        description: Subaccount ID
        data_tests:
          - not_null
      - name: DSP
        description: Array containing DSP names
      - name: GENRE_LIST
        description: Array of preferred genre values from CRM
      - name: FAN_LANGUAGE_LIST
        description: Array of ISO 639-1 language codes normalized from CRM
      - name: LANGUAGE_ORIGINAL
        description: Raw unsplit preferred language string from CRM
      - name: BIRTH_MONTH
        description: Uppercased three-letter month name of the fan's birth date (e.g. JAN, FEB)
        data_tests:
          - accepted_values:
              values: ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC']
              # This field is nullable
      - name: COUNTRY_ISO2
        description: ISO2 Country Code
      - name: REGION
        description: Name of the region
      - name: CITY
        description: Name of the fan city
      - name: LATITUDE
        description: Latitude in WGS84 system for city
      - name: LONGITUDE
        description: Longitude in WGS84 system for city
      - name: RETARGETING_CONSENT
        description: Boolean representing retargeting campaign consent
        data_tests:
          - not_null
      - name: LAST_EVENT_DATE
        description: Date representing when last event took place
        data_tests:
          - not_null
      - name: EMAIL_CONSENT
        description: Boolean representing email campaign consent
        data_tests:
          - not_null
  - name: AUDIENCE_FILTERS_ARTIST_CUSTOM_LIST_UNION_FILTERS_DBT
    description: '{{ doc("AUDIENCE_FILTERS_ARTIST_CUSTOM_LIST_UNION_FILTERS_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - FAN_ID
            - GLOBAL_PARTICIPANT_ID
            - CUSTOM_LIST_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
      - dbt_utils.expression_is_true:
          expression: "custom_list_id is not null"
          config:
            where: "global_participant_id is null"
      - dbt_utils.expression_is_true:
          expression: "global_participant_id is not null"
          config:
            where: "custom_list_id is null"
      - dbt_expectations.expect_table_row_count_to_be_between:
          min_value: 1
    columns:
      - name: FAN_ID
        description: Id representing fan (SHA256 of a lowercase fan email)
        data_tests:
          - not_null
      - name: GLOBAL_PARTICIPANT_ID
        description: Id representing The Orchard Global Participant
      - name: CUSTOM_LIST_ID
        description: Id representing custom list from CRM
      - name: VENDOR_ID
        description: Vendor ID
        data_tests:
          - not_null
      - name: SUBACCOUNT_ID
        description: Subaccount ID
        data_tests:
          - not_null
      - name: DSP
        description: Array containing DSP names
      - name: GENRE_LIST
        description: Array of preferred genre values from CRM
      - name: FAN_LANGUAGE_LIST
        description: Array of ISO 639-1 language codes normalized from CRM
      - name: LANGUAGE_ORIGINAL
        description: Raw unsplit preferred language string from CRM
      - name: BIRTH_MONTH
        description: Uppercased three-letter month name of the fan's birth date (e.g. JAN, FEB)
        data_tests:
          - accepted_values:
              values: ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC']
              # This field is nullable
      - name: COUNTRY_ISO2
        description: ISO2 Country Code
      - name: REGION
        description: Name of the region
      - name: CITY
        description: Name of the fan city
      - name: CITY_COORDINATES
        description: Snowflake geography object containing coordinates
      - name: RETARGETING_CONSENT
        description: Boolean representing retargeting campaign consent
        data_tests:
          - not_null
      - name: TOTAL_SPEND
        description: Monetary value
      - name: LAST_EVENT_DATE
        description: Date representing when last event took place
        data_tests:
          - not_null
      - name: SEGMENT_NAME
        description: Name of the segment where fan was assigned based on scoring
        data_tests:
          - accepted_values:
              values: [ 'NEW_FANS', 'FANS_TO_WIN_BACK','CASUAL_FANS', 'ENGAGED_FANS', 'SUPER_FANS', 'SECONDARY_FANS', 'UNSEGMENTED_FANS']
              # This field is nullable
      - name: EMAIL_CONSENT
        description: Boolean representing email campaign consent
        data_tests:
          - not_null
      - name: HEAVY_ROTATION
        description: Heavy Rotation Status
        data_tests:
          - accepted_values:
              values:
                - 'IN'
                - 'NOT_IN'
                - 'UNKNOWN'
              # This field is nullable
      - name: IS_PRIMARY_FAN
        description: Boolean indicating if it's primary fan or not
  - name: AUDIENCE_FILTERS_AD_CAMPAIGN_DBT
    description: '{{ doc("AUDIENCE_FILTERS_AD_CAMPAIGN_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - FAN_ID
            - GLOBAL_PARTICIPANT_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
      - dbt_expectations.expect_table_row_count_to_be_between:
          min_value: 1
    columns:
      - name: FAN_ID
        description: Id representing fan (SHA256 of a lowercase fan email)
        data_tests:
          - not_null
      - name: GLOBAL_PARTICIPANT_ID
        description: Id representing The Orchard Global Participant
      - name: VENDOR_ID
        description: Vendor ID
        data_tests:
          - not_null
      - name: SUBACCOUNT_ID
        description: Subaccount ID
        data_tests:
          - not_null
      - name: DSP
        description: Array containing DSP names
      - name: GENRE_LIST
        description: Array of preferred genre values from CRM
      - name: FAN_LANGUAGE_LIST
        description: Array of ISO 639-1 language codes normalized from CRM
      - name: LANGUAGE_ORIGINAL
        description: Raw unsplit preferred language string from CRM
      - name: BIRTH_MONTH
        description: Uppercased three-letter month name of the fan's birth date (e.g. JAN, FEB)
        data_tests:
          - accepted_values:
              values: ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC']
              # This field is nullable
      - name: COUNTRY_ISO2
        description: ISO2 Country Code
      - name: REGION_CODE
        description: Code of the region
      - name: CITY_ID
        description: ID of the fan city
      - name: REGION
        description: Name of the region
      - name: CITY
        description: Name of the fan city
      - name: CITY_COORDINATES
        description: Snowflake geography object containing coordinates
      - name: TOTAL_SPEND
        description: Monetary value
      - name: LAST_EVENT_DATE
        description: Date representing when last event took place
      - name: SEGMENT_NAME
        description: Name of the segment where fan was assigned based on scoring
        data_tests:
          - accepted_values:
              values: [ 'NEW_FANS', 'FANS_TO_WIN_BACK','CASUAL_FANS', 'ENGAGED_FANS', 'SUPER_FANS', 'SECONDARY_FANS', 'UNSEGMENTED_FANS']
              # This field is nullable
      - name: HEAVY_ROTATION
        description: Heavy Rotation Status
        data_tests:
          - accepted_values:
              values:
                - 'IN'
                - 'NOT_IN'
                - 'UNKNOWN'
              # This field is nullable
      - name: IS_PRIMARY_FAN
        description: Boolean indicating if it's primary fan or not
  - name: AUDIENCE_FILTERS_EMAIL_CAMPAIGN_DBT
    description: '{{ doc("AUDIENCE_FILTERS_EMAIL_CAMPAIGN_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - FAN_ID
            - GLOBAL_PARTICIPANT_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
      - dbt_expectations.expect_table_row_count_to_be_between:
          min_value: 1
    columns:
      - name: FAN_ID
        description: Id representing fan (SHA256 of a lowercase fan email)
        data_tests:
          - not_null
      - name: GLOBAL_PARTICIPANT_ID
        description: Id representing The Orchard Global Participant
      - name: VENDOR_ID
        description: Vendor ID
        data_tests:
          - not_null
      - name: SUBACCOUNT_ID
        description: Subaccount ID
        data_tests:
          - not_null
      - name: DSP
        description: Array containing DSP names
      - name: GENRE_LIST
        description: Array of preferred genre values from CRM
      - name: FAN_LANGUAGE_LIST
        description: Array of ISO 639-1 language codes normalized from CRM
      - name: LANGUAGE_ORIGINAL
        description: Raw unsplit preferred language string from CRM
      - name: BIRTH_MONTH
        description: Uppercased three-letter month name of the fan's birth date (e.g. JAN, FEB)
        data_tests:
          - accepted_values:
              values: ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC']
              # This field is nullable
      - name: COUNTRY_ISO2
        description: ISO2 Country Code
      - name: REGION_CODE
        description: Code of the region
      - name: REGION
        description: Name of the region
      - name: CITY_ID
        description: ID of the fan city
      - name: CITY_COORDINATES
        description: Snowflake geography object containing coordinates
      - name: TOTAL_SPEND
        description: Monetary value
      - name: LAST_EVENT_DATE
        description: Date representing when last event took place
      - name: SEGMENT_NAME
        description: Name of the segment where fan was assigned based on scoring
        data_tests:
          - accepted_values:
              values: [ 'NEW_FANS', 'FANS_TO_WIN_BACK','CASUAL_FANS', 'ENGAGED_FANS', 'SUPER_FANS', 'SECONDARY_FANS', 'UNSEGMENTED_FANS']
              # This field is nullable
      - name: HEAVY_ROTATION
        description: Heavy Rotation Status
        data_tests:
          - accepted_values:
              values:
                - 'IN'
                - 'NOT_IN'
                - 'UNKNOWN'
              # This field is nullable
      - name: IS_PRIMARY_FAN
        description: Boolean indicating if it's primary fan or not
  - name: AUDIENCE_FILTERS_CUSTOM_LIST_AD_CAMPAIGN_DBT
    description: '{{ doc("AUDIENCE_FILTERS_CUSTOM_LIST_AD_CAMPAIGN_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - FAN_ID
            - CUSTOM_LIST_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
      - dbt_expectations.expect_table_row_count_to_be_between:
          min_value: 1
    columns:
      - name: FAN_ID
        description: Id representing fan (SHA256 of a lowercase fan email)
        data_tests:
          - not_null
      - name: CUSTOM_LIST_ID
        description: Custom list id from CRM
        data_tests:
          - not_null
      - name: VENDOR_ID
        description: Vendor ID
        data_tests:
          - not_null
      - name: SUBACCOUNT_ID
        description: Subaccount ID
        data_tests:
          - not_null
      - name: DSP
        description: Array containing DSP names
      - name: GENRE_LIST
        description: Array of preferred genre values from CRM
      - name: FAN_LANGUAGE_LIST
        description: Array of ISO 639-1 language codes normalized from CRM
      - name: LANGUAGE_ORIGINAL
        description: Raw unsplit preferred language string from CRM
      - name: BIRTH_MONTH
        description: Uppercased three-letter month name of the fan's birth date (e.g. JAN, FEB)
        data_tests:
          - accepted_values:
              values: ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC']
              # This field is nullable
      - name: COUNTRY_ISO2
        description: ISO2 Country Code
      - name: REGION_CODE
        description: Code of the region
      - name: CITY_ID
        description: ID of the fan city
      - name: REGION
        description: Name of the region
      - name: CITY
        description: Name of the fan city
      - name: CITY_COORDINATES
        description: Snowflake geography object containing coordinates
      - name: LAST_EVENT_DATE
        description: Date representing when last event took place
  - name: AUDIENCE_FILTERS_CUSTOM_LIST_EMAIL_CAMPAIGN_DBT
    description: '{{ doc("AUDIENCE_FILTERS_CUSTOM_LIST_EMAIL_CAMPAIGN_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - FAN_ID
            - CUSTOM_LIST_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
      - dbt_expectations.expect_table_row_count_to_be_between:
          min_value: 1
    columns:
      - name: FAN_ID
        description: Id representing fan (SHA256 of a lowercase fan email)
        data_tests:
          - not_null
      - name: CUSTOM_LIST_ID
        description: Custom list id from CRM
        data_tests:
          - not_null
      - name: VENDOR_ID
        description: Vendor ID
        data_tests:
          - not_null
      - name: SUBACCOUNT_ID
        description: Subaccount ID
        data_tests:
          - not_null
      - name: DSP
        description: Array containing DSP names
      - name: GENRE_LIST
        description: Array of preferred genre values from CRM
      - name: FAN_LANGUAGE_LIST
        description: Array of ISO 639-1 language codes normalized from CRM
      - name: LANGUAGE_ORIGINAL
        description: Raw unsplit preferred language string from CRM
      - name: BIRTH_MONTH
        description: Uppercased three-letter month name of the fan's birth date (e.g. JAN, FEB)
        data_tests:
          - accepted_values:
              values: ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC']
              # This field is nullable
      - name: COUNTRY_ISO2
        description: ISO2 Country Code
      - name: REGION_CODE
        description: Code of the region
      - name: REGION
        description: Name of the region
      - name: CITY_ID
        description: ID of the fan city
      - name: CITY_COORDINATES
        description: Snowflake geography object containing coordinates
      - name: LAST_EVENT_DATE
        description: Date representing when last event took place
  - name: AUDIENCE_FILTERS_ARTIST_CUSTOM_LIST_AD_CAMPAIGN_UNION_DBT
    description: '{{ doc("AUDIENCE_FILTERS_ARTIST_CUSTOM_LIST_AD_CAMPAIGN_UNION_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - FAN_ID
            - GLOBAL_PARTICIPANT_ID
            - CUSTOM_LIST_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
      - dbt_utils.expression_is_true:
          expression: "custom_list_id is not null"
          config:
            where: "global_participant_id is null"
      - dbt_utils.expression_is_true:
          expression: "global_participant_id is not null"
          config:
            where: "custom_list_id is null"
      - dbt_expectations.expect_table_row_count_to_be_between:
          min_value: 1
    columns:
      - name: FAN_ID
        description: Id representing fan (SHA256 of a lowercase fan email)
        data_tests:
          - not_null
      - name: GLOBAL_PARTICIPANT_ID
        description: Id representing The Orchard Global Participant
      - name: CUSTOM_LIST_ID
        description: Id representing custom list from CRM
      - name: VENDOR_ID
        description: Vendor ID
        data_tests:
          - not_null
      - name: SUBACCOUNT_ID
        description: Subaccount ID
        data_tests:
          - not_null
      - name: DSP
        description: Array containing DSP names
      - name: GENRE_LIST
        description: Array of preferred genre values from CRM
      - name: FAN_LANGUAGE_LIST
        description: Array of ISO 639-1 language codes normalized from CRM
      - name: LANGUAGE_ORIGINAL
        description: Raw unsplit preferred language string from CRM
      - name: BIRTH_MONTH
        description: Uppercased three-letter month name of the fan's birth date (e.g. JAN, FEB)
        data_tests:
          - accepted_values:
              values: ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC']
              # This field is nullable
      - name: COUNTRY_ISO2
        description: ISO2 Country Code
      - name: REGION
        description: Name of the region
      - name: CITY
        description: Name of the fan city
      - name: CITY_COORDINATES
        description: Snowflake geography object containing coordinates
      - name: REGION_CODE
        description: Code of the region
      - name: CITY_ID
        description: ID of the fan city
      - name: TOTAL_SPEND
        description: Monetary value
      - name: LAST_EVENT_DATE
        description: Date representing when last event took place
      - name: SEGMENT_NAME
        description: Name of the segment where fan was assigned based on scoring
        data_tests:
          - accepted_values:
              values: [ 'NEW_FANS', 'FANS_TO_WIN_BACK','CASUAL_FANS', 'ENGAGED_FANS', 'SUPER_FANS', 'SECONDARY_FANS', 'UNSEGMENTED_FANS']
              # This field is nullable
      - name: HEAVY_ROTATION
        description: Heavy Rotation Status
        data_tests:
          - accepted_values:
              values:
                - 'IN'
                - 'NOT_IN'
                - 'UNKNOWN'
              # This field is nullable
      - name: IS_PRIMARY_FAN
        description: Boolean indicating if it's primary fan or not
  - name: AUDIENCE_FILTERS_ARTIST_CUSTOM_LIST_EMAIL_CAMPAIGN_UNION_DBT
    description: '{{ doc("AUDIENCE_FILTERS_ARTIST_CUSTOM_LIST_EMAIL_CAMPAIGN_UNION_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - FAN_ID
            - GLOBAL_PARTICIPANT_ID
            - CUSTOM_LIST_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
      - dbt_utils.expression_is_true:
          expression: "custom_list_id is not null"
          config:
            where: "global_participant_id is null"
      - dbt_utils.expression_is_true:
          expression: "global_participant_id is not null"
          config:
            where: "custom_list_id is null"
      - dbt_expectations.expect_table_row_count_to_be_between:
          min_value: 1
    columns:
      - name: FAN_ID
        description: Id representing fan (SHA256 of a lowercase fan email)
        data_tests:
          - not_null
      - name: GLOBAL_PARTICIPANT_ID
        description: Id representing The Orchard Global Participant
      - name: CUSTOM_LIST_ID
        description: Id representing custom list from CRM
      - name: VENDOR_ID
        description: Vendor ID
        data_tests:
          - not_null
      - name: SUBACCOUNT_ID
        description: Subaccount ID
        data_tests:
          - not_null
      - name: DSP
        description: Array containing DSP names
      - name: GENRE_LIST
        description: Array of preferred genre values from CRM
      - name: FAN_LANGUAGE_LIST
        description: Array of ISO 639-1 language codes normalized from CRM
      - name: LANGUAGE_ORIGINAL
        description: Raw unsplit preferred language string from CRM
      - name: BIRTH_MONTH
        description: Uppercased three-letter month name of the fan's birth date (e.g. JAN, FEB)
        data_tests:
          - accepted_values:
              values: ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC']
              # This field is nullable
      - name: COUNTRY_ISO2
        description: ISO2 Country Code
      - name: REGION
        description: Name of the region
      - name: CITY
        description: Name of the fan city
      - name: CITY_COORDINATES
        description: Snowflake geography object containing coordinates
      - name: TOTAL_SPEND
        description: Monetary value
      - name: LAST_EVENT_DATE
        description: Date representing when last event took place
      - name: SEGMENT_NAME
        description: Name of the segment where fan was assigned based on scoring
        data_tests:
          - accepted_values:
              values: [ 'NEW_FANS', 'FANS_TO_WIN_BACK','CASUAL_FANS', 'ENGAGED_FANS', 'SUPER_FANS', 'SECONDARY_FANS', 'UNSEGMENTED_FANS']
              # This field is nullable
      - name: HEAVY_ROTATION
        description: Heavy Rotation Status
        data_tests:
          - accepted_values:
              values:
                - 'IN'
                - 'NOT_IN'
                - 'UNKNOWN'
              # This field is nullable
      - name: IS_PRIMARY_FAN
        description: Boolean indicating if it's primary fan or not
  - name: AUDIENCE_FILTERS_TEXT_CAMPAIGN_DBT
    description: '{{ doc("AUDIENCE_FILTERS_TEXT_CAMPAIGN_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - FAN_ID
            - GLOBAL_PARTICIPANT_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
#      - dbt_expectations.expect_table_row_count_to_be_between:
#          min_value: 1
    columns:
      - name: FAN_ID
        description: Id representing fan (SHA256 of a lowercase fan email)
        data_tests:
          - not_null
      - name: GLOBAL_PARTICIPANT_ID
        description: Id representing The Orchard Global Participant
      - name: VENDOR_ID
        description: Vendor ID
        data_tests:
          - not_null
      - name: SUBACCOUNT_ID
        description: Subaccount ID
        data_tests:
          - not_null
      - name: DSP
        description: Array containing DSP names
      - name: GENRE_LIST
        description: Array of preferred genre values from CRM
      - name: FAN_LANGUAGE_LIST
        description: Array of ISO 639-1 language codes normalized from CRM
      - name: LANGUAGE_ORIGINAL
        description: Raw unsplit preferred language string from CRM
      - name: BIRTH_MONTH
        description: Uppercased three-letter month name of the fan's birth date (e.g. JAN, FEB)
        data_tests:
          - accepted_values:
              values: ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC']
              # This field is nullable
      - name: COUNTRY_ISO2
        description: ISO2 Country Code
      - name: REGION_CODE
        description: Code of the region
      - name: REGION
        description: Name of the region
      - name: CITY_ID
        description: ID of the fan city
      - name: CITY_COORDINATES
        description: Snowflake geography object containing coordinates
      - name: TOTAL_SPEND
        description: Monetary value
      - name: LAST_EVENT_DATE
        description: Date representing when last event took place
      - name: SEGMENT_NAME
        description: Name of the segment where fan was assigned based on scoring
        data_tests:
          - accepted_values:
              values: [ 'NEW_FANS', 'FANS_TO_WIN_BACK','CASUAL_FANS', 'ENGAGED_FANS', 'SUPER_FANS', 'SECONDARY_FANS', 'UNSEGMENTED_FANS']
              # This field is nullable
      - name: HEAVY_ROTATION
        description: Heavy Rotation Status
        data_tests:
          - accepted_values:
              values:
                - 'IN'
                - 'NOT_IN'
                - 'UNKNOWN'
              # This field is nullable
      - name: IS_PRIMARY_FAN
        description: Boolean indicating if it's primary fan or not
  - name: GLOBAL_AUDIENCE_FILTERS_ARTIST_AD_CAMPAIGN_DBT
    description: '{{ doc("GLOBAL_AUDIENCE_FILTERS_ARTIST_AD_CAMPAIGN_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - FAN_ID
            - GLOBAL_PARTICIPANT_ID
      - dbt_expectations.expect_table_row_count_to_be_between:
          min_value: 1
    columns:
      - name: FAN_ID
        description: Id representing fan (SHA256 of a lowercase fan email)
        data_tests:
          - not_null
      - name: GLOBAL_PARTICIPANT_ID
        description: Id representing The Orchard Global Participant
        data_tests:
          - not_null
      - name: DSP
        description: Array containing DSP names
      - name: GENRE_LIST
        description: Array of preferred genre values from CRM
      - name: FAN_LANGUAGE_LIST
        description: Array of ISO 639-1 language codes normalized from CRM
      - name: BIRTH_MONTH
        description: Uppercased three-letter month name of the fan's birth date (e.g. JAN, FEB)
        data_tests:
          - accepted_values:
              values: ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC']
              # This field is nullable
      - name: COUNTRY_ISO2
        description: ISO2 Country Code
      - name: REGION_CODE
        description: Code of the region
      - name: REGION
        description: Name of the region
      - name: CITY_ID
        description: ID of the fan city
      - name: CITY_COORDINATES
        description: Snowflake geography object containing coordinates
      - name: TOTAL_SPEND
        description: Monetary value
      - name: LAST_EVENT_DATE
        description: Date representing when last event took place
      - name: SEGMENT_NAME
        description: Name of the segment where fan was assigned based on scoring
        data_tests:
          - accepted_values:
              values: [ 'NEW_FANS', 'FANS_TO_WIN_BACK','CASUAL_FANS', 'ENGAGED_FANS', 'SUPER_FANS', 'SECONDARY_FANS', 'UNSEGMENTED_FANS']
              # This field is nullable
      - name: HEAVY_ROTATION
        description: Heavy Rotation Status
        data_tests:
          - accepted_values:
              values:
                - 'IN'
                - 'NOT_IN'
                - 'UNKNOWN'
              # This field is nullable
      - name: IS_PRIMARY_FAN
        description: Boolean indicating if it's primary fan or not
  - name: GLOBAL_AUDIENCE_FILTERS_ARTIST_EMAIL_CAMPAIGN_DBT
    description: '{{ doc("GLOBAL_AUDIENCE_FILTERS_ARTIST_EMAIL_CAMPAIGN_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - FAN_ID
            - GLOBAL_PARTICIPANT_ID
      - dbt_expectations.expect_table_row_count_to_be_between:
          min_value: 1
    columns:
      - name: FAN_ID
        description: Id representing fan (SHA256 of a lowercase fan email)
        data_tests:
          - not_null
      - name: GLOBAL_PARTICIPANT_ID
        description: Id representing The Orchard Global Participant
        data_tests:
          - not_null
      - name: DSP
        description: Array containing DSP names
      - name: GENRE_LIST
        description: Array of preferred genre values from CRM
      - name: FAN_LANGUAGE_LIST
        description: Array of ISO 639-1 language codes normalized from CRM
      - name: BIRTH_MONTH
        description: Uppercased three-letter month name of the fan's birth date (e.g. JAN, FEB)
        data_tests:
          - accepted_values:
              values: ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC']
              # This field is nullable
      - name: COUNTRY_ISO2
        description: ISO2 Country Code
      - name: REGION_CODE
        description: Code of the region
      - name: REGION
        description: Name of the region
      - name: CITY_ID
        description: ID of the fan city
      - name: CITY_COORDINATES
        description: Snowflake geography object containing coordinates
      - name: TOTAL_SPEND
        description: Monetary value
      - name: LAST_EVENT_DATE
        description: Date representing when last event took place
      - name: SEGMENT_NAME
        description: Name of the segment where fan was assigned based on scoring
        data_tests:
          - accepted_values:
              values: [ 'NEW_FANS', 'FANS_TO_WIN_BACK','CASUAL_FANS', 'ENGAGED_FANS', 'SUPER_FANS', 'SECONDARY_FANS', 'UNSEGMENTED_FANS']
              # This field is nullable
      - name: HEAVY_ROTATION
        description: Heavy Rotation Status
        data_tests:
          - accepted_values:
              values:
                - 'IN'
                - 'NOT_IN'
                - 'UNKNOWN'
              # This field is nullable
      - name: IS_PRIMARY_FAN
        description: Boolean indicating if it's primary fan or not
  - name: GLOBAL_AUDIENCE_FILTERS_ARTIST_TEXT_CAMPAIGN_DBT
    description: '{{ doc("GLOBAL_AUDIENCE_FILTERS_ARTIST_TEXT_CAMPAIGN_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - FAN_ID
            - GLOBAL_PARTICIPANT_ID
#      - dbt_expectations.expect_table_row_count_to_be_between:
#          min_value: 1
    columns:
      - name: FAN_ID
        description: Id representing fan (SHA256 of a lowercase fan email)
        data_tests:
          - not_null
      - name: GLOBAL_PARTICIPANT_ID
        description: Id representing The Orchard Global Participant
        data_tests:
          - not_null
      - name: DSP
        description: Array containing DSP names
      - name: GENRE_LIST
        description: Array of preferred genre values from CRM
      - name: FAN_LANGUAGE_LIST
        description: Array of ISO 639-1 language codes normalized from CRM
      - name: BIRTH_MONTH
        description: Uppercased three-letter month name of the fan's birth date (e.g. JAN, FEB)
        data_tests:
          - accepted_values:
              values: ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC']
              # This field is nullable
      - name: COUNTRY_ISO2
        description: ISO2 Country Code
      - name: REGION_CODE
        description: Code of the region
      - name: REGION
        description: Name of the region
      - name: CITY_ID
        description: ID of the fan city
      - name: CITY_COORDINATES
        description: Snowflake geography object containing coordinates
      - name: TOTAL_SPEND
        description: Monetary value
      - name: LAST_EVENT_DATE
        description: Date representing when last event took place
      - name: SEGMENT_NAME
        description: Name of the segment where fan was assigned based on scoring
        data_tests:
          - accepted_values:
              values: [ 'NEW_FANS', 'FANS_TO_WIN_BACK','CASUAL_FANS', 'ENGAGED_FANS', 'SUPER_FANS', 'SECONDARY_FANS', 'UNSEGMENTED_FANS']
              # This field is nullable
      - name: HEAVY_ROTATION
        description: Heavy Rotation Status
        data_tests:
          - accepted_values:
              values:
                - 'IN'
                - 'NOT_IN'
                - 'UNKNOWN'
              # This field is nullable
      - name: IS_PRIMARY_FAN
        description: Boolean indicating if it's primary fan or not
