"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FIXED_IN_PERSON_ATTENDANCE_VALIDATIONS = exports.FIXED_ONLINE_ATTENDANCE_VALIDATIONS = exports.URL_VALIDATIONS_WHEN_ONLINE_OR_HYBRID = exports.TIME_VALIDATIONS_WHEN_NOT_ALL_DAY = void 0;
const hubEventAttendanceType_1 = require("../enums/hubEventAttendanceType");
const hubEventCapacityType_1 = require("../enums/hubEventCapacityType");
exports.TIME_VALIDATIONS_WHEN_NOT_ALL_DAY = {
    if: {
        properties: {
            isAllDay: { const: false },
        },
    },
    then: {
        required: ["startTime", "endTime"],
        properties: {
            endTime: {
                format: "timePickerTime",
                formatExclusiveMinimum: { $data: "1/startTime" },
            },
        },
    },
};
exports.URL_VALIDATIONS_WHEN_ONLINE_OR_HYBRID = {
    if: {
        properties: {
            attendanceType: {
                enum: [hubEventAttendanceType_1.HubEventAttendanceType.Online, hubEventAttendanceType_1.HubEventAttendanceType.Both],
            },
        },
    },
    then: {
        required: ["onlineUrl"],
        properties: {
            onlineUrl: {
                format: "url",
            },
        },
    },
};
exports.FIXED_ONLINE_ATTENDANCE_VALIDATIONS = {
    if: {
        properties: {
            onlineCapacityType: { const: hubEventCapacityType_1.HubEventCapacityType.Fixed },
            attendanceType: {
                enum: [hubEventAttendanceType_1.HubEventAttendanceType.Online, hubEventAttendanceType_1.HubEventAttendanceType.Both],
            },
        },
    },
    then: {
        required: ["onlineCapacity"],
        properties: {
            onlineCapacity: {
                minimum: 1,
            },
        },
    },
};
exports.FIXED_IN_PERSON_ATTENDANCE_VALIDATIONS = {
    if: {
        properties: {
            inPersonCapacityType: { const: hubEventCapacityType_1.HubEventCapacityType.Fixed },
            attendanceType: {
                enum: [hubEventAttendanceType_1.HubEventAttendanceType.InPerson, hubEventAttendanceType_1.HubEventAttendanceType.Both],
            },
        },
    },
    then: {
        required: ["inPersonCapacity"],
        properties: {
            inPersonCapacity: {
                minimum: 1,
            },
        },
    },
};
//# sourceMappingURL=validations.js.map