name: 'pingcap_lakehouse'
version: '1.0.0'
profile: 'pingcap_lakehouse'

# Project root is transform/dbt/. Models are organised by the source they read FROM
# (sources/<source>/models/...) and by the product they produce (products/<product>/models/...),
# per the config-driven-clean-structure principle. Generic engine config (macros, tests)
# lives under engine/.
model-paths: ["sources", "products"]
seed-paths: ["seeds", "sources/googlesheets/seeds"]
macro-paths: ["engine/macros"]
test-paths: ["engine/tests"]
analysis-paths: ["engine/analyses"]
clean-targets: ["target", "dbt_packages"]

vars:
  # Carried over from the BigQuery project (digital_bi_dbt) — the customer-key policy cutoff.
  surrogate_key_cutoff: '2026-05-13'

# Databend has no schema layer: dbt's `schema` maps to the Databend database (relations render
# as `schema.identifier`). generate_schema_name is overridden to use the custom schema verbatim,
# so these +schema values are the literal target databases.
models:
  pingcap_lakehouse:
    +materialized: view          # default; individual models override via {{ table_config(...) }}
    +schema: transform_dbt_stg   # staging layer database (default for sources/*/models)
    # Warehouse-layer products land in the dwh database:
    salesforce_orgs:
      +schema: transform_dbt_dwh
    salesforce_accounts:
      +schema: transform_dbt_dwh
    customer_surrogate_keys:
      +schema: transform_dbt_dwh
    customers:
      +schema: transform_dbt_dwh
    salesforce_org_monthly_revrec:
      +schema: transform_dbt_dwh
    # order_daily_view chain
    date_spine:
      +schema: transform_dbt_dwh
    salesforce_opportunities:
      +schema: transform_dbt_dwh
    cloud_revenue:
      +schema: transform_dbt_dwh
    salesforce_revrec:
      +schema: transform_dbt_dwh
    salesforce_orders:
      +schema: transform_dbt_dwh
    salesforce_order_daily_view:
      +schema: transform_dbt_dwh

seeds:
  pingcap_lakehouse:
    # Seeds land in a neutral database both engines (dbt + Task Flow) read from, so the
    # Task Flow build does not hidden-depend on `dbt seed` having run first.
    +schema: transform_seeds
