{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.demiton.io/registers/tender_pricing_verdict/v1.json",
  "title": "tender_pricing_verdict contract v1",
  "type": "object",
  "required": [
    "currency",
    "evidence_fact_ids",
    "input_mismatch",
    "input_version_basis",
    "project_entity_id",
    "state",
    "variation_basis",
    "week_start",
    "weeks_in_breach",
    "work_activity"
  ],
  "properties": {
    "cause": {
      "type": "string",
      "description": "the largest positive cost effect; absent when none is positive",
      "enum": [
        "rate",
        "norm",
        "quantity",
        "preliminaries",
        "escalation",
        "bought"
      ],
      "x-demiton-requiredness": "optional"
    },
    "state": {
      "type": "string",
      "description": "whether the activity is inside the band or in breach",
      "enum": [
        "inside",
        "breach"
      ],
      "x-demiton-requiredness": "required"
    },
    "currency": {
      "type": "currency",
      "description": "the currency of every amount on this record (`priced_amount`, `priced_unit_cost`, `committed_cost`, `actual_cost`, `forecast_to_complete`, `variation_amount`), an ISO 4217 alpha-3 code. A record with no currency has no usable amount.",
      "x-demiton-requiredness": "required"
    },
    "qty_ratio": {
      "type": "number",
      "description": "quantity built over quantity priced; absent when either is",
      "x-demiton-requiredness": "optional"
    },
    "norm_ratio": {
      "type": "number",
      "description": "hours per unit achieved over hours per unit priced; absent when either is",
      "x-demiton-requiredness": "optional"
    },
    "priced_qty": {
      "type": "number",
      "description": "the tendered quantity",
      "x-demiton-requiredness": "optional"
    },
    "rate_ratio": {
      "type": "number",
      "description": "rate paid over rate priced; absent when either is",
      "x-demiton-requiredness": "optional"
    },
    "week_start": {
      "type": "string",
      "description": "the Monday of the week the run measured",
      "x-demiton-requiredness": "required",
      "format": "date",
      "x-demiton-type": "date"
    },
    "actual_cost": {
      "type": "number",
      "description": "posted cost, over the mapped cost codes",
      "x-demiton-requiredness": "optional"
    },
    "complete_pct": {
      "type": "number",
      "description": "the share of the activity complete, from 0 to 1",
      "x-demiton-requiredness": "optional"
    },
    "priced_hours": {
      "type": "number",
      "description": "the tendered hours",
      "x-demiton-requiredness": "optional"
    },
    "input_version": {
      "type": "integer",
      "description": "the `tender_input` version in force on the tender's date, or absent when there was none",
      "x-demiton-requiredness": "optional"
    },
    "priced_amount": {
      "type": "number",
      "description": "the activity's tendered total",
      "x-demiton-requiredness": "optional"
    },
    "work_activity": {
      "type": "string",
      "description": "the activity measured",
      "x-demiton-requiredness": "required"
    },
    "committed_cost": {
      "type": "number",
      "description": "open orders not yet received, over the mapped cost codes",
      "x-demiton-requiredness": "optional"
    },
    "input_mismatch": {
      "type": "boolean",
      "description": "true when the tendered rate or norm differs from that version by more than 2%",
      "x-demiton-requiredness": "required"
    },
    "skipped_reason": {
      "type": "string",
      "description": "why the activity could not be measured; required when it could not",
      "enum": [
        "no_price_linked",
        "no_confirmed_map",
        "no_actuals",
        "variation_job_level"
      ],
      "x-demiton-requiredness": "optional"
    },
    "variation_basis": {
      "type": "string",
      "description": "where variations were netted: the job, or the activity",
      "enum": [
        "job",
        "activity"
      ],
      "x-demiton-requiredness": "required"
    },
    "weeks_in_breach": {
      "type": "integer",
      "description": "consecutive weeks the activity's ratios have been outside the band",
      "x-demiton-requiredness": "required"
    },
    "priced_unit_cost": {
      "type": "number",
      "description": "the tendered rate per unit of quantity",
      "x-demiton-requiredness": "optional"
    },
    "variation_amount": {
      "type": "number",
      "description": "accepted variations netted out, at the level `variation_basis` names",
      "x-demiton-requiredness": "optional"
    },
    "evidence_fact_ids": {
      "type": "array",
      "description": "the facts the measurement read: the price, the map, the cost and progress facts",
      "x-demiton-requiredness": "required"
    },
    "project_entity_id": {
      "type": "integer",
      "description": "the project measured",
      "x-demiton-requiredness": "required"
    },
    "input_version_basis": {
      "type": "string",
      "description": "how the version was chosen: by the tender's date, or none in force",
      "enum": [
        "dated",
        "none"
      ],
      "x-demiton-requiredness": "required"
    },
    "forecast_to_complete": {
      "type": "number",
      "description": "the position divided by `complete_pct`, floored at the position",
      "x-demiton-requiredness": "optional"
    }
  },
  "x-demiton-register-type": "tender_pricing_verdict",
  "x-demiton-contract-version": "1.0.0",
  "x-demiton-store": "tenant",
  "x-demiton-axes": [],
  "x-demiton-measures": [],
  "x-demiton-provenance": {
    "standards": []
  },
  "description": "The Tender pricing verdict register contract, version 1. JSON Schema (draft 2020-12); x-demiton-* keywords carry Demiton's own meaning and standard validators ignore them.",
  "x-demiton-contract-url": "https://docs.demiton.io/registers/tender_pricing_verdict/",
  "x-demiton-register-catalog": "https://docs.demiton.io/concepts/register-catalog"
}