version: 2

models:
  - name: stg_trreb__purchases
    description: "Staged TRREB purchase/sales data from fact_purchases"
    columns:
      - name: purchase_id
        description: "Unique identifier for purchase record"
        tests:
          - unique
          - not_null
      - name: date_key
        description: "Date dimension key (YYYYMMDD)"
        tests:
          - not_null
      - name: district_key
        description: "TRREB district dimension key"
        tests:
          - not_null

  - name: stg_cmhc__rentals
    description: "Staged CMHC rental market data from fact_rentals"
    columns:
      - name: rental_id
        description: "Unique identifier for rental record"
        tests:
          - unique
          - not_null
      - name: date_key
        description: "Date dimension key (YYYYMMDD)"
        tests:
          - not_null
      - name: zone_key
        description: "CMHC zone dimension key"
        tests:
          - not_null

  - name: stg_dimensions__time
    description: "Staged time dimension"
    columns:
      - name: date_key
        description: "Date dimension key (YYYYMMDD)"
        tests:
          - unique
          - not_null

  - name: stg_dimensions__trreb_districts
    description: "Staged TRREB district dimension"
    columns:
      - name: district_key
        description: "District dimension key"
        tests:
          - unique
          - not_null
      - name: district_code
        description: "TRREB district code (e.g., W01, C01)"
        tests:
          - unique
          - not_null

  - name: stg_dimensions__cmhc_zones
    description: "Staged CMHC zone dimension"
    columns:
      - name: zone_key
        description: "Zone dimension key"
        tests:
          - unique
          - not_null
      - name: zone_code
        description: "CMHC zone code"
        tests:
          - unique
          - not_null
