"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FieldsValidationSchema = exports.fields = void 0;
const zod_1 = require("zod");
const extensions_core_1 = require("@awell-health/extensions-core");
const UnitEnum = zod_1.z.enum([
    'seconds',
    'minutes',
    'hours',
    'days',
    'weeks',
    'months',
    'years',
]);
exports.fields = {
    dateLeft: {
        id: 'dateLeft',
        label: 'Date left (minuend)',
        description: 'The date from which the other date (date right) is to be subtracted.',
        required: true,
        type: extensions_core_1.FieldType.DATE,
    },
    dateRight: {
        id: 'dateRight',
        label: 'Date right (subtrahend)',
        description: 'The date to be subtracted from the other date (date left).',
        required: true,
        type: extensions_core_1.FieldType.DATE,
    },
    unit: {
        id: 'unit',
        label: 'Duration unit',
        description: 'The unit of duration',
        required: true,
        type: extensions_core_1.FieldType.STRING,
        options: {
            dropdownOptions: Object.values(UnitEnum.enum).map((unit) => ({
                label: unit,
                value: unit,
            })),
        },
    },
};
exports.FieldsValidationSchema = zod_1.z.object({
    dateLeft: zod_1.z.coerce.date(),
    dateRight: zod_1.z.coerce.date(),
    unit: UnitEnum,
});
//# sourceMappingURL=fields.js.map