
# Name your project! Project names should contain only lowercase characters
# and underscores. A good package name should reflect your organization's
# name or the intended use of these models
name: 'dbt_audience'
version: '1.0.0'
require-dbt-version: ">=1.10.0"
config-version: 2

# This setting configures which "profile" dbt uses for this project.
profile: 'dbt_audience'

# These configurations specify where dbt should look for different types of files.
# The `model-paths` config, for example, states that models in this project can be
# found in the "models/" directory. You probably won't need to change these!
model-paths: ["models"]
analysis-paths: ["analyses"]
test-paths: ["tests"]
seed-paths: ["seeds"]
macro-paths: ["macros"]
snapshot-paths: ["snapshots"]
packages-install-path: "{{ env_var('DBT_PACKAGES_INSTALL_PATH', 'dbt_packages') }}"

clean-targets:         # directories to be removed by `dbt clean`
  - "target"
  - "dbt_packages"

flags:
  require_explicit_package_overrides_for_builtin_materializations: false
  source_freshness_run_project_hooks: True

# Configuring models
# Full documentation: https://docs.getdbt.com/docs/configuring-models

vars:
  valid_dsps:
    - SPOTIFY
    - APPLE
    - YOUTUBE
    - DEEZER
    - AMAZON
  ae_invalid_activities:
    - CUSTOM
    - FACEBOOK
    - DEPRECATEDFACEBOOK
  heavy_rotation_activities:
    - 13704 # Apple Music for Artist
    - 4315 # Spotify for Artist
    - 4516 # Spotify for Track
  segmentation_features:
    - order_line
    - order
    - 1002
    - 1003
    - 1004
    - 13702
    - 13703
    - 13704
    - 1373
    - 21876
    - 3936
    - 3937
    - 4077
    - 4082
    - 4083
    - 4084
    - 12450
    - 21876
    - 4301
    - 4315
    - 13703
    - 3939
    - 4316
    - 4704
    - 4830
    - 999
    - 4204
    - 4205
    - 4206
    - 4207
    - 4208
    - 4209
    - 4210
  first_date_events_for_segmentation:
    - campaign
    - newsletter
    - presave
    - native_presave
    - ticket_purchase
    - email_click
    - email_open
    - order
    - order_line
    - artist_tracking
    - ticket_click
    - artist_optin
    - rsvp
  acquisition_channels:
    - APPRECIATION_ENGINE
    - FILE_UPLOAD_TOOL
    - SMF_BESPOKE_ACTIVATION
    - SMF_UNCATEGORIZED
    - SMF_PLAYLIST_GENERATOR_SPOTIFY_LIBRARY_SCAN
    - SMF_PLAYLIST_GENERATOR_QUIZ
    - SMF_SOCIAL_SIGNUP_FORM_COMBO
    - SMF_NEWSLETTER_SIGNUP
    - SMF_FAN_CARD_ACTIVATION
    - SMF_GENERAL_PRESAVE
    - SMF_GIVEAWAY
    - TICKETING
    - TUNESPEAK
    - WYNG
    - SHOPIFY
    - MAKE_THE_LINK
    - MIGRATION
    - FEATURE_FM
    - SPOTIFY_SONY_MUSIC_NOW
    - PREVIOUS_MAILING_LIST
    - SMS_CAMPAIGNS
    - SEATED_LIST
    - BANDSINTOWN_LIST
    - INTERNAL_SONY_LIST_TRANSFER
    - LINKFIRE
    - MAESTRO_LIST
    - WEBSITE
    - PAST_PURCHASERS
    - SQWAD
    - LEVELLR
    - MEDALLION
    - EVENT_SHOP
  fileupload_countries_to_ignore:
    - BE
    - NL
    - LU
    - DE
    - DK
    - CH
    - AT
    - HU
    - NO
    - PT
    - ES
    - BR
    - IN
    - KR
    - TW
  acquisition_channels_to_ignore:
    - 'seed list'
    - 'test upload'
    - 'b2b list'
  ae_country_codes_to_ignore:
    - 'KR'
  audience_countries_to_ignore:
    - 'HU'
    - 'IN'
    - 'CN'
  new_fan_date: '30 DAYS'
  heavy_rotation_rolling_days: '30 DAYS'
  disallowed_link_clicks:
    - '%view.emails.sonymusicfans.com/view_email%'
    - '%view.emails.sonymusicnow.com/view_email%'
    - '%view.emails.theorchard.com/view_email%'
    - '%sonymusicentertainment.secure.force.com/prefcenter%'
    - '%www.sonymusic.com/privacy-policy%'
    - '%www.sonymusic.com/terms-and-conditions%'
    - '%www.sonymusic.com/how-we-use-your-data%'
    - '%www.sonymusic.com/ccpa-contact-form%'
  crm_artist_id_for_pr_test:
    - a0K61000001Jre8EAC # First Aid Kit
    - a0K2400000KyYrPEAV # Russell Dickerson
  crm_custom_list_id_for_pr_test:
    - a0K0800000kR6NSEA0 # Legacy Vinyl
  spotify_id_for_pr_test:
    - 21egYD1eInY6bGFcniCRT1 # First Aid Kit
    - 1E2AEtxaFaJtH0lO7kgNKw # Russell Dickerson
  global_participant_for_pr_test:
    - 72eed2bc-b608-445a-9fc4-e9cf67a48c42 # First Aid Kit
    - b049ce12-49de-4d33-86b2-22ead49027ff # Russell Dickerson
  fans_are_also_listening_to_timeframe: '30 DAYS'
  segment_names:
    - FANS_TO_WIN_BACK
    - CASUAL_FANS
    - ENGAGED_FANS
    - SUPER_FANS
  songwhip_ae_business_units:
    - Songwhip_All
  sendgrid_disallowed_link_clicks:
    - '%qa-preferences.theorchard.io%'
    - '%utm_source=fs_email_footer%'
    - '%fan-preferences.sonymusic.com%'
  artists_without_fan_age:
    - af4ec2bc-c9e3-482f-94de-ef8eea4c0958 # My Little Pony
    - b1066bb0-14c8-4ef7-9bd8-7357084b4e9b # Menudo
# dummy values used for manual segment back filling
  bf_short_dt:
    - '1099-12-24'
  bf_gp_id:
    - xyz
  bf_vendor:
    - 123
  bf_subaccount:
    - 0
  bf_date_limit:
    - '1099-12-24 00:00:00'

# In this example config, we tell dbt to build all models in the example/ directory
# as tables. These settings can be overridden in the individual model files
# using the `{{ config(...) }}` macro.

models:
  elementary:
    +enabled: "{{ target.name in ['prod','qa'] }}"
  dbt_audience:
      backfill:
        +enabled: false
        +materialized: table
        +tags:
          - "backfill"
      event_ingestion:
        +materialized: table
        +tags:
          - "event_ingestion"
          - "global_segmentation"
          - "segmentation"
          - "core"
          - "dashboard"
          - "audience_filter"
          - "segmentation_qa"
        dummy_data:
          +tags:
            - "dummy_data"
        event_deletion:
          +tags:
            - "event_deletion"
      account:
        +materialized: table
        +tags:
          - "account"
      custom_list:
        +materialized: table
        +tags:
          - "custom_list"
      roster:
        +materialized: table
        +tags:
          - "roster"
      roster_views:
        +materialized: view
        +schema: "{{ 'views' if target.schema.lower() in ['qa', 'prod'] else None }}"
        +tags:
          - "roster_views"
      artist:
        +materialized: table
        +tags:
          - "dashboard"
      artist_views:
        +materialized: view
        +schema: "{{ 'views' if target.schema.lower() in ['qa', 'prod'] else None }}"
        +tags:
          - "artist_views"
      audience:
        +materialized: table
        +tags:
          - "audience_filter"
      core:
        +materialized: table
        +tags:
          - "core"
          - "dashboard"
          - "audience_filter"
      global_segmentation:
        +materialized: table
        +tags:
          - "global_segmentation"
      segmentation:
        +materialized: table
        +tags:
          - "segmentation"
      segmentation_qa:
        +materialized: table
        +tags:
          - "segmentation_qa"
      songwhip:
        +materialized: table
        +tags:
          - "songwhip"
      crm_campaign:
        +materialized: table
        +tags:
          - "crm_campaign"
          - "audience_filter"
      crm_sublist:
        +materialized: table
        +tags:
          - "crm_sublist"
          - "audience_filter"

seeds:
    dbt_audience:
      core:
        +tags:
          - "core"
          - "dashboard"
          - "audience_filter"
      event_ingestion:
        +tags:
          - "event_ingestion"
          - "segmentation"
          - "core"
          - "dashboard"
          - "audience_filter"
          - "segmentation_qa"
      segmentation:
        +tags:
          - "segmentation_qa"
          - "segmentation"
