# =============================================================================
# dbt_project.yml
# FinOps Cloud Billing Analytics - dbt Project Configuration
# =============================================================================

name: 'finops_cloud_billing'
version: '1.0.0'
config-version: 2

profile: 'finops_cloud_billing'

# Model paths
model-paths: ["models"]
analysis-paths: ["analyses"]
test-paths: ["tests"]
seed-paths: ["seeds"]
macro-paths: ["macros"]
snapshot-paths: ["snapshots"]
asset-paths: ["assets"]

# Target schema for compiled SQL and artifacts
target-path: "target"
clean-targets:
  - "target"
  - "dbt_packages"

# =============================================================================
# Project Variables
# =============================================================================
vars:
  # MVP Phase 1: CUR 2.0 data starts from 2025-10-01
  billing_start_date: '2025-10-01'
  # GCP billing export start date
  gcp_billing_start_date: '2026-01-01'
  # Incremental marts: number of months to look back for late-arriving corrections
  mart_lookback_months: 3
  # Daily mart: number of days to look back for late-arriving corrections
  mart_daily_lookback_days: 14

# =============================================================================
# Model Configurations
# =============================================================================
models:
  finops_cloud_billing:
    # Staging Layer: 1:1 clean from source, preserve all rows
    staging:
      +materialized: view

    # Intermediate Layer: Filter to usage rows, add calculated fields
    intermediate:
      +materialized: view

    # Marts Layer: Aggregated tables for analytics
    marts:
      +materialized: table
      core:
        +materialized: table
        mart_cost_monthly:
          +tags: ['usw2']
        mart_cost_summary:
          +tags: ['usw2']
        mart_gcp_cost_monthly:
          +tags: ['us']
        mart_gcp_cost_summary:
          +tags: ['us']
        mart_alibaba_cost_monthly:
          +tags: ['usw2']
        mart_alibaba_cost_summary:
          +tags: ['usw2']
        mart_cost_daily:
          +tags: ['usw2']
