{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cosuno/json-schema/cosuno-custom-catalog-with-groups-response-schema.json",
  "title": "CustomCatalogWithGroupsResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cosuno-company-api-openapi.yml#/components/schemas/CustomCatalogWithGroupsResponse",
  "properties": {
    "id": {
      "type": "string",
      "description": "ID of the custom cost group catalog."
    },
    "name": {
      "type": "string",
      "description": "Display name of the catalog."
    },
    "status": {
      "$ref": "#/$defs/CUSTOM_COST_GROUP_CATALOG_STATUS",
      "description": "Current status of the catalog."
    },
    "costGroups": {
      "items": {
        "$ref": "#/$defs/CustomCatalogCostGroupResponse"
      },
      "type": "array",
      "description": "Hierarchical cost groups that make up the catalog."
    }
  },
  "required": [
    "id",
    "name",
    "status",
    "costGroups"
  ],
  "type": "object",
  "additionalProperties": false,
  "$defs": {
    "CUSTOM_COST_GROUP_CATALOG_STATUS": {
      "type": "string",
      "enum": [
        "active",
        "deactivated"
      ]
    },
    "CustomCatalogCostGroupResponse": {
      "properties": {
        "id": {
          "type": "string",
          "description": "ID of the cost group."
        },
        "localId": {
          "type": "string",
          "description": "Stable identifier of the cost group within the catalog (e.g. a cost group code like `300` or `310.1`)."
        },
        "name": {
          "type": "string",
          "description": "Display name of the cost group."
        },
        "childCostGroups": {
          "items": {
            "$ref": "#/$defs/CustomCatalogCostGroupResponse"
          },
          "type": "array",
          "description": "Nested cost groups within this cost group."
        }
      },
      "required": [
        "id",
        "localId",
        "name"
      ],
      "type": "object",
      "additionalProperties": false
    }
  }
}