version: 2

models:

  - name: STREAMS_BY_PARTICIPANT_TRACK_FEED_DISTRIBUTOR_DAILY_HISTORY_DBT
    description:
      A table containing number of streams, source of streams, skips and saves metrics for global participants on a
      date / feedid level
    config:
      tags: history
    tests:
      - unique:
          column_name: "concat(global_participant_id, '-', download_activity_date, '-', product_id, '-', isrc, '-', feed_id, '-', distributor)"
    columns:
      - name: global_participant_id
        tests:
          - not_null
      - name: download_activity_date
        tests:
          - not_null
      - name: feed_id
        tests:
          - not_null
      - name: distributor
        tests:
          - not_null
      - name: store_id
        tests:
          - not_null
      - name: product_id
        tests:
          - not_null
      - name: isrc
        tests:
          - not_null
      - name: streams
        tests:
          - not_null
      - name: skips
      - name: saves
      - name: streams_passive
        tests:
          - not_null
      - name: streams_active
        tests:
          - not_null
      - name: streams_collection
        tests:
          - not_null
      - name: streams_sos_spotify_collection
        tests:
          - not_null
      - name: streams_sos_spotify_playqueue
        tests:
          - not_null
      - name: streams_sos_spotify_albumpage
        tests:
          - not_null
      - name: streams_sos_spotify_artistpage
        tests:
          - not_null
      - name: streams_sos_spotify_search
        tests:
          - not_null
      - name: streams_sos_spotify_playlists
        tests:
          - not_null
      - name: streams_sos_spotify_releaseradar
        tests:
          - not_null
      - name: streams_sos_spotify_discoverweekly
        tests:
          - not_null
      - name: streams_sos_spotify_radio
        tests:
          - not_null
      - name: streams_sos_spotify_dailymix
        tests:
          - not_null
      - name: streams_sos_spotify_chart
        tests:
          - not_null
      - name: streams_sos_spotify_other
        tests:
          - not_null
      - name: streams_sos_apple_library
        tests:
          - not_null
      - name: streams_sos_apple_external
        tests:
          - not_null
      - name: streams_sos_apple_voice
        tests:
          - not_null
      - name: streams_sos_apple_search
        tests:
          - not_null
      - name: streams_sos_apple_musickit
        tests:
          - not_null
      - name: streams_sos_apple_nowplaying
        tests:
          - not_null
      - name: streams_sos_apple_discovery
        tests:
          - not_null
      - name: streams_sos_apple_other
        tests:
          - not_null
      - name: streams_sos_amazon_userplaylist
        tests:
          - not_null
      - name: streams_sos_amazon_songs
        tests:
          - not_null
      - name: streams_sos_amazon_album
        tests:
          - not_null
      - name: streams_sos_amazon_artist
        tests:
          - not_null
      - name: streams_sos_amazon_search
        tests:
          - not_null
      - name: streams_sos_amazon_playlist
        tests:
          - not_null
      - name: streams_sos_amazon_station
        tests:
          - not_null

  - name: STREAMS_BY_PARTICIPANT_TRACK_FEED_DISTRIBUTOR_DAILY_RECENT_DBT
    description:
      A table containing number of streams, source of streams, skips and saves metrics for global participants on a
      date / feedid level
    tests:
      - unique:
          column_name: "concat(global_participant_id, '-', download_activity_date, '-', product_id, '-', isrc, '-', feed_id, '-', distributor)"
    columns:
      - name: global_participant_id
        tests:
          - not_null
      - name: download_activity_date
        tests:
          - not_null
      - name: feed_id
        tests:
          - not_null
      - name: distributor
        tests:
          - not_null
      - name: store_id
        tests:
          - not_null
      - name: product_id
        tests:
          - not_null
      - name: isrc
        tests:
          - not_null
      - name: streams
        tests:
          - not_null
      - name: skips
      - name: saves
      - name: streams_passive
        tests:
          - not_null
      - name: streams_active
        tests:
          - not_null
      - name: streams_collection
        tests:
          - not_null
      - name: streams_sos_spotify_collection
        tests:
          - not_null
      - name: streams_sos_spotify_playqueue
        tests:
          - not_null
      - name: streams_sos_spotify_albumpage
        tests:
          - not_null
      - name: streams_sos_spotify_artistpage
        tests:
          - not_null
      - name: streams_sos_spotify_search
        tests:
          - not_null
      - name: streams_sos_spotify_playlists
        tests:
          - not_null
      - name: streams_sos_spotify_releaseradar
        tests:
          - not_null
      - name: streams_sos_spotify_discoverweekly
        tests:
          - not_null
      - name: streams_sos_spotify_radio
        tests:
          - not_null
      - name: streams_sos_spotify_dailymix
        tests:
          - not_null
      - name: streams_sos_spotify_chart
        tests:
          - not_null
      - name: streams_sos_spotify_other
        tests:
          - not_null
      - name: streams_sos_apple_library
        tests:
          - not_null
      - name: streams_sos_apple_external
        tests:
          - not_null
      - name: streams_sos_apple_voice
        tests:
          - not_null
      - name: streams_sos_apple_search
        tests:
          - not_null
      - name: streams_sos_apple_musickit
        tests:
          - not_null
      - name: streams_sos_apple_nowplaying
        tests:
          - not_null
      - name: streams_sos_apple_discovery
        tests:
          - not_null
      - name: streams_sos_apple_other
        tests:
          - not_null
      - name: streams_sos_amazon_userplaylist
        tests:
          - not_null
      - name: streams_sos_amazon_songs
        tests:
          - not_null
      - name: streams_sos_amazon_album
        tests:
          - not_null
      - name: streams_sos_amazon_artist
        tests:
          - not_null
      - name: streams_sos_amazon_search
        tests:
          - not_null
      - name: streams_sos_amazon_playlist
        tests:
          - not_null
      - name: streams_sos_amazon_station
        tests:
          - not_null

