{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agstack/json-schema/agstack-patched-add-raw-material-operation-schema.json",
  "title": "PatchedAddRawMaterialOperation",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agstack-addrawmaterialoperations-api-openapi.yml#/components/schemas/PatchedAddRawMaterialOperation",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "readOnly": true
    },
    "activityType": {
      "type": "string",
      "format": "uuid"
    },
    "title": {
      "type": "string",
      "maxLength": 200
    },
    "details": {
      "type": [
        "string",
        "null"
      ]
    },
    "hasStartDatetime": {
      "type": "string",
      "format": "date-time"
    },
    "hasEndDatetime": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "operatedOn": {
      "type": "string",
      "format": "uuid"
    },
    "responsibleAgent": {
      "type": [
        "string",
        "null"
      ]
    },
    "usesAgriculturalMachinery": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      }
    },
    "hasCompostMaterial": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AddRawMaterialCompostQuantity"
      }
    }
  },
  "$defs": {
    "AddRawMaterialCompostQuantity": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "readOnly": true
        },
        "typeName": {
          "type": "string"
        },
        "quantityValue": {
          "$ref": "#/$defs/AppliedAmmountField"
        }
      },
      "required": [
        "id",
        "quantityValue",
        "typeName"
      ]
    },
    "AppliedAmmountField": {
      "type": "object",
      "properties": {
        "unit": {
          "type": "string"
        },
        "numericValue": {
          "type": "string",
          "format": "decimal",
          "pattern": "^-?\\d{0,15}(?:\\.\\d{0,2})?$"
        }
      },
      "required": [
        "numericValue",
        "unit"
      ]
    }
  }
}