{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openeik.org/schemas/0.7/taskParts/task.schema.json",
  "$comment": "OpenEik 0.7: folded by tools/fold-schemas-0.7.mjs from the proposal taskParts, which 0.7 makes a rule (open questions, 168). Written by hand, not generated.",
  "title": "A task with its part of its elements",
  "description": "A task of a work schedule (Part XXII, 5.4), which may name the part of its elements it builds or takes away, by its layers' functions and by its pours, and the order its elements come in over its days (Part XXII, 5.4.2).",
  "type": "object",
  "properties": {
    "id": {
      "$ref": "../project/work-schedules.schema.json#/$defs/id"
    },
    "name": {
      "$ref": "../project/work-schedules.schema.json#/$defs/name"
    },
    "parent": {
      "$ref": "../project/work-schedules.schema.json#/$defs/id",
      "description": "The task of its schedule it is a part of (Part XXII, 5.4, rule 2)."
    },
    "kind": {
      "$ref": "../project/work-schedules.schema.json#/$defs/task/properties/kind"
    },
    "duration": {
      "$ref": "../project/work-schedules.schema.json#/$defs/task/properties/duration"
    },
    "after": {
      "$ref": "../project/work-schedules.schema.json#/$defs/task/properties/after"
    },
    "notBefore": {
      "$ref": "../project/work-schedules.schema.json#/$defs/date",
      "description": "It starts on this day or later: on its first working day on or after it at the earliest."
    },
    "elements": {
      "$ref": "../costSchedules/selection.schema.json",
      "description": "The elements it builds, installs or takes away (Part XXII, 2)."
    },
    "progressBy": {
      "$ref": "../project/work-schedules.schema.json#/$defs/task/properties/progressBy"
    },
    "actualStart": {
      "$ref": "../project/work-schedules.schema.json#/$defs/date",
      "description": "The day work on it started (Part XXII, 5.8, rule 2)."
    },
    "actualFinish": {
      "$ref": "../project/work-schedules.schema.json#/$defs/date",
      "description": "The day it was finished, to its end: it is complete (Part XXII, 5.8, rule 2)."
    },
    "built": {
      "$ref": "../project/work-schedules.schema.json#/$defs/task/properties/built"
    },
    "percent": {
      "$ref": "../project/work-schedules.schema.json#/$defs/task/properties/percent"
    },
    "classifications": {
      "$ref": "../classifications/classifications.schema.json"
    },
    "layers": {
      "type": "array",
      "minItems": 1,
      "maxItems": 5,
      "uniqueItems": true,
      "items": {
        "enum": [
          "structure",
          "substrate",
          "insulation",
          "finish",
          "membrane"
        ]
      },
      "description": "The layer functions it builds or takes away (Part XXII, 5.4.2, rule 2): of each element it keeps, the layers of its type of these functions only, each function of Part II, 5.1 once."
    },
    "pours": {
      "type": "array",
      "minItems": 1,
      "maxItems": 200,
      "uniqueItems": true,
      "items": {
        "$ref": "pours.schema.json#/$defs/id"
      },
      "description": "The pours it builds or takes away, by their ids (Part XXII, 5.4.2, rule 3): of each element it keeps, these pours only, each once; of an element that has none of them, nothing."
    },
    "order": {
      "$ref": "#/$defs/order"
    }
  },
  "required": [
    "id",
    "name"
  ],
  "x-eik-closed": true,
  "$defs": {
    "order": {
      "type": "object",
      "properties": {
        "by": {
          "enum": [
            "listed",
            "along",
            "up"
          ],
          "description": "What its elements are ordered by: listed, the order of its selection's elementIds; along, each element's place along the direction, least first; up, each element's lowest point, lowest first."
        },
        "direction": {
          "type": "array",
          "minItems": 2,
          "maxItems": 2,
          "prefixItems": [
            {
              "type": "number"
            },
            {
              "type": "number"
            }
          ],
          "description": "With by along, the direction in plan, [x, y], not both 0: given with along, and with no other by (work-order)."
        }
      },
      "required": [
        "by"
      ],
      "x-eik-closed": true,
      "description": "How its elements come over its days (Part XXII, 5.4.2, rule 10): each has its turn, the task's days shared out in this order by weight (rule 11). Absent, the task builds all its elements over all its days."
    }
  }
}
