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