"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 = {
    message: {
        id: 'message',
        label: 'Message',
        description: 'The message to be categorized',
        type: extensions_core_1.FieldType.STRING, // Should be string, TEXT doesn't allow selecting a data point
        required: true,
    },
    categories: {
        id: 'categories',
        label: 'Categories',
        description: 'List of categories (comma-separated, no spaces)',
        type: extensions_core_1.FieldType.STRING,
        required: true,
    },
};
exports.FieldsValidationSchema = zod_1.default.object({
    message: zod_1.default.string().min(1, 'Message is required'),
    categories: zod_1.default
        .string()
        .trim()
        .min(1, 'At least one category is required')
        .transform((s) => s.split(',').map((item) => item.trim()))
        .refine((arr) => arr.length > 0, {
        message: 'At least one category is required',
    }),
});
//# sourceMappingURL=fields.js.map