"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"));
exports.fields = {
    patientId: {
        id: 'patientId',
        label: 'Patient ID',
        description: 'The patient for which the thread is about',
        type: extensions_core_1.FieldType.NUMERIC,
        required: true,
    },
    senderId: {
        id: 'senderId',
        label: 'Sender ID',
        description: 'The ID of the user initiating the message thread',
        type: extensions_core_1.FieldType.NUMERIC,
        required: true,
    },
    practiceId: {
        id: 'practiceId',
        label: 'Practice ID',
        description: 'The practice associated with the patient chart',
        type: extensions_core_1.FieldType.NUMERIC,
        required: true,
    },
    documentDate: {
        id: 'documentDate',
        label: 'Document Date',
        description: 'Defaults to today’s date if not provided',
        type: extensions_core_1.FieldType.DATE,
        required: false,
    },
    chartDate: {
        id: 'chartDate',
        label: 'Chart Date',
        description: 'Defaults to today’s date if not provided',
        type: extensions_core_1.FieldType.DATE,
        required: false,
    },
    messageBody: {
        id: 'messageBody',
        label: 'Message Body',
        description: 'The content of the initial message in the thread',
        type: extensions_core_1.FieldType.TEXT,
        required: true,
    },
    recipientId: {
        id: 'recipientId',
        label: 'Recipient ID',
        description: 'A user ID of the recipient of the message. They will be added as a member to the thread.',
        type: extensions_core_1.FieldType.NUMERIC,
        required: false,
    },
    groupId: {
        id: 'groupId',
        label: 'Group ID',
        description: 'The ID of a group that will be added as a member to the thread.',
        type: extensions_core_1.FieldType.NUMERIC,
        required: false,
    },
    isUrgent: {
        id: 'isUrgent',
        label: 'Urgent',
        description: 'Marks the message thread as urgent if true. Defaults to false.',
        type: extensions_core_1.FieldType.BOOLEAN,
        required: false,
    },
};
exports.FieldsValidationSchema = zod_1.default.object({
    patientId: extensions_core_1.NumericIdSchema,
    senderId: extensions_core_1.NumericIdSchema,
    practiceId: extensions_core_1.NumericIdSchema,
    documentDate: zod_1.default
        .string()
        .optional()
        .default(() => new Date().toISOString())
        .pipe(extensions_core_1.DateTimeOptionalSchema),
    chartDate: zod_1.default
        .string()
        .optional()
        .default(() => new Date().toISOString())
        .pipe(extensions_core_1.DateTimeOptionalSchema),
    messageBody: zod_1.default.string().min(1),
    recipientId: extensions_core_1.NumericIdSchema.optional(),
    groupId: extensions_core_1.NumericIdSchema.optional(),
    isUrgent: zod_1.default.boolean().optional().default(false),
});
//# sourceMappingURL=fields.js.map