{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openeik.org/schemas/0.4/elements/electrical.schema.json",
  "$comment": "OpenEik 0.2: folded by tools/fold-schemas.mjs from the proposal electrical, which 0.2 makes a rule (decision D5). Written by hand from the text, not generated.",
  "title": "electrical element",
  "description": "An element record of category \"electrical\" (Part XIII, 2.1): a device or a board, in the systems discipline folder. Its profile is two points, [at, toward]: at is the centre of its body in plan (a wall device's lies half its type's depth out from the wall face), and toward a point in the direction it faces. Its offset is the height above its level of a wall device's centre, a ceiling device's top face or a floor device's base. Its width and height are its type's.",
  "allOf": [
    {
      "$ref": "element.schema.json"
    },
    {
      "properties": {
        "category": {
          "const": "electrical"
        },
        "bars": false,
        "base": false,
        "bottomPlate": false,
        "cable": false,
        "connection": false,
        "edges": false,
        "electrical": {
          "type": "object",
          "properties": {
            "designation": {
              "description": "Its reference designation (IEC 81346), such as a board's.",
              "type": "string",
              "minLength": 1,
              "maxLength": 24,
              "pattern": "^[A-Za-z0-9.:+=-]+$"
            },
            "purpose": {
              "description": "What it serves, as the project's drawings code it.",
              "type": "string",
              "minLength": 1,
              "maxLength": 8,
              "x-eik-values": "national"
            },
            "power": {
              "description": "Its connected load where it differs from its type's, W.",
              "type": "number",
              "minimum": 0,
              "maximum": 1000000
            },
            "controls": {
              "description": "The elements a switch, a dimmer, a button or a sensor controls.",
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "x-eik-ref": "element"
              },
              "maxItems": 200
            },
            "circuitId": {
              "description": "The circuit that feeds it; a board's, the circuit that feeds the board.",
              "type": "string",
              "minLength": 1,
              "x-eik-ref": "circuit"
            },
            "from": {
              "description": "The device on the same circuit it is fed from; without it, its circuit's board.",
              "type": "string",
              "minLength": 1,
              "x-eik-ref": "element"
            },
            "cable": {
              "description": "The cable of the leg that feeds it, where it differs from its circuit's.",
              "$ref": "../project/circuit.schema.json#/$defs/cable"
            }
          },
          "x-eik-closed": true
        },
        "end": false,
        "endRise": false,
        "framingCorners": false,
        "framingJoints": false,
        "framingOffset": false,
        "framingStart": false,
        "framingStuds": false,
        "framingTees": false,
        "framingTop": false,
        "generic": false,
        "grading": false,
        "joins": false,
        "joints": false,
        "mep": false,
        "panels": false,
        "propertyLine": false,
        "provision": false,
        "railing": false,
        "roll": false,
        "roof": false,
        "room": false,
        "roomBounding": false,
        "sheet": false,
        "stair": false,
        "taper": false,
        "terminal": false,
        "terrain": false,
        "top": false,
        "turn": false,
        "wallOutline": false
      }
    },
    {
      "properties": {
        "declaredGeometry": {
          "properties": {
            "envelope": {
              "items": {
                "not": {
                  "required": [
                    "kind"
                  ],
                  "properties": {
                    "kind": {
                      "const": "swept"
                    }
                  }
                }
              }
            },
            "clearances": {
              "items": {
                "properties": {
                  "body": {
                    "not": {
                      "required": [
                        "kind"
                      ],
                      "properties": {
                        "kind": {
                          "const": "swept"
                        }
                      }
                    }
                  }
                }
              }
            },
            "parts": {
              "items": {
                "properties": {
                  "bodies": {
                    "items": {
                      "not": {
                        "required": [
                          "kind"
                        ],
                        "properties": {
                          "kind": {
                            "const": "swept"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    {
      "properties": {
        "declaredGeometry": {
          "properties": {
            "frame": {
              "not": {
                "const": "line"
              }
            }
          }
        }
      }
    }
  ]
}
