{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "PreisaenderungAnkuendigung",
  "type": "object",
  "properties": {
    "vertrag_id": {
      "type": "string",
      "format": "uuid"
    },
    "customer_id": {
      "type": "string",
      "format": "uuid"
    },
    "komp_id": {
      "type": "string",
      "format": "uuid"
    },
    "malo_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "sparte": {
      "type": "string"
    },
    "current_product_code": {
      "type": [
        "string",
        "null"
      ]
    },
    "new_product_code": {
      "type": "string"
    },
    "wirksamkeit": {
      "type": "string",
      "format": "date"
    },
    "vorlauf_tage": {
      "type": "integer",
      "format": "int64"
    },
    "erforderliche_frist": {
      "type": "string"
    },
    "fruehestens_wirksam": {
      "type": "string",
      "format": "date"
    },
    "frist_gewahrt": {
      "type": "boolean"
    },
    "rechtsgrundlage": {
      "type": "string"
    },
    "dokument_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "anlass": {
      "type": [
        "string",
        "null"
      ]
    },
    "umfang": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PreisPosition"
      }
    },
    "umfang_vollstaendig": {
      "type": "boolean"
    },
    "sonderkuendigungsrecht": {
      "$ref": "#/$defs/Sonderkuendigungsrecht"
    }
  },
  "required": [
    "vertrag_id",
    "customer_id",
    "komp_id",
    "sparte",
    "new_product_code",
    "wirksamkeit",
    "vorlauf_tage",
    "erforderliche_frist",
    "fruehestens_wirksam",
    "frist_gewahrt",
    "rechtsgrundlage",
    "umfang",
    "umfang_vollstaendig",
    "sonderkuendigungsrecht"
  ],
  "$defs": {
    "PreisPosition": {
      "description": "One price line as it changes.",
      "type": "object",
      "properties": {
        "bezeichnung": {
          "type": "string"
        },
        "einheit": {
          "type": "string"
        },
        "bisher": {
          "type": "string"
        },
        "neu": {
          "type": "string"
        }
      },
      "required": [
        "bezeichnung",
        "einheit",
        "bisher",
        "neu"
      ]
    },
    "Sonderkuendigungsrecht": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "besteht": {
              "type": "boolean",
              "const": true
            },
            "rechtsgrundlage": {
              "type": "string"
            },
            "wirksam_zum": {
              "type": "string",
              "format": "date"
            },
            "entgeltfrei": {
              "type": "boolean"
            }
          },
          "required": [
            "besteht",
            "rechtsgrundlage",
            "wirksam_zum",
            "entgeltfrei"
          ]
        },
        {
          "type": "object",
          "properties": {
            "besteht": {
              "type": "boolean",
              "const": false
            }
          },
          "required": [
            "besteht"
          ]
        }
      ]
    }
  },
  "$id": "https://hupe1980.github.io/mako/schemas/events/de.mako.vertrag.preisaenderung.ankuendigung.json"
}
