"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.FieldsValidationSchema = exports.fields = void 0;
const extensions_core_1 = require("@awell-health/extensions-core");
const zod_1 = __importDefault(require("zod"));
/**
 * Fields definitions for the message form.
 */
exports.fields = {
    communicationObjective: {
        id: 'communicationObjective',
        label: 'Communication Objective',
        description: 'Provide the main purpose of the message. Add any important message context.',
        type: extensions_core_1.FieldType.STRING,
        required: true,
    },
    personalizationInput: {
        id: 'personalizationInput',
        label: 'Personalization Input',
        description: '[Optional] Specify the personalization input for the message (name, age, gender, date of the last checkup, etc). This is used to personalize the message to the recipient.',
        type: extensions_core_1.FieldType.STRING,
        required: false,
    },
    stakeholder: {
        id: 'stakeholder',
        label: 'Stakeholder',
        description: '[Optional]Specify the recipient role; defaults to "Patient." Used for personalization.',
        type: extensions_core_1.FieldType.STRING,
        required: false,
    },
    language: {
        id: 'language',
        label: 'Language',
        description: '[Optional]Specify the language of the message; defaults to English.',
        type: extensions_core_1.FieldType.STRING,
        required: false,
    },
};
/**
 * Validation schema for the fields using Zod.
 */
const fieldSchemas = {
    communicationObjective: zod_1.default.string().min(1, 'Communication objective is required'),
    personalizationInput: zod_1.default.string().optional().default(''),
    stakeholder: zod_1.default
        .string()
        .optional()
        .transform((val) => {
        if (val === undefined || val === '')
            return 'Patient';
        return val;
    }),
    language: zod_1.default
        .string()
        .optional()
        .transform((val) => {
        if (val === undefined || val === '')
            return 'English';
        return val;
    }),
};
exports.FieldsValidationSchema = zod_1.default.object(fieldSchemas);
//# sourceMappingURL=fields.js.map