version: 2

sources:
  - name: nexuscrm
    description: >
      nexuscrm (a parallel Salesforce instance) raw snapshots, loaded from TiDB Cloud → S3 →
      Databend by ingestion/load/s3_bulk_load (owns the raw-snapshot contract per ADR 0016).
      These replace the BigQuery Fivetran `salesforce.*` sources from the digital_bi_dbt project.
    schema: nexuscrm_raw
    tables:
      - name: org__c
        identifier: nexuscrm_org__c_snapshots
        description: Salesforce custom object Org__c — the org↔tenant mapping (ID__c = tenant_id).
      - name: account
        identifier: nexuscrm_account_snapshots
        description: Salesforce Account.
      - name: order
        identifier: nexuscrm_order_snapshots
        description: Salesforce Order.
      - name: opportunity
        identifier: nexuscrm_opportunity_snapshots
        description: Salesforce Opportunity.
      - name: order_product
        identifier: nexuscrm_order_product__c_snapshots
        description: >
          Salesforce custom order line object Order_Product__c — the authoritative line source
          (same object the BigQuery model uses, and what nexuscrm's own Order rollups
          Overall_*_Date__c / Net_Fees__c read from). The earlier detour to the standard OrderItem
          object (taken because the migration left Order_Product__c unpopulated) is reverted now
          that the dropped base columns (Net_fees__c, Service_Start/End_Date__c, Term_Months__c,
          Product__c) were backfilled from the legacy Fivetran→BigQuery mirror (2026-05-31, #17).
      - name: product2
        identifier: nexuscrm_product2_snapshots
        description: Salesforce Product2.
      # Revenue__c removed: empty at source in NexusCRM (#15). Historical revenue parity comes
      # from a one-off salesforce_raw Revenue__c snapshot (#16); the go-forward process is #19.
