# 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: "analytics"
version: "1.0.0"

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

# 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"]

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

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

# In this example config, we tell dbt to build all models in the example/
# directory as views. These settings can be overridden in the individual model
# files using the `{{ config(...) }}` macro.
models:
  analytics:
    # Default materializations
    +materialized: view
    # +persist_docs:
    #   relation: true
    #   columns: true

    # Schema configuration based on environment
    raw:
      +schema: "prod_raw"
      +materialized: view
      +tags: ["dbt"]
    staging:
      +schema: "prod_stg"
      +materialized: view
      +tags: ["dbt"]
      aggregated:
        +tags: ["dbt"]
      backend_events:
        +tags: ["dbt"]
      segment_events:
        +tags: ["dbt"]
      cleaned:
        +tags: ["dbt"]
      rds:
        +tags: ["dbt"]
    intermediate:
      +schema: "prod_int"
      +materialized: ephemeral
      +tags: ["dbt"]
      core:
        +tags: ["dbt"]
    marts:
      +schema: "prod_marts"
      +materialized: table
      +tags: ["dbt"]
      hooks:
        +schema: "prod"
    exports:
      +schema: "prod_exports"
      +materialized: view
      +tags: ["dbt"]

snapshots:
  analytics:
    +schema: "snapshots"
    +tags: ["dbt", "snapshot"]
    rds_snapshots:
      +schema: "rds_snapshots"

flags:
  require_explicit_package_overrides_for_builtin_materializations: false

vars:
  # Partition variables
  partition_start_date: "{{ env_var('DBT_TEST_PARTITION_START_DATE', '1900-01-01') }}"
  partition_end_date: "{{ env_var('DBT_TEST_PARTITION_END_DATE', '9999-12-31') }}"
  partition_start_hour: "{{ env_var('DBT_TEST_PARTITION_START_HOUR', 0) }}"
  partition_end_hour: "{{ env_var('DBT_TEST_PARTITION_END_HOUR', 23) }}"

  # Example .env file for testing partition variables (for e.g. 2025-11-13 11am partition)
  #
  # DBT_TEST_PARTITION_START_DATE=2025-11-13
  # DBT_TEST_PARTITION_END_DATE=2025-11-13
  # DBT_TEST_PARTITION_START_HOUR=11
  # DBT_TEST_PARTITION_END_HOUR=12
  #
  # This will select only data for 2025-11-13 11:00:00 - 11:59:59

  # Custom variables
  external_s3_env: SUNO_PROD.PROD # For external tables by deafult always use PROD, if you want to use STAGING, set it to SUNO_STAGING.STAGING
  orpheus_project_start_date: "2025-10-01"
  create_session_timeout_minutes: 30  # Session timeout for both Studio and Orpheus (30 minutes of inactivity)
  studio_project_start_date: "2025-10-23"  # Earliest Studio backend events date
  suno_platforms: ["web", "ios", "android"]
  recs_ranker:
    start_date: '2025-09-17'
    min_hooks_per_user: 3
    max_hooks_per_user: 10000
