{
  "$schema": "http://json-schema.org/draft-07/schema",
  "$id": "http://barm-businessobjects.intentus.de/adcuri-dashboards-requests/gerechnete-abgeschlossene-alternativen/v1.0/gerechnete-abgeschlossene-alternativen.schema.json",
  "title": "gerechnete-abgeschlossene-alternativen.schema.json",
  "description": "Ergebebnisobjekt",
  "extends": {
    "description": "Hinweis zu Java-Generierung",
    "type": "object",
    "properties": {
      "creation": {
        "type": "string",
        "format": "date"
      },
      "zeitspanne": {
        "type": "object",
        "properties": {
          "start": {
            "type": "string",
            "format": "date"
          },
          "ende": {
            "type": "string",
            "format": "date"
          }
        },
        "required": [
          "start",
          "ende"
        ],
        "additionalItems": false,
        "additionalProperties": false
      },
      "error": {
        "description": "Fehler code",
        "type": "object",
        "oneOf": [
          {
            "properties": {
              "error_code": {
                "const": 200
              },
              "error_text": {
                "const": "Alles OK"
              }
            },
            "required": [
              "error_code",
              "error_text"
            ],
            "additionalItems": false,
            "additionalProperties": false
          },
          {
            "properties": {
              "error_code": {
                "const": 400
              },
              "error_text": {
                "const": "WS konnte nicht aufgerufen werden."
              }
            },
            "required": [
              "error_code",
              "error_text"
            ],
            "additionalItems": false,
            "additionalProperties": false
          }
        ]
      }
    },
    "required": [
      "creation",
      "error",
      "zeitspanne"
    ],
    "additionalItems": false,
    "additionalProperties": false
  },
  "allOf": [
    {
      "description": "Ergebnisobjekt",
      "type": "object",
      "properties": {
        "creation": {
          "type": "string",
          "format": "date"
        },
        "zeitspanne": {
          "type": "object",
          "properties": {
            "start": {
              "type": "string",
              "format": "date"
            },
            "ende": {
              "type": "string",
              "format": "date"
            }
          },
          "required": [
            "start",
            "ende"
          ],
          "additionalItems": false,
          "additionalProperties": false
        },
        "error": {
          "description": "Fehler code",
          "type": "object",
          "oneOf": [
            {
              "properties": {
                "error_code": {
                  "const": 200
                },
                "error_text": {
                  "const": "Alles OK"
                }
              },
              "required": [
                "error_code",
                "error_text"
              ],
              "additionalItems": false,
              "additionalProperties": false
            },
            {
              "properties": {
                "error_code": {
                  "const": 400
                },
                "error_text": {
                  "const": "WS konnte nicht aufgerufen werden."
                }
              },
              "required": [
                "error_code",
                "error_text"
              ],
              "additionalItems": false,
              "additionalProperties": false
            }
          ]
        }
      },
      "required": [
        "creation",
        "error",
        "zeitspanne"
      ],
      "additionalItems": false,
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "_className": {
          "description": "Hinweis zu Java-Generierung",
          "const": "gerechnete-abgeschlossene-alternativen"
        },
        "result": {
          "type": "array",
          "uniqueItems": true,
          "items": {
            "type": "object",
            "properties": {
              "zeitspanne": {
                "description": "Zeitspanne des konkreten Ergebnisses",
                "type": "object",
                "properties": {
                  "start": {
                    "type": "string",
                    "format": "date"
                  },
                  "ende": {
                    "type": "string",
                    "format": "date"
                  }
                },
                "required": [
                  "start",
                  "ende"
                ],
                "additionalItems": false,
                "additionalProperties": false
              },
              "sparte": {
                "description": "Bezeichnungen der Sparten in ADC",
                "type": "string",
                "oneOf": [
                  {
                    "const": "ALL",
                    "description": "alle Sparten"
                  },
                  {
                    "const": "HRV",
                    "description": "Sparte Hausrat"
                  },
                  {
                    "const": "UV",
                    "description": "Sparte Unfallversicherung"
                  },
                  {
                    "const": "PHV",
                    "description": "Sparte Private Haftpflicht"
                  }
                ]
              },
              "gerechnete": {
                "type": "integer",
                "minimum": 0
              },
              "abgeschlossene": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "zeitspanne",
              "sparte",
              "gerechnete",
              "abgeschlossene"
            ],
            "additionalItems": false,
            "additionalProperties": false
          }
        }
      },
      "required": [
        "result"
      ],
      "additionalItems": false,
      "additionalProperties": false
    }
  ]
}