version: 2
models:
  - name: FANS_BY_ARTIST_ACCOUNT_SEGMENT_DBT
    description: '{{ doc("FANS_BY_ARTIST_ACCOUNT_SEGMENT_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
            - SEGMENT_NAME
      - 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 from the super fan segmentation
        data_tests:
          - not_null
      - name: FANS_COUNT
        description: Count of unique fans
        data_tests:
          - not_null
#          - fans_count_equal_to_source
  - name: FANS_BY_ARTIST_ACCOUNT_SEGMENT_COUNTRY_DBT
    description: '{{ doc("FANS_BY_ARTIST_ACCOUNT_SEGMENT_COUNTRY_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
            - SEGMENT_NAME
            - 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: SEGMENT_NAME
        description: Segment from the super fan segmentation
        data_tests:
          - not_null
      - name: COUNTRY_ISO2
        description: Country code in ISO2 format
        data_tests:
          - not_null
      - name: FANS_COUNT
        description: Count of unique fans
        data_tests:
          - not_null
#          - fans_count_equal_to_source_country
  - name: FANS_BY_ARTIST_ACCOUNT_SEGMENT_COUNTRY_DAILY_DBT
    description: '{{ doc("FANS_BY_ARTIST_ACCOUNT_SEGMENT_COUNTRY_DAILY_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
            - SEGMENT_NAME
            - COUNTRY_ISO2
            - REPORT_DATE
      - 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 from the super fan segmentation
        data_tests:
          - not_null
      - name: COUNTRY_ISO2
        description: Country code in ISO2 format
        data_tests:
          - not_null
      - name: REPORT_DATE
        description: Date representing the aggregations
        data_tests:
          - not_null
      - name: FANS_COUNT
        description: Count of unique fans
        data_tests:
          - not_null
  - name: FANS_BY_ARTIST_ACCOUNT_SEGMENT_DAILY_DBT
    description: '{{ doc("FANS_BY_ARTIST_ACCOUNT_SEGMENT_DAILY_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
            - SEGMENT_NAME
            - REPORT_DATE
      - 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 from the super fan segmentation
        data_tests:
          - not_null
      - name: FANS_COUNT
        description: Count of unique fans
        data_tests:
          - not_null
  - name: QA_FANS_BY_ARTIST_ACCOUNT_SEGMENT_DBT
    description: '{{ doc("QA_FANS_BY_ARTIST_ACCOUNT_SEGMENT_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
            - SEGMENT_NAME
      - 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 from the super fan segmentation
        data_tests:
          - not_null
      - name: FANS_COUNT
        description: Count of unique fans
        data_tests:
          - not_null
#          - fans_count_equal_to_source
  - name: QA_FANS_BY_ARTIST_ACCOUNT_SEGMENT_COUNTRY_DBT
    description: '{{ doc("QA_FANS_BY_ARTIST_ACCOUNT_SEGMENT_COUNTRY_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
            - SEGMENT_NAME
            - 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: SEGMENT_NAME
        description: Segment from the super fan segmentation
        data_tests:
          - not_null
      - name: COUNTRY_ISO2
        description: Country code in ISO2 format
        data_tests:
          - not_null
      - name: FANS_COUNT
        description: Count of unique fans
        data_tests:
          - not_null
#          - fans_count_equal_to_source_country
  - name: QA_FANS_BY_ARTIST_ACCOUNT_SEGMENT_COUNTRY_DAILY_DBT
    description: '{{ doc("QA_FANS_BY_ARTIST_ACCOUNT_SEGMENT_COUNTRY_DAILY_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
            - SEGMENT_NAME
            - COUNTRY_ISO2
            - REPORT_DATE
      - 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 from the super fan segmentation
        data_tests:
          - not_null
      - name: COUNTRY_ISO2
        description: Country code in ISO2 format
        data_tests:
          - not_null
      - name: REPORT_DATE
        description: Date representing the aggregations
        data_tests:
          - not_null
      - name: FANS_COUNT
        description: Count of unique fans
        data_tests:
          - not_null
  - name: QA_FANS_BY_ARTIST_ACCOUNT_SEGMENT_DAILY_DBT
    description: '{{ doc("QA_FANS_BY_ARTIST_ACCOUNT_SEGMENT_DAILY_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
            - SEGMENT_NAME
            - REPORT_DATE
      - 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 from the super fan segmentation
        data_tests:
          - not_null
      - name: FANS_COUNT
        description: Count of unique fans
        data_tests:
          - not_null
  - name: GLOBAL_FANS_BY_ARTIST_SEGMENT_DBT
    description: '{{ doc("GLOBAL_FANS_BY_ARTIST_SEGMENT_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - SEGMENT_NAME
      - 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 from the super fan segmentation
        data_tests:
          - not_null
      - name: FANS_COUNT
        description: Count of unique fans
        data_tests:
          - not_null
#          - fans_count_equal_to_source
  - name: GLOBAL_FANS_BY_ARTIST_SEGMENT_COUNTRY_DBT
    description: '{{ doc("GLOBAL_FANS_BY_ARTIST_SEGMENT_COUNTRY_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - SEGMENT_NAME
            - 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 from the super fan segmentation
        data_tests:
          - not_null
      - name: COUNTRY_ISO2
        description: Country code in ISO2 format
        data_tests:
          - not_null
      - name: FANS_COUNT
        description: Count of unique fans
        data_tests:
          - not_null
#          - fans_count_equal_to_source_country
  - name: GLOBAL_FANS_BY_ARTIST_SEGMENT_COUNTRY_DAILY_DBT
    description: '{{ doc("GLOBAL_FANS_BY_ARTIST_SEGMENT_COUNTRY_DAILY_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - SEGMENT_NAME
            - COUNTRY_ISO2
            - REPORT_DATE
      - 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 from the super fan segmentation
        data_tests:
          - not_null
      - name: COUNTRY_ISO2
        description: Country code in ISO2 format
        data_tests:
          - not_null
      - name: REPORT_DATE
        description: Date representing the aggregations
        data_tests:
          - not_null
      - name: FANS_COUNT
        description: Count of unique fans
        data_tests:
          - not_null
  - name: GLOBAL_FANS_BY_ARTIST_SEGMENT_DAILY_DBT
    description: '{{ doc("GLOBAL_FANS_BY_ARTIST_SEGMENT_DAILY_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - SEGMENT_NAME
            - REPORT_DATE
      - 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 from the super fan segmentation
        data_tests:
          - not_null
      - name: FANS_COUNT
        description: Count of unique fans
        data_tests:
          - not_null
  - name: GLOBAL_FANS_BY_ARTIST_SEGMENT_DAILY_BACKFILL_DBT
    description: '{{ doc("GLOBAL_FANS_BY_ARTIST_SEGMENT_DAILY_BACKFILL_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - SEGMENT_NAME
            - REPORT_DATE
      - 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 from the super fan segmentation
        data_tests:
          - not_null
      - name: REPORT_DATE
        description: Date representing fan counts
        data_tests:
          - not_null
      - name: FANS_COUNT
        description: Count of unique fans
        data_tests:
          - not_null
