version: 2
models:
  - name: INT_FACEBOOK_ADS__CAMPAIGN_GLOBAL_PARTICIPANT_DBT
    description: Mapping between a Campaign and a Global Participant using a fuzzy campaign name vs. artist name matching.
    tests:
      - dbt_utils.unique_combination_of_columns:
          arguments:
            combination_of_columns:
              - CAMPAIGN_ID
              - GLOBAL_PARTICIPANT_ID
    columns:
      - name: CAMPAIGN_ID
        description: Facebook Ads Campaign ID
        tests:
          - not_null
      - name: GLOBAL_PARTICIPANT_ID
        description: Global Participant ID
        tests:
          - not_null
  - name: INT_FACEBOOK_ADS__FIVETRAN_SCHEMA_ACCOUNT
    description: Mapping between a Meta Fivetran Schema name and a Vendor + Subaccount ID
    tests:
      - dbt_utils.unique_combination_of_columns:
          arguments:
            combination_of_columns:
              - FIVETRAN_SCHEMA
              - AD_ACCOUNT_ID
              - VENDOR_ID
              - SUBACCOUNT_ID
    columns:
      - name: FIVETRAN_SCHEMA
        description: Fivetran Schema
        tests:
          - not_null
      - name: AD_ACCOUNT_ID
        description: Meta Ad Account ID
        tests:
          - not_null
      - name: VENDOR_ID
        description: Vendor ID
        tests:
          - not_null
      - name: SUBACCOUNT_ID
        description: Subaccount ID
        tests:
          - not_null
      - name: VENDOR_NAME
        description: Vendor Name
        tests:
          - not_null
      - name: BRAND_NAME
        description: Brand name of the Vendor
        tests:
          - not_null
  - name: INT_FACEBOOK_ADS__AD_SET_TARGETING_LOCATIONS_DBT
    description: Targeting Locations for Ad Sets
    tests:
      - dbt_utils.unique_combination_of_columns:
          arguments:
            combination_of_columns:
              - SOURCE_SCHEMA
              - AD_SET_ID
    columns:
      - name: SOURCE_SCHEMA
        description: Fivetran Schema
        tests:
          - not_null
      - name: AD_SET_ID
        description: Ad Set ID
        tests:
          - not_null
      - name: CAMPAIGN_ID
        description: Campaign ID
        tests:
          - not_null
      - name: COUNTRIES
        description: Targeting Countries ISO-2 country codes
        tests:
          - not_null
  - name: INT_FACEBOOK_ADS__AD_VIEWS_DBT
    description: Number of views for a given Facebook Ad on a given day
    tests:
      - dbt_utils.unique_combination_of_columns:
          arguments:
            combination_of_columns:
              - SOURCE_SCHEMA
              - AD_ID
              - REPORT_DATE
              - _FIVETRAN_ID
    columns:
      - name: SOURCE_SCHEMA
        description: Fivetran Schema
        tests:
          - not_null
      - name: AD_ID
        description: Ad ID
        tests:
          - not_null
      - name: REPORT_DATE
        description: Date Day
        tests:
          - not_null
      - name: _FIVETRAN_ID
        description: Hashed combination of breakdown columns to help join secondary tables
        tests:
          - not_null
      - name: VIEWS_P25
        description: The number of times a video was played at 25% of its length.
        tests:
          - not_null
      - name: VIEWS_THRUPLAY
        description: The number of times a video was played to completion or at least 15 seconds
        tests:
          - not_null
  - name: INT_FACEBOOK_ADS__AD_VIEWS_COUNTRY_DBT
    description: Number of views for a given Facebook Ad on a given day split by country
    tests:
      - dbt_utils.unique_combination_of_columns:
          arguments:
            combination_of_columns:
              - SOURCE_SCHEMA
              - AD_ID
              - REPORT_DATE
              - _FIVETRAN_ID
    columns:
      - name: SOURCE_SCHEMA
        description: Fivetran Schema
        tests:
          - not_null
      - name: AD_ID
        description: Ad ID
        tests:
          - not_null
      - name: REPORT_DATE
        description: Date Day
        tests:
          - not_null
      - name: _FIVETRAN_ID
        description: Hashed combination of breakdown columns to help join secondary tables
        tests:
          - not_null
      - name: VIEWS_P25
        description: The number of times a video was played at 25% of its length.
        tests:
          - not_null
      - name: VIEWS_THRUPLAY
        description: The number of times a video was played to completion or at least 15 seconds
        tests:
          - not_null
  - name: INT_FACEBOOK_ADS__AD_PURCHASES_DBT
    description: Number of purchases for a given Facebook Ad on a given day
    tests:
      - dbt_utils.unique_combination_of_columns:
          arguments:
            combination_of_columns:
              - SOURCE_SCHEMA
              - AD_ID
              - REPORT_DATE
              - _FIVETRAN_ID
    columns:
      - name: SOURCE_SCHEMA
        description: Fivetran Schema
        tests:
          - not_null
      - name: AD_ID
        description: Ad ID
        tests:
          - not_null
      - name: REPORT_DATE
        description: Date Day
        tests:
          - not_null
      - name: _FIVETRAN_ID
        description: Hashed combination of breakdown columns to help join secondary tables
        tests:
          - not_null
      - name: PURCHASES
        description: The number purchases made
        tests:
          - not_null
  - name: INT_FACEBOOK_ADS__AD_PURCHASES_COUNTRY_DBT
    description: Number of purchases for a given Facebook Ad on a given day split by country
    tests:
      - dbt_utils.unique_combination_of_columns:
          arguments:
            combination_of_columns:
              - SOURCE_SCHEMA
              - AD_ID
              - REPORT_DATE
              - _FIVETRAN_ID
    columns:
      - name: SOURCE_SCHEMA
        description: Fivetran Schema
        tests:
          - not_null
      - name: AD_ID
        description: Ad ID
        tests:
          - not_null
      - name: REPORT_DATE
        description: Date Day
        tests:
          - not_null
      - name: _FIVETRAN_ID
        description: Hashed combination of breakdown columns to help join secondary tables
        tests:
          - not_null
      - name: PURCHASES
        description: The number purchases made
        tests:
          - not_null
  - name: INT_FACEBOOK_ADS__AVAILABLE_SOURCE_SCHEMAS_DBT
    description: Names of Fivetran source schemas that have a minimal available set of tables to show them in Ad reporting
    columns:
      - name: SOURCE_SCHEMA
        description: Fivetran Schema
        tests:
          - not_null
          - unique
  - name: INT_FACEBOOK_ADS__AD_ACTIONS_DBT
    description: Facebook Ads Actions per schema, ad, report_date
    tests:
      - dbt_utils.unique_combination_of_columns:
          arguments:
            combination_of_columns:
              - SOURCE_SCHEMA
              - AD_ID
              - REPORT_DATE
              - _FIVETRAN_ID
    columns:
      - name: SOURCE_SCHEMA
        description: Fivetran Schema
        tests:
          - not_null
      - name: AD_ID
        description: Ad ID
        tests:
          - not_null
      - name: REPORT_DATE
        description: Date Day
        tests:
          - not_null
      - name: _FIVETRAN_ID
        description: Hashed combination of breakdown columns to help join secondary tables
        tests:
          - not_null
      - name: POST_SHARES
        description: The number of post shares
        tests:
          - not_null
      - name: POST_REACTIONS
        description: The number of post reactions
        tests:
          - not_null
      - name: PAGE_LIKES
        description: The number of page likes
        tests:
          - not_null
      - name: POST_COMMENTS
        description: The number of post comments
        tests:
          - not_null
  - name: INT_FACEBOOK_ADS__AD_ACTIONS_COUNTRY_DBT
    description: Facebook Ads Actions per schema, ad, report_date, fivetran_id
    tests:
      - dbt_utils.unique_combination_of_columns:
          arguments:
            combination_of_columns:
              - SOURCE_SCHEMA
              - AD_ID
              - REPORT_DATE
              - _FIVETRAN_ID
    columns:
      - name: SOURCE_SCHEMA
        description: Fivetran Schema
        tests:
          - not_null
      - name: AD_ID
        description: Ad ID
        tests:
          - not_null
      - name: REPORT_DATE
        description: Date Day
        tests:
          - not_null
      - name: _FIVETRAN_ID
        description: fivetran ID
        tests:
          - not_null
      - name: POST_SHARES
        description: The number of post shares
        tests:
          - not_null
      - name: POST_REACTIONS
        description: The number of post reactions
        tests:
          - not_null
      - name: PAGE_LIKES
        description: The number of page likes
        tests:
          - not_null
      - name: POST_COMMENTS
        description: The number of post comments
        tests:
          - not_null
