{
  "$comment": "GENERATED FILE — DO NOT EDIT DIRECTLY. Source: packages/schemas/src. Regenerate with `npm run generate:json-schema --workspace=@spacecorp/schemas`.",
  "$id": "https://spacecorp.io/schemas/part.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^part-[a-z0-9][a-z0-9-]*$"
    },
    "twin_part_id": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9_.]*$"
    },
    "subsystem": {
      "type": "string",
      "pattern": "^sys-[a-z0-9][a-z0-9-]*$"
    },
    "parent": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^part-[a-z0-9][a-z0-9-]*$"
        },
        {
          "type": "null"
        }
      ]
    },
    "level": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1,
          "maximum": 5
        },
        {
          "type": "null"
        }
      ]
    },
    "label": {
      "type": "string",
      "minLength": 1
    },
    "evidence": {
      "type": "string",
      "enum": [
        "measured",
        "photo",
        "catalogue",
        "published",
        "generic"
      ]
    },
    "oem_part_number": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1
        },
        {
          "type": "null"
        }
      ]
    },
    "fastener": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "minLength": 1
            },
            "spec": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [
            "kind",
            "spec"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "torque_nm": {
      "anyOf": [
        {
          "type": "number",
          "exclusiveMinimum": 0
        },
        {
          "type": "null"
        }
      ]
    },
    "member": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "extrusion",
            "casting",
            "sheet"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "notes": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "id",
    "twin_part_id",
    "subsystem",
    "parent",
    "level",
    "label",
    "evidence",
    "oem_part_number",
    "fastener",
    "torque_nm",
    "member",
    "notes"
  ],
  "additionalProperties": false
}
