"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 validation_1 = require("../../../validation");
const types_1 = require("../../../types");
exports.fields = {
    customerId: {
        label: 'Customer ID',
        id: 'customerId',
        type: extensions_core_1.FieldType.NUMERIC,
        required: true,
        description: "A customer's unique ID.",
    },
    channelName: {
        label: 'Channel name',
        id: 'channelName',
        type: extensions_core_1.FieldType.STRING,
        required: true,
        description: 'Specifies the title of a ticket, which will be the group channel name in Sendbird Chat platform as well. Maximum length is 100 characters.',
    },
    relatedChannelUrls: {
        label: 'Related channel URLs',
        id: 'relatedChannelUrls',
        type: extensions_core_1.FieldType.STRING,
        required: false,
        description: 'A comma-separated string of group channel URLs for reference, where the corresponding customer belongs. Can have up to 3 group channel URLs.',
    },
    groupKey: {
        label: 'Group key',
        id: 'groupKey',
        type: extensions_core_1.FieldType.STRING,
        required: false,
        description: 'Specifies the unique key of a group for ticket assignment. The key can be a mix of lowercase letters, hyphens, underscores, or numbers.',
    },
    priority: {
        label: 'Priority',
        id: 'priority',
        type: extensions_core_1.FieldType.STRING,
        required: false,
        description: 'Specifies the priority of a ticket. Acceptable values are the following: "LOW", "MEDIUM", "HIGH", and "URGENT". Defaults to: "MEDIUM".',
    },
    customFields: {
        id: 'customFields',
        label: 'Custom fields',
        description: 'A JSON object that can store up to twenty key-value items for additional customer information. The specified keys must be registered as a custom field in Sendbird.',
        type: extensions_core_1.FieldType.JSON,
        required: false,
    },
};
const priorityEnum = zod_1.z.enum(Object.values(types_1.TicketPriority));
exports.FieldsValidationSchema = zod_1.z.object({
    customerId: zod_1.z.coerce.number(),
    channelName: zod_1.z.string().max(100).nonempty(),
    relatedChannelUrls: (0, extensions_core_1.makeStringOptional)((0, extensions_core_1.validateCommaSeparatedList)((value) => zod_1.z.string().safeParse(value).success, false)),
    groupKey: (0, extensions_core_1.makeStringOptional)(zod_1.z.string().regex(/^[a-z0-9\-_]*$/)),
    priority: (0, extensions_core_1.makeStringOptional)(priorityEnum),
    customFields: (0, extensions_core_1.makeStringOptional)(validation_1.CustomFieldsValidationSchema),
});
//# sourceMappingURL=fields.js.map