{
  "sheetCalc": {
    "type": "object",
    "properties": {
      "params": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "name": { "type": "string", "example": "A" },
            "expression": { "type": "string", "example": "210" }
          },
          "required": ["name", "expression"]
        }
      },
      "material": { "$ref": "./MaterialSchema.json#/Material" },
      "drawingId": { "type": "number", "example": 15 },
      "sheets": {
        "type": "array",
        "items": { "$ref": "./SheetCalculation.json#/SheetMap" }
      }
    },
    "required": ["params", "material", "drawingId", "sheets"]
  },

  "SheetMap": {
    "type": "object",
    "properties": {
      "mapID": { "type": "string", "example": "sheetMapID1" },
      "sheet": { "$ref": "./SheetCalculation.json#/Sheet" }
    },
    "required": ["mapID", "sheet"]
  },

  "Sheet": {
    "type": "object",
    "properties": {
      "alignToMargins": { "type": "boolean", "example": false },
      "alignment": { "$ref": "./SheetCalculation.json#/SheetAlignmentEnum" },
      "height": { "type": "number", "example": 768.0 },
      "width": { "type": "number", "example": 1024.0 },
      "marginB": { "type": "number", "example": 0.0 },
      "marginL": { "type": "number", "example": 0.0 },
      "marginR": { "type": "number", "example": 0.0 },
      "marginT": { "type": "number", "example": 0.0 },
      "name": { "type": "string", "example": "Test1" },
      "trimX": { "type": ["number", "null"], "example": null },
      "trimY": { "type": ["number", "null"], "example": null }
    },
    "required": [
      "alignToMargins",
      "alignment",
      "height",
      "width",
      "marginB",
      "marginL",
      "marginR",
      "marginT",
      "name",
      "trimX",
      "trimY"
    ]
  },

  "SheetAlignmentEnum": {
    "type": "string",
    "example": "HCenterBottom",
    "enum": [
      "HCenterBottom",
      "HCenterTop",
      "HCenterVCenter",
      "LeftBottom",
      "LeftTop",
      "LeftVCenter",
      "RightBottom",
      "RightTop",
      "RightVCenter"
    ]
  },

  "SheetCalculationResponse": {
    "type": "object",
    "properties": {
      "message": { "type": "string", "example": "Calculated successfully" },
      "data": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "requestid": { "type": "string", "example": "layoutMapID" },
            "bestSheetId": { "type": "string", "example": "sheetMapID1" },
            "parts": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "positions": { "type": ["array", "null"], "items": { "type": "object" }, "example": null },
                  "oneupId": { "type": "number", "example": 15 },
                  "partsPerSheet": { "type": "number", "example": 9 }
                }
              }
            },
            "usedWidth": { "type": "number", "example": 934.5 },
            "usedHeight": { "type": "number", "example": 744 },
            "usedArea": { "type": "number", "example": 0.586336488252718 },
            "sheetArea": { "type": "number", "example": 0.786432 },
            "wastage": { "type": "number", "example": 25.443460050873, "description": "Value in percentage" }
          },
          "required": [
            "requestid",
            "bestSheetId",
            "parts",
            "usedWidth",
            "usedHeight",
            "usedArea",
            "sheetArea",
            "wastage"
          ]
        }
      }
    },
    "required": ["message", "data"]
  }
}
