
# 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: 'bi_dev'
version: '1.0.0'
config-version: 2

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

# These configurations specify where dbt should look for different types of files.
# The `source-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"]

target-path: "target"  # directory which will store compiled SQL files
clean-targets:         # directories to be removed by `dbt clean`
  - "target"
  - "dbt_packages"

vars:
  cost_optimization_reprocess_days: 120
  surrogate_key_cutoff: '2026-05-13'
  cloud_ru_reprocess_days: 35
  ga4_event_funnel_reprocess_days: 30
  expensive_test_recent_days: 14

seeds:
  bi_dev:
    digital_bi_dbt:
      +schema: seeds
      +domain: seeds

snapshots:
  bi_dev:
    digital_bi_dbt:
      +schema: snapshots
      +domain: snapshots

# 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 tables. These settings can be overridden in the individual model files
# using the `{{ config(...) }}` macro.
models:
  bi_dev:
    # Applies to all files under models/example/
    intermediate:
      +enabled: true
      +schema: dbt_develop
      aws_billing:
        +materialized: view

    staging:
      +enabled: true
      +schema: dbt_develop
      aws_billing:
        +materialized: view

    all_cloud_account_cost:
      +schema: billing

    aws_market_place:
      +schema: aws_marketplace_datafeed

    billing:
      +schema: model_billing

    billing_v2:
      +schema: model_billing

    bo:
      +schema: bo

    cloud_monthly_revrec_confirm_v3:
      +schema: model_of_monthly_cloud_revrec_confirm
      +enabled: false

    dbaas_billing:
      +schema: model_dbaas_billing

    dp:
      +schema: dp

    fp_and_a:
      +schema: model_fp_and_a

    fp_and_a_netsuite:
      +schema: model_fp_and_a

    kingdee_in_jindie_folder:
      +schema: jindie

    model_plg:
      +schema: model_plg

    monitor_prod_billing_usage_change:
      +schema: model_billing

    msp_subclient_billing:
      +schema: model_msp_subclient_billing

    non_prod_billing_breakdown:
      +schema: billing

    salesforce:
      +schema: model_salesforce_and_fenxiangxiaoke

    tidbcloud:
      +schema: model_tidbcloud

    zendesk:
      +schema: zendesk

    digital_bi_dbt:
      # Default migrated digital BI models to expiring scratch relations; only models
      # that call table_config() clear this in dev/prod and are persisted there.
      +hours_to_expiration: 1
      +enabled: true
      +materialized: view
      +persist_docs:
        columns: true
      marts:
        +tags: ["dws"]
        +docs:
          node_color: "#31aae0"
        business_operations:
          +tags: ["bo", "operations", "business_operations"]
          +schema: dws_business_operations
        marketing:
          +tags: ["marketing"]
          +schema: dws_marketing
      analytics:
        +tags: ["anls"]
        +docs:
          node_color: "#31aae0"
        business_operations:
          +tags: ["bo", "operations", "business_operations"]
          +schema: anls_business_operations
        core:
          +tags: ["core"]
          +schema: anls_core
        marketing:
          +tags: ["marketing"]
          +schema: anls_marketing
        cloud:
          +tags: ["cloud", "tidb_cloud"]
          +schema: anls_cloud
      warehouse:
        +tags: ["dwh"]
        +docs:
          node_color: "#b4b528"
        business_operations:
          +tags: ["ops"]
          +schema: dwh_business_operations
        core:
          +tags: ["core"]
          +schema: dwh_core
        cloud_platform:
          +tags: ["cloud_platform", "tidb_cloud"]
          +schema: dwh_cloud_platform
        finance:
          +tags: ["finance"]
          +schema: dwh_finance
          monthly_cloud_billing:
            +tags: ["monthly"]
        marketing:
          +tags: ["marketing"]
          +schema: dwh_marketing
        plg:
          +tags: ["plg"]
          +schema: dwh_plg
        sales:
          +tags: ["sales", "restricted"]
          +schema: dwh_sales
        temp:
          +enabled: false
          +tags: ["temp"]
          +schema: dwh_temp
      staging:
        +tags: ["stg"]
        +docs:
          node_color: "#eaab4c"
        cloud_billing:
          +tags: ["cloud_billing", "finance", "tidb_cloud"]
          +schema: stg_cloud_billing
        core:
          +tags: ["core"]
          +schema: stg_core
        fp_and_a:
          +tags: ["fp_and_a"]
          +schema: stg_fp_and_a
        ga4:
          +tags: ["ga4", "google_analytics_4"]
          +schema: stg_ga4
        googlesheets:
          +tags: ["googlesheets"]
          +schema: stg_googlesheets
        salesforce:
          +tags: ["salesforce"]
          +schema: stg_salesforce
        metadb:
          +tags: ["metadb"]
          +schema: stg_metadb
        mixpanel:
          +tags: ["mixpanel"]
          +schema: stg_mixpanel
        netsuite:
          +tags: ["netsuite"]
          +schema: stg_netsuite
        prometheus:
          +tags: ["prometheus"]
          +schema: stg_prometheus
        misc:
          +tags: ["misc_staging"]
          +schema: stg_misc
        slack:
          +tags: ["slack", "restricted"]
          +schema: stg_slack
        temp:
          +tags: ["temp_staging"]
          +schema: stg_temp
        vm_metrics:
          +tags: ["vm_metrics"]
          +schema: stg_vm_metrics
    

  tidbcloud:
    schema: tidbcloud
    +enabled: true

  # dbaas_billing:
  #   +schema: dbaas_billing
  #   search_path: ["dbaas_billing", "tidbcloud"]
        
