{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://raw.githubusercontent.com/api-evangelist/labguru/main/json-schema/createCustomSamplePoolingEvent.json",
  "title": "Create custom sample pooling event",
  "type": "object",
  "description": "draw a custom amount from each stock.",
  "required": [
    "token"
  ],
  "properties": {
    "token": {
      "type": "string",
      "example": "YOUR TOKEN IS HERE"
    },
    "item": {
      "type": "object",
      "required": [
        "name",
        "unit_type",
        "pool_type",
        "unit",
        "stocks_usage",
        "pooled_stock_info"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "The description of pool purpose"
        },
        "unit_type": {
          "type": "string",
          "description": "volume/weight"
        },
        "pool_type": {
          "type": "string",
          "example": "custom"
        },
        "unit": {
          "type": "string",
          "description": "Valid units of measurement are:\n\n- For 'volume': 'nL', '\u00b5L', 'mL', 'L'\n- For 'weight': 'ng', '\u00b5g', 'mg', 'g', 'Kg'",
          "example": "\u00b5L"
        },
        "stocks_usage": {
          "type": "object",
          "description": "Hash of stock IDs and the desired amount to pool.",
          "additionalProperties": {
            "type": "number",
            "description": "Amount to be pooled for the given stock ID."
          },
          "example": {
            "300": 0.004,
            "834": 6,
            "45": 5
          }
        },
        "pooled_stock_info": {
          "type": "object",
          "description": "Contains all the necessary stock fields for creating a stock during the pooling event.\n                    This object may include all the relevant stock properties.",
          "required": [
            "name",
            "stockable_type",
            "stockable_id",
            "storage_type",
            "storage_id"
          ],
          "properties": {
            "stockable_type": {
              "type": "string",
              "description": "Identifies the class name of the stock item, such as 'Biocollections::Bacterium'.\n                        This indicates the category of the entity and must match valid system-defined class names.",
              "example": "Biocollections::Bacterium"
            },
            "stockable_id": {
              "type": "integer"
            },
            "storage_type": {
              "type": "string",
              "description": "Specifies the storage classification, such as 'System::Storage::Storage',\n                        indicating the type of storage facility used for the item.",
              "example": "System::Storage::Storage"
            },
            "storage_id": {
              "type": "integer"
            },
            "name": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}