{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.demiton.io/registers/platform_contractor_stats/v2.json",
  "title": "platform_contractor_stats contract v2",
  "type": "object",
  "required": [
    "contract_count_3yr",
    "contractor_abn",
    "contractor_entity_id",
    "currency",
    "last_win_date",
    "observed_at",
    "series_key",
    "source_dataset",
    "total_awarded_3yr",
    "value_basis",
    "window_end",
    "window_start"
  ],
  "properties": {
    "content": {
      "type": "string",
      "description": "Human-readable narrative label, e.g. \"<name>: $X across N contracts (3yr)\".",
      "x-demiton-requiredness": "optional"
    },
    "currency": {
      "type": "currency",
      "description": "the currency of every amount on this record (`total_awarded_3yr`), an ISO 4217 alpha-3 code as the source states it. A record with no currency has no usable amount.",
      "x-demiton-requiredness": "required"
    },
    "tax_basis": {
      "type": "string",
      "description": "`unstated`)",
      "x-demiton-requiredness": "optional",
      "x-demiton-unit": "`exclusive` \\"
    },
    "abn_source": {
      "type": "string",
      "description": "—",
      "x-demiton-requiredness": "optional",
      "x-demiton-unit": "`provisional`)"
    },
    "series_key": {
      "type": "string",
      "description": "The semantic supersede identity, `platform_contractor_stats\\",
      "x-demiton-requiredness": "required"
    },
    "window_end": {
      "type": "string",
      "description": "Last day of the window (= the run date, `observed_at`).",
      "x-demiton-requiredness": "required",
      "x-demiton-unit": "ISO 8601",
      "format": "date",
      "x-demiton-type": "date"
    },
    "observed_at": {
      "type": "string",
      "description": "Run time at which the rollup was computed; drives freshness ordering.",
      "x-demiton-requiredness": "required",
      "x-demiton-unit": "ISO 8601",
      "format": "date-time",
      "x-demiton-type": "datetime"
    },
    "value_basis": {
      "type": "string",
      "description": "What kind of money the measure is: awarded contract value, latest revision per contract — not a sum of award facts.",
      "x-demiton-requiredness": "required"
    },
    "revenue_band": {
      "type": "string",
      "description": "`mid` \\",
      "x-demiton-requiredness": "optional",
      "x-demiton-unit": "`small` \\"
    },
    "window_start": {
      "type": "string",
      "description": "First day of the rolling window the totals cover.",
      "x-demiton-requiredness": "required",
      "x-demiton-unit": "ISO 8601",
      "format": "date",
      "x-demiton-type": "date"
    },
    "last_win_date": {
      "type": "string",
      "description": "Date of the most recent award in the window.",
      "x-demiton-requiredness": "required",
      "x-demiton-unit": "ISO 8601",
      "format": "date",
      "x-demiton-type": "date"
    },
    "state_primary": {
      "type": "string",
      "description": "The single most frequent state among the window's awards. Same entity/fact split as `states_active`.",
      "x-demiton-requiredness": "optional",
      "x-demiton-unit": "ISO 3166-2:AU subdivision"
    },
    "states_active": {
      "type": "array",
      "description": "States the contractor's awards in the window belong to. Written to `PlatformEntity.attributes` today, not to the fact.",
      "x-demiton-requiredness": "optional",
      "x-demiton-unit": "ISO 3166-2:AU subdivision"
    },
    "contractor_abn": {
      "type": "string",
      "description": "The CONTRACTOR_ABN axis: the contractor identity the rollup is keyed and superseded on. A real ABN where the publisher supplied one, otherwise a minted `demiton-c-<sha16>` name key.",
      "x-demiton-requiredness": "required"
    },
    "source_dataset": {
      "type": "string",
      "description": "Producer identity, `contractor_stats_aggregator`.",
      "x-demiton-requiredness": "required"
    },
    "top_agency_names": {
      "type": "array",
      "description": "Up to 5 buyer names with the most awards in the window.",
      "x-demiton-requiredness": "optional"
    },
    "top_unspsc_codes": {
      "type": "array",
      "description": "Up to 5 category codes with the most awards in the window.",
      "x-demiton-requiredness": "optional",
      "x-demiton-unit": "UNSPSC code"
    },
    "total_awarded_3yr": {
      "type": "number",
      "description": "Sum, across the distinct contracts in the window, of each contract's latest observed award value.",
      "x-demiton-requiredness": "required",
      "x-demiton-type": "decimal"
    },
    "contract_count_3yr": {
      "type": "integer",
      "description": "Count of distinct contracts (by `ocid`, else fact id) with an award in the window.",
      "x-demiton-requiredness": "required",
      "x-demiton-unit": "dimensionless"
    },
    "contractor_entity_id": {
      "type": "integer",
      "description": "The civil-pipeline spine identity the rollup belongs to; also the producer's in-memory aggregation key.",
      "x-demiton-requiredness": "required"
    },
    "derived_from_fact_count": {
      "type": "integer",
      "description": "Number of award facts scanned to produce the row; provenance for the rollup.",
      "x-demiton-requiredness": "optional"
    }
  },
  "x-demiton-register-type": "platform_contractor_stats",
  "x-demiton-contract-version": "2.0.1",
  "x-demiton-store": "platform",
  "x-demiton-axes": [
    {
      "axis": "contractor_abn",
      "requirement": "required",
      "role": "context"
    },
    {
      "axis": "series",
      "requirement": "required",
      "role": "context"
    }
  ],
  "x-demiton-measures": [
    {
      "key": "total_awarded_3yr",
      "accumulation": "instantaneous",
      "dtype": "decimal",
      "unit": "by_coordinate"
    },
    {
      "key": "contract_count_3yr",
      "accumulation": "instantaneous",
      "dtype": "integer",
      "unit": "dimensionless"
    }
  ],
  "x-demiton-provenance": {
    "standards": [
      {
        "code": "ABN",
        "title": "Australian Business Number - Australian Business Register (ABN Lookup)",
        "access": "public_summary",
        "region": "Australia",
        "edition": "current register",
        "checked_on": "2026-09-14"
      },
      {
        "code": "CPRs",
        "title": "Commonwealth Procurement Rules",
        "access": "public_summary",
        "region": "Australia",
        "edition": "17 November 2025",
        "checked_on": "2026-09-14"
      },
      {
        "code": "OC4IDS",
        "title": "Open Contracting for Infrastructure Data Standard",
        "access": "full_text_verified",
        "region": "International",
        "edition": "0.9.5 (site switcher shows 0.9.4; unresolved)",
        "checked_on": "2026-09-14"
      },
      {
        "code": "OCDS",
        "title": "Open Contracting Data Standard",
        "access": "full_text_verified",
        "region": "International",
        "edition": "1.1 (documentation release 1.1.5)",
        "checked_on": "2026-09-14"
      },
      {
        "code": "UNSPSC",
        "title": "United Nations Standard Products and Services Code",
        "access": "public_summary",
        "region": "International",
        "edition": "v26.0801 (Sep 2025, per secondary source)",
        "checked_on": "2026-09-14"
      }
    ]
  },
  "description": "Per-contractor statistics rolled up from awarded contracts.",
  "x-demiton-contract-url": "https://docs.demiton.io/registers/platform_contractor_stats/",
  "x-demiton-register-catalog": "https://docs.demiton.io/concepts/register-catalog"
}