ajv Валидация по условию, зависимые поля. Несколько if then

const validate = ajv.compile(
    {
        type: "object",
        "properties": {
            "name": {
                type: "string",
                maxLength: 15,
                "isNotEmpty": true,
            },
            "email": { type: "string", format: "email" },
            "count": { type: "number", },
            "price": { type: "number", },
        },
        required: ["name"],
        "allOf": [
            {
                "if": {
                    "properties": { "deliveryType": { const: deliveryTypes.CITY.value } } 
                },
                "then": {
                    "properties": { "cities": { "type": "array", "minItems": 1, } },
                    required: ["cities"], 
                },
            },
            {
                "if": {
                    "properties": { 
                        "deliveryType": { 
                            "not": { 
                                "const": deliveryTypes.NO_DELIVERY.value 
                            } 
                        } 
                    }
                },
                "then": {
                    required: ["country"],
                },
            },
        ]
    }
);

Key Words for FKN + antitotal forum (CS VSU):