{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/arcnm-io/json-schema/arcnm-io-subcontractor-create-schema.json",
  "title": "SubcontractorCreate",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/arcnm-io-subcontractors-api-openapi.yml#/components/schemas/SubcontractorCreate",
  "properties": {
    "name": {
      "type": "string",
      "maxLength": 255,
      "title": "Name",
      "description": "The shop you order from."
    },
    "region": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 64
        },
        {
          "type": "null"
        }
      ],
      "title": "Region",
      "description": "Region / city, free text."
    },
    "lead_time_days": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 365.0,
          "minimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Lead Time Days",
      "description": "Typical door-to-door lead time. Stored for planning surfaces; prices are unaffected."
    },
    "notes": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 2000
        },
        {
          "type": "null"
        }
      ],
      "title": "Notes"
    },
    "is_active": {
      "type": "boolean",
      "title": "Is Active",
      "description": "Inactive subcontractors keep their history but stop counting as a source.",
      "default": true
    },
    "capabilities": {
      "items": {
        "$ref": "#/$defs/SubcontractorCapability"
      },
      "type": "array",
      "title": "Capabilities"
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "name"
  ],
  "$defs": {
    "SubcontractorCapability": {
      "properties": {
        "operation_kind": {
          "type": "string",
          "maxLength": 64,
          "title": "Operation Kind"
        },
        "pricing_unit": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 16
            },
            {
              "type": "null"
            }
          ],
          "title": "Pricing Unit"
        },
        "lot_minimum_eur": {
          "anyOf": [
            {
              "type": "number",
              "maximum": 1000000.0,
              "minimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Lot Minimum Eur",
          "description": "Minimum order value this shop states for the operation: an order is invoiced at the larger of its work and this."
        },
        "order_fee_eur": {
          "anyOf": [
            {
              "type": "number",
              "maximum": 1000000.0,
              "minimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Order Fee Eur",
          "description": "Fee this shop charges on every order of the operation, on top of the work or the minimum."
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "operation_kind"
      ],
      "title": "SubcontractorCapability"
    }
  }
}