version: 2

models:

  - name: STREAMS_BY_PARTICIPANT_TRACK_PLAYLIST_COUNTRY_FEED_DISTRIBUTOR_DAILY_RECENT_DBT
    description:
      A table containing number of streams and metadata on a participant / track / playlist / country level.
    tests:
      - unique:
          column_name: "concat(global_participant_id, '-', track_id, '-',  playlist_id, '-',  country_code, '-', feed_id, '-', distributor, '-', download_activity_date)"
    columns:
      - name: global_participant_id
        tests:
          - not_null
      - name: track_id
        tests:
          - not_null
      - name: playlist_id
        tests:
          - not_null
      - name: country_code
        tests:
          - not_null
      - name: feed_id
        tests:
          - not_null
      - name: download_activity_date
        tests:
          - not_null
      - name: distributor
        tests:
          - not_null
      - name: store_playlist_id
        tests:
          - not_null
      - name: store_id
        tests:
          - not_null
      - name: product_id
        tests:
          - not_null
      - name: isrc
        tests:
          - not_null
      - name: playlist_name
      - name: playlist_url
        tests:
          - not_null
      - name: playlist_image
      - name: playlist_type_name
      - name: streams
        tests:
          - not_null

  - name: STREAMS_BY_PARTICIPANT_TRACK_PLAYLIST_COUNTRY_FEED_DISTRIBUTOR_DAILY_HISTORY_DBT
    description:
      A table containing number of streams and metadata on a participant / track / playlist / country level.
    config:
      tags: history
    tests:
      - unique:
          column_name: "concat(global_participant_id, '-', track_id, '-',  playlist_id, '-',  country_code, '-', feed_id, '-', distributor, '-', download_activity_date)"
    columns:
      - name: global_participant_id
        tests:
          - not_null
      - name: track_id
        tests:
          - not_null
      - name: playlist_id
        tests:
          - not_null
      - name: country_code
        tests:
          - not_null
      - name: feed_id
        tests:
          - not_null
      - name: download_activity_date
        tests:
          - not_null
      - name: distributor
        tests:
          - not_null
      - name: store_playlist_id
        tests:
          - not_null
      - name: store_id
        tests:
          - not_null
      - name: product_id
        tests:
          - not_null
      - name: isrc
        tests:
          - not_null
      - name: playlist_name
      - name: playlist_url
        tests:
          - not_null
      - name: playlist_image
      - name: playlist_type_name
      - name: streams
        tests:
          - not_null
