{
  "$schema": "http://json-schema.org/draft-07/schema",
  "$id": "customer.schema.json",
  "title": "customer",
  "type": "object",
  "description": "Enthält Vorversicherungsdaten",
  "properties": {
    "lead_id": {
      "type": "string",
      "pattern": "^HKV-([0-9]+)$",
      "minLength": 1,
      "description": "CHECK24-interne ID"
    },
    "gender": {
      "type": "string",
      "$ref": "enums/gender.schema.json#/$defs/gender",
      "description": "Geschlecht"
    },
    "firstname": {
      "type": "string",
      "minLength": 1,
      "description": "Vorname"
    },
    "lastname": {
      "type": "string",
      "minLength": 1,
      "description": "Nachname"
    },
    "email": {
      "type": "string",
      "format": "email",
      "minLength": 1,
      "description": "E-Mail-Adresse"
    },
    "phone": {
      "type": "string",
      "description": "Telefonnummer"
    },
    "birthdate": {
      "type": "string",
      "format": "date",
      "minLength": 1,
      "description": "Geburtsdatum - 'YYYY-MM-DD'"
    },
    "comment": {
      "type": "string",
      "description": "Kommentar des Kunden"
    },
    "address": {
      "$ref": "adress.schema.json",
      "description": "Adressdaten"
    },
    "product_dependent": {
      "type": "object",
      "properties": {
        "animals": {
          "type": "array",
          "minItems": 1,
          "maxItems": 9,
          "items": {
            "$ref": "animal.schema.json"
          },
          "description": "Enthält Daten des Hundes/der Hunde"
        }
      }
    }
  },

  "required": ["lead_id", "gender", "firstname", "lastname", "email", "birthdate", "address", "product_dependent"]
}
