{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.demiton.io/registers/tendered_budget/v2.json",
  "title": "tendered_budget contract v2",
  "type": "object",
  "required": [
    "category",
    "coverage",
    "currency",
    "entity_id",
    "financial_period",
    "grand_total",
    "line_count",
    "sections",
    "source_format",
    "total"
  ],
  "properties": {
    "total": {
      "type": "number",
      "description": "The section subtotal; `grand_total` must equal their sum.",
      "x-demiton-requiredness": "required"
    },
    "lines": {
      "type": "array",
      "description": "The priced line detail: what was priced, how much, in what unit, at what rate, for what total, and the work-activity / cost-type coding where the workbook carries it.",
      "x-demiton-requiredness": "optional",
      "x-demiton-unit": "mixed (each line carries its own unit)"
    },
    "category": {
      "type": "string",
      "description": "The cost category a section total belongs to.",
      "x-demiton-requiredness": "required",
      "x-demiton-unit": "none"
    },
    "coverage": {
      "type": "string",
      "description": "`empty`)",
      "x-demiton-requiredness": "required",
      "x-demiton-unit": "`labour_only` \\"
    },
    "currency": {
      "type": "currency",
      "description": "the currency of every amount on this record (`total`, `grand_total`), an ISO 4217 alpha-3 code as the source states it. A record with no currency has no usable amount.",
      "x-demiton-requiredness": "required"
    },
    "sections": {
      "type": "array",
      "description": "The cost-category breakdown (Labour, Plant, Subcontract, Travel, Materials, Overhead on a full parse), one entry per category: category label, section total, line count, and the nested line list.",
      "x-demiton-requiredness": "required",
      "x-demiton-unit": "AUD (per section)"
    },
    "entity_id": {
      "type": "integer",
      "description": "The entity the price belongs to. Always an `opportunity` for this shelf: `doc_entity_type='opportunity'` (`baseline_squash_02_seed.sql:274`), resolved by `resolve_anchor_entity` preferring opportunity at tender stage, and the writer skips the write entirely when resolution returns None.",
      "x-demiton-requiredness": "required",
      "x-demiton-unit": "none"
    },
    "line_count": {
      "type": "integer",
      "description": "How many nested lines the section carries, so a truncated parse is detectable.",
      "x-demiton-requiredness": "required",
      "x-demiton-unit": "count"
    },
    "grand_total": {
      "type": "number",
      "description": "The whole tendered sum: the sum of every section's total.",
      "x-demiton-requiredness": "required"
    },
    "budget_hours": {
      "type": "number",
      "description": "Total labour hours behind the labour portion, for rate-per-hour and productivity checks.",
      "x-demiton-requiredness": "optional",
      "x-demiton-unit": "hours"
    },
    "job_entity_id": {
      "type": "integer",
      "description": "The project (job) entity this price prices, once the tender is won and the job exists. `entity_id` stays the opportunity; this names the job its cost is measured on. Absent until the link is made.",
      "x-demiton-requiredness": "optional"
    },
    "source_format": {
      "type": "string",
      "description": "Which parser format produced the record, so a consumer can tell a Pronamics workbook from a future parser's output.",
      "x-demiton-requiredness": "required",
      "x-demiton-unit": "none"
    },
    "financial_period": {
      "type": "string",
      "description": "The period the budget belongs to, so successive periods coexist instead of superseding one another.",
      "x-demiton-requiredness": "required",
      "x-demiton-unit": "none",
      "format": "date",
      "x-demiton-type": "date"
    },
    "labour_total_value": {
      "type": "number",
      "description": "The Labour section's subtotal, kept for labour-only consumers.",
      "x-demiton-requiredness": "optional"
    }
  },
  "x-demiton-register-type": "tendered_budget",
  "x-demiton-contract-version": "2.1.0",
  "x-demiton-store": "tenant",
  "x-demiton-axes": [
    {
      "axis": "financial_period",
      "requirement": "optional",
      "role": "context"
    }
  ],
  "x-demiton-measures": [],
  "x-demiton-provenance": {
    "standards": []
  },
  "description": "Tendered budget lines across all cost categories, from the winning estimate.",
  "x-demiton-contract-url": "https://docs.demiton.io/registers/tendered_budget/",
  "x-demiton-register-catalog": "https://docs.demiton.io/concepts/register-catalog"
}