version: 2
models:
  - name: FANS_BY_ARTIST_ACCOUNT_HEAVY_ROTATION_DAILY_WIDE_DBT
    description: '{{ doc("FANS_BY_ARTIST_ACCOUNT_HEAVY_ROTATION_DAILY_WIDE_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
            - 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: REPORT_DATE
        description: Date representing the aggregations
        data_tests:
          - not_null
      - name: HEAVY_ROTATION_FANS_COUNT
        description: Nr of fans per date in heavy rotation
        data_tests:
          - not_null
      - name: FILLED_DAILY_RUNNING_TOTAL_FANS_COUNT
        description: Overall nr of fans per date
        data_tests:
          - not_null
      - name: FILLED_DAILY_RUNNING_AE_FANS_COUNT
        description: Nr of fans per date based on AE data after forward filling
        data_tests:
          - not_null
      - name: NOT_HEAVY_ROTATION_FANS_COUNT
        description: Based on DAILY_RUNNING_AE_FANS_COUNT - HEAVY_ROTATION_FANS_COUNT
        data_tests:
          - not_null
      - name: UNKNOWN_FANS_COUNT
        description: Based on DAILY_RUNNING_TOTAL_FANS_COUNT - DAILY_RUNNING_AE_FANS_COUNT
        data_tests:
          - not_null
  - name: FANS_BY_ARTIST_ACCOUNT_HEAVY_ROTATION_DAILY_COUNTRY_WIDE_DBT
    description: '{{ doc("FANS_BY_ARTIST_ACCOUNT_HEAVY_ROTATION_DAILY_COUNTRY_WIDE_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
            - 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: 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: HEAVY_ROTATION_FANS_COUNT
        description: Nr of fans per date in heavy rotation
        data_tests:
          - not_null
      - name: FILLED_DAILY_RUNNING_TOTAL_FANS_COUNT
        description: Overall nr of fans per date
        data_tests:
          - not_null
      - name: FILLED_DAILY_RUNNING_AE_FANS_COUNT
        description: Nr of fans per date based on AE data after forward filling
        data_tests:
          - not_null
      - name: NOT_HEAVY_ROTATION_FANS_COUNT
        description: Based on DAILY_RUNNING_AE_FANS_COUNT - HEAVY_ROTATION_FANS_COUNT
        data_tests:
          - not_null
      - name: UNKNOWN_FANS_COUNT
        description: Based on DAILY_RUNNING_TOTAL_FANS_COUNT - DAILY_RUNNING_AE_FANS_COUNT
        data_tests:
          - not_null
  - name: ARTIST_ACCOUNT_UNIQUE_HEAVY_ROTATION_DATES_DBT
    description: '{{ doc("ARTIST_ACCOUNT_UNIQUE_HEAVY_ROTATION_DATES_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
            - AVAILABLE_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: AVAILABLE_DATE
        description: Date when heavy rotation took place
        data_tests:
          - not_null
      - name: AVAILABLE_YYYYMM
        description: Date when heavy rotation took place in year month format only.
        data_tests:
          - not_null
  - name: FANS_BY_ARTIST_ACCOUNT_AE_EVENTS_DAILY_DBT
    description: '{{ doc("FANS_BY_ARTIST_ACCOUNT_AE_EVENTS_DAILY_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
            - FIRST_AE_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: FIRST_AE_DATE
        description: Date used for aggregation
        data_tests:
          - not_null
      - name: DAILY_RUNNING_AE_FANS_COUNT
        description: Nr of fans per day
        data_tests:
          - not_null
  - name: FANS_BY_ARTIST_ACCOUNT_AE_EVENTS_DBT
    description: '{{ doc("FANS_BY_ARTIST_ACCOUNT_AE_EVENTS_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
            - FAN_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: FAN_ID
        description: unique fan identifier
        data_tests:
          - not_null
      - name: FIRST_AE_DATE
        description: First AE activity date for that fan
        data_tests:
          - not_null
      - name: COUNTRY_ISO2
        description: Country code in ISO2 format
  - name: FANS_BY_ARTIST_ACCOUNT_ALL_HEAVY_ROTATIONS_DBT
    description: '{{ doc("FANS_BY_ARTIST_ACCOUNT_ALL_HEAVY_ROTATIONS_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
            - FAN_ID
            - COUNTRY_ISO2
            - HEAVY_ROTATION_DATE
            - PERIOD
      - 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: FAN_ID
        description: unique fan identifier
        data_tests:
          - not_null
      - name: HEAVY_ROTATION_DATE
        description: TBA
        data_tests:
          - not_null
      - name: COUNTRY_ISO2
        description: Country code in ISO2 format
      - name: PERIOD_VALUE
        description: TBA
        data_tests:
          - not_null
      - name: PERIOD
        description: TBA
        data_tests:
          - not_null
  - name: FANS_BY_ARTIST_ACCOUNT_COUNTRY_AE_EVENTS_DAILY_DBT
    description: '{{ doc("FANS_BY_ARTIST_ACCOUNT_COUNTRY_AE_EVENTS_DAILY_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - VENDOR_ID
            - SUBACCOUNT_ID
            - COUNTRY_ISO2
            - FIRST_AE_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: FIRST_AE_DATE
        description: TBA
        data_tests:
          - not_null
      - name: COUNTRY_ISO2
        description: Country code in ISO2 format
        data_tests:
          - not_null
      - name: DAILY_RUNNING_AE_FANS_COUNT
        description: TBA
        data_tests:
          - not_null
  - name: GLOBAL_FANS_BY_ARTIST_AE_EVENTS_DAILY_DBT
    description: '{{ doc("GLOBAL_FANS_BY_ARTIST_AE_EVENTS_DAILY_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - FIRST_AE_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: FIRST_AE_DATE
        description: Date used for aggregation
        data_tests:
          - not_null
      - name: DAILY_RUNNING_AE_FANS_COUNT
        description: Nr of fans per day
        data_tests:
          - not_null
  - name: GLOBAL_FANS_BY_ARTIST_COUNTRY_AE_EVENTS_DAILY_DBT
    description: '{{ doc("GLOBAL_FANS_BY_ARTIST_COUNTRY_AE_EVENTS_DAILY_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - COUNTRY_ISO2
            - FIRST_AE_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: FIRST_AE_DATE
        description: TBA
        data_tests:
          - not_null
      - name: COUNTRY_ISO2
        description: Country code in ISO2 format
        data_tests:
          - not_null
      - name: DAILY_RUNNING_AE_FANS_COUNT
        description: TBA
        data_tests:
          - not_null
  - name: GLOBAL_FANS_BY_ARTIST_HEAVY_ROTATION_DAILY_COUNTRY_WIDE_DBT
    description: '{{ doc("GLOBAL_FANS_BY_ARTIST_HEAVY_ROTATION_DAILY_COUNTRY_WIDE_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - 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: 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: HEAVY_ROTATION_FANS_COUNT
        description: Nr of fans per date in heavy rotation
        data_tests:
          - not_null
      - name: FILLED_DAILY_RUNNING_TOTAL_FANS_COUNT
        description: Overall nr of fans per date
        data_tests:
          - not_null
      - name: FILLED_DAILY_RUNNING_AE_FANS_COUNT
        description: Nr of fans per date based on AE data after forward filling
        data_tests:
          - not_null
      - name: NOT_HEAVY_ROTATION_FANS_COUNT
        description: Based on DAILY_RUNNING_AE_FANS_COUNT - HEAVY_ROTATION_FANS_COUNT
        data_tests:
          - not_null
      - name: UNKNOWN_FANS_COUNT
        description: Based on DAILY_RUNNING_TOTAL_FANS_COUNT - DAILY_RUNNING_AE_FANS_COUNT
        data_tests:
          - not_null
  - name: GLOBAL_FANS_BY_ARTIST_HEAVY_ROTATION_DAILY_WIDE_DBT
    description: '{{ doc("GLOBAL_FANS_BY_ARTIST_HEAVY_ROTATION_DAILY_WIDE_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - GLOBAL_PARTICIPANT_ID
            - 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: REPORT_DATE
        description: Date representing the aggregations
        data_tests:
          - not_null
      - name: HEAVY_ROTATION_FANS_COUNT
        description: Nr of fans per date in heavy rotation
        data_tests:
          - not_null
      - name: FILLED_DAILY_RUNNING_TOTAL_FANS_COUNT
        description: Overall nr of fans per date
        data_tests:
          - not_null
      - name: FILLED_DAILY_RUNNING_AE_FANS_COUNT
        description: Nr of fans per date based on AE data after forward filling
        data_tests:
          - not_null
      - name: NOT_HEAVY_ROTATION_FANS_COUNT
        description: Based on DAILY_RUNNING_AE_FANS_COUNT - HEAVY_ROTATION_FANS_COUNT
        data_tests:
          - not_null
      - name: UNKNOWN_FANS_COUNT
        description: Based on DAILY_RUNNING_TOTAL_FANS_COUNT - DAILY_RUNNING_AE_FANS_COUNT
        data_tests:
          - not_null

  - name: INT_AE_EVENTS_KEY_SPLIT_DBT
    description: '{{ doc("INT_AE_EVENTS_KEY_SPLIT_DBT") }}'
