{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/arcnm-io/json-schema/arcnm-io-stock-format-public-schema.json",
  "title": "StockFormatPublic",
  "description": "A stock format your organization can price with: one of the\nstandard formats, or one of your own.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/arcnm-io-materials-api-openapi.yml#/components/schemas/StockFormatPublic",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id",
      "description": "Identifier of this version of the format. Changing a format's size, gauge band or material starts a new version, with a new id under the same key."
    },
    "key": {
      "type": "string",
      "title": "Key",
      "description": "Stable identifier shared by every version."
    },
    "kind": {
      "type": "string",
      "enum": [
        "sheet",
        "plate",
        "bar",
        "tube"
      ],
      "title": "Kind",
      "description": "The purchased stock form: `sheet`, `plate` (ordered cut to size), `bar` (round bar) or `tube`. Each kind states its own dimensions."
    },
    "label": {
      "type": "string",
      "title": "Label",
      "description": "Display name, e.g. `GF 3000 × 1500`."
    },
    "length_mm": {
      "type": "number",
      "title": "Length Mm",
      "description": "Sheet: the longer edge. Plate: the longest plate the supplier cuts to size. Bar and tube: the length bought. In millimetres."
    },
    "width_mm": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Width Mm",
      "description": "Sheet: the shorter edge. Plate: the widest plate the supplier cuts to size. Null on a bar and a tube."
    },
    "gauge_min_mm": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Gauge Min Mm",
      "description": "Sheet: the thinnest sheet this format is bought in, in millimetres; null for no lower limit. Null on every other kind."
    },
    "gauge_max_mm": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Gauge Max Mm",
      "description": "Sheet: the thickest sheet this format is bought in, in millimetres; null for no upper limit. Null on every other kind."
    },
    "diameter_mm": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Diameter Mm",
      "description": "Bar: the one diameter this length is stocked in, null for every standard diameter. Tube: the outside diameter. Null on a sheet and a plate. In millimetres."
    },
    "wall_mm": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Wall Mm",
      "description": "Tube: the wall thickness, in millimetres. Null on every other kind."
    },
    "thickness_mm": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Thickness Mm",
      "description": "Plate: the thickness the plate is cut to size in, in millimetres. Null on every other kind."
    },
    "material_category": {
      "anyOf": [
        {
          "$ref": "#/$defs/MaterialCategory"
        },
        {
          "type": "null"
        }
      ],
      "description": "Material category this format is bought in; null for every material."
    },
    "valid_from": {
      "type": "string",
      "format": "date",
      "title": "Valid From",
      "description": "Date this version took effect."
    },
    "valid_to": {
      "anyOf": [
        {
          "type": "string",
          "format": "date"
        },
        {
          "type": "null"
        }
      ],
      "title": "Valid To",
      "description": "Date this version was retired or replaced by a newer version; null while it is current."
    },
    "is_platform": {
      "type": "boolean",
      "title": "Is Platform",
      "description": "True for a standard format. You can hide a standard format for your organization, but not edit or retire it."
    },
    "org_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "title": "Org Id",
      "description": "Your organization's id on a format of your own; null on a standard format."
    },
    "resolution": {
      "type": "string",
      "enum": [
        "priced",
        "suppressed",
        "closed"
      ],
      "title": "Resolution",
      "description": "What calculations do with this format on the date read — `at` on the list, today otherwise. `priced`: they price with it. `suppressed`: a standard format your organization has hidden. `closed`: this version wasn't in force on that date — it was retired, or replaced by a newer version."
    }
  },
  "type": "object",
  "required": [
    "id",
    "key",
    "kind",
    "label",
    "length_mm",
    "width_mm",
    "gauge_min_mm",
    "gauge_max_mm",
    "diameter_mm",
    "wall_mm",
    "thickness_mm",
    "material_category",
    "valid_from",
    "valid_to",
    "is_platform",
    "org_id",
    "resolution"
  ],
  "$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."
    }
  }
}