{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cosuno/json-schema/cosuno-cost-estimation-response-schema.json",
  "title": "CostEstimationResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cosuno-project-costs-api-openapi.yml#/components/schemas/CostEstimationResponse",
  "anyOf": [
    {
      "$ref": "#/$defs/CostEstimationStandardCatalogEstimate"
    },
    {
      "$ref": "#/$defs/CostEstimationBidPackageEstimate"
    },
    {
      "$ref": "#/$defs/CostEstimationStlbWorkCategoryEstimate"
    },
    {
      "$ref": "#/$defs/CostEstimationCustomCostGroupCatalogsEstimate"
    }
  ],
  "$defs": {
    "COST_CATALOG_TYPE": {
      "type": "string",
      "enum": [
        "custom",
        "din276",
        "oenorm",
        "bidPackage",
        "stlbWorkCategory"
      ]
    },
    "CostEstimationBidPackage": {
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "number": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "name",
        "number"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "CostEstimationBidPackageCostGroup": {
      "properties": {
        "bidPackage": {
          "$ref": "#/$defs/CostEstimationBidPackage"
        },
        "costItem": {
          "$ref": "#/$defs/CostItem"
        },
        "createdAt": {
          "type": "string"
        },
        "updatedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "deletedAt": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "bidPackage",
        "costItem"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "CostEstimationBidPackageEstimate": {
      "properties": {
        "id": {
          "type": "string"
        },
        "projectId": {
          "type": "string"
        },
        "catalogType": {
          "$ref": "#/$defs/COST_CATALOG_TYPE"
        },
        "customCatalogId": {
          "type": [
            "string",
            "null"
          ]
        },
        "bidPackageCostGroups": {
          "items": {
            "$ref": "#/$defs/CostEstimationBidPackageCostGroup"
          },
          "type": "array"
        },
        "createdAt": {
          "type": "string"
        },
        "updatedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "deletedAt": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "projectId",
        "catalogType",
        "customCatalogId",
        "bidPackageCostGroups"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "CostEstimationCustomCostGroup": {
      "properties": {
        "localId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "createdAt": {
          "type": "string"
        },
        "updatedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "deletedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "costItem": {
          "$ref": "#/$defs/CostItem"
        },
        "childCostGroups": {
          "items": {
            "$ref": "#/$defs/CostEstimationCustomCostGroup"
          },
          "type": "array"
        }
      },
      "required": [
        "localId",
        "name",
        "costItem",
        "childCostGroups"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "CostEstimationCustomCostGroupCatalogsEstimate": {
      "properties": {
        "id": {
          "type": "string"
        },
        "projectId": {
          "type": "string"
        },
        "catalogType": {
          "$ref": "#/$defs/COST_CATALOG_TYPE"
        },
        "customCatalogId": {
          "type": [
            "string",
            "null"
          ]
        },
        "customCatalogCostGroups": {
          "items": {
            "$ref": "#/$defs/CostEstimationCustomCostGroup"
          },
          "type": "array"
        },
        "createdAt": {
          "type": "string"
        },
        "updatedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "deletedAt": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "projectId",
        "catalogType",
        "customCatalogId",
        "customCatalogCostGroups"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "CostEstimationStandardCatalogCostGroup": {
      "properties": {
        "localId": {
          "type": "string"
        },
        "designation": {
          "type": [
            "string",
            "null"
          ]
        },
        "costGroupType": {
          "$ref": "#/$defs/STANDARD_CATALOG_COST_GROUP_TYPE"
        },
        "createdAt": {
          "type": "string"
        },
        "updatedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "deletedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "costItem": {
          "$ref": "#/$defs/CostItem"
        },
        "childCostGroups": {
          "items": {
            "$ref": "#/$defs/CostEstimationStandardCatalogCostGroup"
          },
          "type": "array"
        }
      },
      "required": [
        "localId",
        "designation",
        "costGroupType",
        "costItem",
        "childCostGroups"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "CostEstimationStandardCatalogEstimate": {
      "properties": {
        "id": {
          "type": "string"
        },
        "projectId": {
          "type": "string"
        },
        "catalogType": {
          "$ref": "#/$defs/COST_CATALOG_TYPE"
        },
        "customCatalogId": {
          "type": [
            "string",
            "null"
          ]
        },
        "standardCatalogCostGroups": {
          "items": {
            "$ref": "#/$defs/CostEstimationStandardCatalogCostGroup"
          },
          "type": "array"
        },
        "createdAt": {
          "type": "string"
        },
        "updatedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "deletedAt": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "projectId",
        "catalogType",
        "customCatalogId",
        "standardCatalogCostGroups"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "CostEstimationStlbWorkCategoryCostGroup": {
      "properties": {
        "id": {
          "type": "string"
        },
        "localId": {
          "type": "string"
        },
        "costItem": {
          "$ref": "#/$defs/CostItem"
        }
      },
      "required": [
        "id",
        "localId",
        "costItem"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "CostEstimationStlbWorkCategoryEstimate": {
      "properties": {
        "id": {
          "type": "string"
        },
        "projectId": {
          "type": "string"
        },
        "catalogType": {
          "$ref": "#/$defs/COST_CATALOG_TYPE"
        },
        "customCatalogId": {
          "type": [
            "string",
            "null"
          ]
        },
        "stlbWorkCategoryCostGroups": {
          "items": {
            "$ref": "#/$defs/CostEstimationStlbWorkCategoryCostGroup"
          },
          "type": "array"
        },
        "createdAt": {
          "type": "string"
        },
        "updatedAt": {
          "type": [
            "string",
            "null"
          ]
        },
        "deletedAt": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "projectId",
        "catalogType",
        "customCatalogId",
        "stlbWorkCategoryCostGroups"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "CostItem": {
      "properties": {
        "id": {
          "type": "string"
        },
        "factor": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "quantity": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "unit": {
          "type": [
            "string",
            "null"
          ]
        },
        "unitPrice": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "taxRate": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        }
      },
      "required": [
        "id",
        "factor",
        "quantity",
        "unit",
        "unitPrice",
        "taxRate"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "STANDARD_CATALOG_COST_GROUP_TYPE": {
      "type": "string",
      "enum": [
        "din276",
        "oenorm"
      ]
    }
  }
}