"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 types_1 = require("../../../client/types");
exports.fields = {
    content: {
        label: 'Content',
        id: 'content',
        type: extensions_core_1.FieldType.STRING,
        stringType: extensions_core_1.StringType.TEXT,
        required: true,
        description: 'Content of the task.',
    },
    dueDate: {
        label: 'Due date',
        id: 'dueDate',
        // Time will be auto-set to 00:00:00 as FieldType.DATE provides only date
        type: extensions_core_1.FieldType.DATE,
        required: false,
        description: '',
    },
    ownerId: {
        label: 'Owner ID',
        id: 'ownerId',
        type: extensions_core_1.FieldType.NUMERIC,
        required: false,
        description: 'Unique identifier of the user the task is assigned to, defaults to the user who created the task',
    },
    resourceType: {
        label: 'Resource type',
        id: 'resourceType',
        type: extensions_core_1.FieldType.STRING,
        required: false,
        description: 'Name of the resource type the task is attached to. Possible values: "lead", "contact", "deal".',
    },
    resourceId: {
        label: 'Resource ID',
        id: 'resourceId',
        type: extensions_core_1.FieldType.NUMERIC,
        required: false,
        description: 'Unique identifier of the resource the task is attached to.',
    },
    completed: {
        label: 'Completed?',
        id: 'completed',
        type: extensions_core_1.FieldType.BOOLEAN,
        required: false,
        description: 'Indicator of whether the task is completed or not.',
    },
    remindAt: {
        label: 'Remind at',
        id: 'remindAt',
        // Time will be auto-set to 00:00:00 as FieldType.DATE provides only date
        type: extensions_core_1.FieldType.DATE,
        required: false,
        description: 'The date at which Zendesk should send you a reminder about the task.',
    },
};
const resourceTypeEnum = zod_1.z.enum([types_1.ResourceType.CONTACT, types_1.ResourceType.DEAL, types_1.ResourceType.LEAD]);
exports.FieldsValidationSchema = zod_1.z.object({
    content: zod_1.z.string().nonempty(),
    dueDate: extensions_core_1.DateTimeOptionalSchema,
    ownerId: (0, extensions_core_1.makeStringOptional)(extensions_core_1.NumericIdSchema),
    resourceType: (0, extensions_core_1.makeStringOptional)(resourceTypeEnum),
    resourceId: (0, extensions_core_1.makeStringOptional)(extensions_core_1.NumericIdSchema),
    completed: zod_1.z.boolean().optional(),
    remindAt: extensions_core_1.DateTimeOptionalSchema,
});
//# sourceMappingURL=fields.js.map