{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/arcnm-io/json-schema/arcnm-io-remnant-create-schema.json",
  "title": "RemnantCreate",
  "description": "A remnant your shop holds: its size, thickness and material, in one\nenvironment. Name the material by grade, or by category.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/arcnm-io-remnants-api-openapi.yml#/components/schemas/RemnantCreate",
  "properties": {
    "env_id": {
      "type": "string",
      "format": "uuid",
      "title": "Env Id"
    },
    "length_mm": {
      "type": "number",
      "maximum": 20000.0,
      "minimum": 10.0,
      "title": "Length Mm"
    },
    "width_mm": {
      "type": "number",
      "maximum": 20000.0,
      "minimum": 10.0,
      "title": "Width Mm"
    },
    "gauge_mm": {
      "type": "number",
      "maximum": 1000.0,
      "exclusiveMinimum": 0.0,
      "title": "Gauge Mm"
    },
    "material_grade_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "title": "Material Grade Id"
    },
    "material_category": {
      "anyOf": [
        {
          "$ref": "#/$defs/MaterialCategory"
        },
        {
          "type": "null"
        }
      ]
    },
    "quantity": {
      "type": "integer",
      "maximum": 10000.0,
      "minimum": 1.0,
      "title": "Quantity",
      "default": 1
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "env_id",
    "length_mm",
    "width_mm",
    "gauge_mm"
  ],
  "$defs": {
    "MaterialCategory": {
      "type": "string",
      "enum": [
        "carbon_steel",
        "alloy_steel",
        "stainless_steel",
        "tool_steel",
        "cast_iron",
        "aluminium",
        "copper_alloy",
        "nickel_alloy",
        "titanium_alloy",
        "magnesium_alloy",
        "zinc_alloy",
        "thermoplastic",
        "thermoset",
        "elastomer",
        "composite",
        "other"
      ],
      "title": "MaterialCategory",
      "description": "Top-level material family. Drives ISO machining group defaults and\nUI filtering. Values are stable identifiers — adding a new category is\nadditive; renaming is a breaking change."
    }
  }
}