{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/arcnm-io/json-schema/arcnm-io-machine-public-schema.json",
  "title": "MachinePublic",
  "description": "A machine in a costing environment.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/arcnm-io-machines-api-openapi.yml#/components/schemas/MachinePublic",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id",
      "description": "Unique identifier of the machine definition."
    },
    "name": {
      "type": "string",
      "title": "Name",
      "description": "Human-readable name of the machine."
    },
    "vendor": {
      "type": "string",
      "title": "Vendor",
      "description": "Manufacturer or vendor of the machine."
    },
    "model_no": {
      "type": "string",
      "title": "Model No",
      "description": "Vendor model number of the machine."
    },
    "library_entry_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Library Entry Id",
      "description": "Machine-library entry this machine was instantiated from; null if bespoke."
    },
    "source": {
      "type": "string",
      "title": "Source",
      "description": "'library' if instantiated from a catalog entry, else 'custom'.",
      "default": "custom"
    },
    "klass": {
      "type": "string",
      "title": "Klass",
      "description": "Machine class (e.g. milling, turning, laser_cutter)."
    },
    "hourly_rate_eur": {
      "type": "number",
      "title": "Hourly Rate Eur",
      "description": "Machine-hour rate in EUR per hour."
    },
    "burden_rate_eur": {
      "type": "number",
      "title": "Burden Rate Eur",
      "description": "Overhead burden added on top of the machine-hour rate, in EUR per hour."
    },
    "programming_rate_eur": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Programming Rate Eur",
      "description": "Programming rate in EUR/h; null = the environment labour rate applies."
    },
    "environment_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Environment Count",
      "description": "Number of your costing environments whose fleet holds this machine today — the scope of an edit to its rates. Present on `GET /machines/{machine_id}`; absent on fleet rows."
    },
    "setup_rate_eur": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Setup Rate Eur",
      "description": "Setup rate in EUR/h; null = the machine hourly rate applies."
    },
    "rate_operator_eur_per_h": {
      "type": "number",
      "title": "Rate Operator Eur Per H",
      "description": "Operator wage already contained in hourly_rate_eur, in EUR per hour. 0 means the rate covers the machine only and operator labour is billed separately.",
      "default": 0.0
    },
    "rate_operator_share": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Rate Operator Share",
      "description": "Share of an operator this machine consumes while it runs (0-1); setup is always fully attended. Null falls back to the machine class default."
    },
    "capabilities": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Capabilities",
      "description": "Raw stored capability matrix; empty for library-derived instances (see effective_capabilities)."
    },
    "valid_from": {
      "type": "string",
      "title": "Valid From",
      "description": "ISO date (YYYY-MM-DD) from which this machine definition is effective."
    },
    "valid_to": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Valid To",
      "description": "ISO date (YYYY-MM-DD) the machine stops being effective; null = open-ended."
    }
  },
  "type": "object",
  "required": [
    "id",
    "name",
    "vendor",
    "model_no",
    "klass",
    "hourly_rate_eur",
    "burden_rate_eur",
    "valid_from"
  ]
}