version: 2

sources:
  - name: data_foundation_finance
    description: >
      Raw snapshots from the `data_foundation_finance` finance data hub (a TiDB database, a
      different org from nexuscrm), loaded TiDB Cloud -> S3 -> Databend by
      ingestion/load/s3_bulk_load (owns the raw-snapshot contract per ADR 0016; manifest path).
      This hub is the upstream system for managed cloud revenue tables. `monthly_cloud_revrec`
      remains the cloud rev-rec ledger behind finance.cloud_revenue. It is not sufficient by
      itself for strict Revenue__c parity in salesforce_order_daily_view (#16); that parity input
      comes from the one-off salesforce_raw Revenue__c snapshot.
    schema: data_foundation_finance_raw
    tables:
      - name: monthly_cloud_revrec
        identifier: data_foundation_finance_monthly_cloud_revrec_snapshots
        description: >
          Cloud monthly rev-rec ledger. Grain: one row per (revrec_number, bill_month) per
          reporting snapshot (estimate then actual restatements live as separate rows within a
          snapshot; staging dedups to the actual). adjusted_revenue_amount reconciles to the SF
          Revenue__c adjusted amount and revenue_amount to the pre-adjust amount (~99% to the cent).
      - name: salesforce_account
        identifier: data_foundation_finance_salesforce_account_snapshots
        description: >
          Finance data hub's Salesforce account mirror. Used as a source-faithful supplement for
          account metadata that is blank in NexusCRM snapshots but populated in the legacy finance
          source, such as account region for monthly revrec parity.
