"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.buildSchema = void 0;
const subschemas_1 = require("../../core/schemas/shared/subschemas");
const getDefaultEventDatesAndTimes_1 = require("./getDefaultEventDatesAndTimes");
const validations_1 = require("./validations");
/**
 * @private
 * Builds a schema for creating a new Event that enforces a startDate relative to the user's locale
 */
const buildSchema = () => {
    const { startDate } = (0, getDefaultEventDatesAndTimes_1.getDefaultEventDatesAndTimes)();
    return {
        $async: true,
        required: ["name", "startDate", "endDate"],
        properties: {
            name: subschemas_1.ENTITY_NAME_SCHEMA,
            startDate: {
                type: "string",
                format: "date",
                formatMinimum: startDate,
            },
            startTime: {
                type: "string",
            },
            endTime: {
                type: "string",
            },
            isAllDay: {
                type: "boolean",
                default: false,
            },
            _catalogSetup: subschemas_1.ENTITY_CATALOG_SETUP_SCHEMA,
            /* This field hidden for future consideration */
            // referencedContentIds: {
            //   type: "array",
            //   maxItems: 1,
            //   items: {
            //     type: "string",
            //   },
            //   default: [],
            // },
        },
        allOf: [validations_1.TIME_VALIDATIONS_WHEN_NOT_ALL_DAY],
    };
};
exports.buildSchema = buildSchema;
//# sourceMappingURL=EventSchemaCreate.js.map