{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.demiton.io/registers/tender_input/v1.json",
  "title": "tender_input contract v1",
  "type": "object",
  "required": [
    "accepted_at",
    "accepted_by_user_id",
    "basis",
    "evidence_fact_ids",
    "kind",
    "state",
    "unit",
    "value",
    "version",
    "work_activity"
  ],
  "properties": {
    "jobs": {
      "type": "array",
      "description": "the job references behind the value, for a reader who does not follow the fact ids",
      "x-demiton-requiredness": "optional"
    },
    "kind": {
      "type": "string",
      "description": "what the value is: a unit rate, a productivity norm (hours per unit), or an allowance",
      "enum": [
        "rate",
        "norm",
        "allowance"
      ],
      "x-demiton-requiredness": "required"
    },
    "unit": {
      "type": "string",
      "description": "the unit of `value`, as the estimator states it (`h/m2`, `$/h`, `%`)",
      "x-demiton-requiredness": "required"
    },
    "basis": {
      "type": "string",
      "description": "why the value is what it is, in one line: the lesson and the jobs it rests on, or the source of a first value",
      "x-demiton-requiredness": "required"
    },
    "state": {
      "type": "string",
      "description": "whether this version is the one in force",
      "enum": [
        "accepted",
        "retired"
      ],
      "x-demiton-requiredness": "required"
    },
    "value": {
      "type": "number",
      "description": "the input's value at this version, in `unit`",
      "x-demiton-requiredness": "required"
    },
    "version": {
      "type": "integer",
      "description": "the version number, from 1, counted per organisation, work activity and kind",
      "x-demiton-requiredness": "required"
    },
    "currency": {
      "type": "currency",
      "description": "the currency of every amount on this record (`value`, when `kind` is a money rate), an ISO 4217 alpha-3 code. A record with no currency has no usable amount. Absent for a norm or a percentage.",
      "x-demiton-requiredness": "optional"
    },
    "lesson_id": {
      "type": "string",
      "description": "the lesson that produced this version, when one did",
      "x-demiton-requiredness": "optional"
    },
    "accepted_at": {
      "type": "string",
      "description": "when the version was signed",
      "x-demiton-requiredness": "required",
      "format": "date-time",
      "x-demiton-type": "datetime"
    },
    "work_activity": {
      "type": "string",
      "description": "the work activity the input prices, in the organisation's own activity vocabulary",
      "x-demiton-requiredness": "required"
    },
    "evidence_fact_ids": {
      "type": "array",
      "description": "the facts the value rests on, at least one",
      "x-demiton-requiredness": "required",
      "minItems": 1
    },
    "accepted_by_user_id": {
      "type": "integer",
      "description": "the person who signed the version",
      "x-demiton-requiredness": "required"
    }
  },
  "x-demiton-register-type": "tender_input",
  "x-demiton-contract-version": "1.0.0",
  "x-demiton-store": "tenant",
  "x-demiton-axes": [],
  "x-demiton-measures": [],
  "x-demiton-provenance": {
    "standards": []
  },
  "description": "The Tender input 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_input/",
  "x-demiton-register-catalog": "https://docs.demiton.io/concepts/register-catalog"
}