{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openeik.org/schemas/0.1/proposed/electrical/types/electrical.schema.json",
  "$comment": "Proposed for OpenEik 0.2: Part XIII, electrical installations. Written by hand from the outline of Part XIII and the reference implementation's names and ranges, not generated: tools/generate-schemas.mjs keeps this folder and lists none of it in index.json. No file of OpenEik 0.1 is held to it; a validator applies it only when asked for the proposal (@openeik/tools: proposals [\"electrical\"]).",
  "title": "electrical type",
  "description": "A type record of category \"electrical\" (Part XIII, 2.2, proposed for 0.2): the common type schema plus the payload electrical. Its width and height are the body's size across the direction it faces and vertically, and they set its elements' (Part XIII, 2.3, rule 3); depth is its size along that direction.",
  "allOf": [
    {
      "$ref": "../../../types/type.schema.json"
    },
    {
      "properties": {
        "category": {
          "const": "electrical"
        },
        "cableCarrier": false,
        "component": false,
        "duct": false,
        "edgeDetail": false,
        "edgeProfile": false,
        "fire": false,
        "footing": false,
        "framing": false,
        "furniture": false,
        "generic": false,
        "gutterProfile": false,
        "insert": false,
        "layers": false,
        "openingFamily": false,
        "parking": false,
        "pipe": false,
        "planting": false,
        "railing": false,
        "road": false,
        "room": false,
        "section": false,
        "shaft": false,
        "stair": false,
        "terminal": false,
        "voidForm": false,
        "wallAttach": false,
        "windowFamily": false,
        "electrical": {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "outlet",
                "evCharger",
                "switch",
                "dimmer",
                "button",
                "sensor",
                "light",
                "spot",
                "track",
                "emergencyLight",
                "ceilingOutlet",
                "junctionBox",
                "board",
                "meterCabinet",
                "dataOutlet",
                "tvOutlet",
                "speaker",
                "accessPoint",
                "equipment",
                "other"
              ]
            },
            "mount": {
              "type": "string",
              "enum": [
                "wall",
                "ceiling",
                "floor"
              ]
            },
            "depth": {
              "description": "Its size along the direction it faces, mm: out from the wall for a wall-mounted device.",
              "type": "number",
              "minimum": 5,
              "maximum": 3000
            },
            "defaultOffset": {
              "description": "The offset a new element of the type gets, mm.",
              "type": "number",
              "minimum": 0,
              "maximum": 20000
            },
            "defaultPurpose": {
              "description": "The purpose a new element of the type gets.",
              "type": "string",
              "minLength": 1,
              "maxLength": 8,
              "x-eik-values": "national"
            },
            "sockets": {
              "description": "An outlet's number of sockets.",
              "type": "integer",
              "minimum": 1,
              "maximum": 8
            },
            "connector": {
              "description": "An outlet's connector, a plain string.",
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            },
            "earth": {
              "description": "Whether it has a protective earth: an earthing contact for a plug's, or a terminal for a protective conductor. Absent, it is not said. Proposed on 29 October 2026 and decided on 30 October 2026 (open questions, 94).",
              "type": "boolean"
            },
            "ipRating": {
              "description": "Its degree of protection, IEC 60529 (IP44, IP20C, IPX4), or IP69K after ISO 20653.",
              "type": "string",
              "pattern": "^IP[0-6X][0-9X]K?[A-D]?[HMSW]*$"
            },
            "phases": {
              "enum": [
                1,
                3
              ]
            },
            "ratedCurrent": {
              "description": "A.",
              "type": "number",
              "minimum": 1,
              "maximum": 630
            },
            "power": {
              "description": "What it draws, W.",
              "type": "number",
              "minimum": 0,
              "maximum": 1000000
            },
            "luminousFlux": {
              "description": "A luminaire's luminous flux, lm: the whole luminaire's, not its lamp's. Only on the kinds light, spot, emergencyLight and track (Part XIII, 2.3, rule 6).",
              "type": "number",
              "minimum": 0,
              "maximum": 200000
            },
            "colorTemperature": {
              "description": "The correlated colour temperature of its light, K.",
              "type": "number",
              "minimum": 1000,
              "maximum": 20000
            },
            "beamAngle": {
              "description": "The full angle of its beam, degrees, for a spot or another directional light.",
              "type": "number",
              "minimum": 1,
              "maximum": 180
            },
            "distribution": {
              "description": "Which way its light goes.",
              "enum": [
                "down",
                "up",
                "downUp",
                "allRound"
              ]
            },
            "control": {
              "description": "How a switch, a dimmer, a button or a sensor works what it controls.",
              "type": "string",
              "enum": [
                "wired",
                "bus",
                "radio"
              ]
            },
            "controlSystem": {
              "description": "The bus or radio system it works by, a plain string.",
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            },
            "switching": {
              "description": "A switch's contacts, by IEC 60669-1's pattern numbers: oneWay 1, doublePole 2, triplePole 3, twoCircuit 5, twoWay 6, twoWayDoublePole 6/2, intermediate 7.",
              "type": "string",
              "enum": [
                "oneWay",
                "doublePole",
                "triplePole",
                "twoWay",
                "twoWayDoublePole",
                "intermediate",
                "twoCircuit"
              ]
            },
            "gangs": {
              "description": "How many switches stand on one base; absent, 1.",
              "type": "integer",
              "minimum": 1,
              "maximum": 4,
              "default": 1
            },
            "momentary": {
              "description": "Whether its contacts spring back once it is worked, as a push-button's do; absent, false.",
              "type": "boolean",
              "default": false
            },
            "ifcClass": {
              "description": "The IFC class an element of kind other exports as.",
              "type": "string",
              "pattern": "^Ifc[A-Za-z]+$"
            }
          },
          "required": [
            "kind",
            "mount",
            "depth",
            "defaultOffset"
          ],
          "x-eik-closed": true
        }
      },
      "required": [
        "electrical"
      ]
    },
    {
      "dependentRequired": {
        "outline": [
          "openingFamily"
        ]
      }
    },
    {
      "not": {
        "required": [
          "openingFamily",
          "windowFamily"
        ]
      }
    },
    {
      "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"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  ]
}
