{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openeik.org/schemas/0.3/classifications/classifications.schema.json",
  "$comment": "OpenEik 0.3: folded by tools/fold-schemas-0.3.mjs from the proposal estimate, which 0.3 makes a rule (open questions, 116). Written by hand, not generated.",
  "title": "A record's classification references, cost codes among them",
  "description": "Section 11's classification references (Part II, 11), each of which may also be a cost code (Part II, 11.1, rule 3): the quantity it is priced by, the size it is for, and on a pipe's or a duct's type the item of its runs it prices. One reference is not carried twice; the list's order has no meaning.",
  "type": "array",
  "minItems": 1,
  "maxItems": 100,
  "uniqueItems": true,
  "items": {
    "$ref": "#/$defs/reference"
  },
  "$defs": {
    "reference": {
      "type": "object",
      "properties": {
        "system": {
          "description": "The classification system, by its name or a URI: a cost book's.",
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "code": {
          "description": "A code of the system.",
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "edition": {
          "description": "The system's edition.",
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "uri": {
          "description": "The code's URI, as its publisher gives it: an absolute URI (RFC 3986).",
          "type": "string",
          "minLength": 3,
          "maxLength": 2000,
          "pattern": "^[A-Za-z][A-Za-z0-9+.-]*:[^\\s]+$"
        },
        "measure": {
          "description": "The quantity the code is priced by (Part II, 11.1, rule 3); absent, the quantity the reader prices the record's category by.",
          "enum": [
            "area",
            "areaGross",
            "length",
            "count",
            "volume",
            "mass"
          ]
        },
        "size": {
          "description": "The size the code is for, as the drawings write it (110, 400×200); a code without one is for every size that has none.",
          "type": "string",
          "minLength": 1,
          "maxLength": 20
        },
        "item": {
          "description": "On a pipe's or a duct's type: what of its runs the code prices besides the runs themselves.",
          "enum": [
            "bend",
            "branch",
            "reduction",
            "transition",
            "insulation"
          ]
        },
        "angle": {
          "description": "A bend's angle, in degrees, on a code whose item is bend.",
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 180
        },
        "insulation": {
          "description": "The insulation code of the runs whose own insulation the code prices, on a code whose item is insulation.",
          "type": "string",
          "minLength": 1,
          "maxLength": 12
        },
        "includes": {
          "description": "What the runs' own code prices with their length, on a code with no item.",
          "type": "array",
          "minItems": 1,
          "maxItems": 2,
          "uniqueItems": true,
          "items": {
            "enum": [
              "fittings",
              "insulation"
            ]
          }
        }
      },
      "required": [
        "system",
        "code"
      ],
      "x-eik-closed": true
    }
  }
}
