"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CreateTaskSchema = exports.TaskSchema = void 0;
const extensions_core_1 = require("@awell-health/extensions-core");
const zod_1 = require("zod");
const atoms_1 = require("./atoms");
exports.TaskSchema = zod_1.z.object({
    assignedBy: atoms_1.UserReferenceSchema.optional(),
    assignedTo: atoms_1.UserReferenceSchema.optional(),
    assignees: zod_1.z.array(atoms_1.UserReferenceSchema).optional(),
    comments: zod_1.z.any(), // Leave untyped for now
    completedBy: atoms_1.UserReferenceSchema.optional(),
    completedDt: extensions_core_1.DateTimeOptionalSchema,
    createdDateTime: extensions_core_1.DateTimeSchema,
    creator: atoms_1.UserReferenceSchema,
    description: zod_1.z.string(), // Required when creating a task
    details: zod_1.z.string().optional(),
    dueDate: extensions_core_1.DateTimeOptionalSchema,
    duplicated: zod_1.z.boolean().optional(),
    edited: zod_1.z.boolean().optional(),
    hasMentions: zod_1.z.boolean().optional(),
    id: zod_1.z.string(),
    identifier: zod_1.z.string().optional(),
    includeTaskGroup: zod_1.z.boolean().optional(),
    parentTask: atoms_1.TaskReferenceSchema.optional(),
    patient: atoms_1.PatientReferenceSchema.optional(),
    priority: zod_1.z.enum(['HIGH', 'MEDIUM', 'LOW', 'NONE']).optional(),
    read: zod_1.z.boolean().optional(),
    reminderDt: extensions_core_1.DateTimeOptionalSchema,
    reminderTime: zod_1.z.string().optional(),
    reminderType: zod_1.z
        .enum(['NONE', 'DAY_OF', 'DAY_BEFORE_1', 'DAY_BEFORE_2', 'WEEK_BEFORE_1'])
        .optional(),
    sourceMessage: zod_1.z.string().optional(),
    status: zod_1.z.enum(['COMPLETE', 'INCOMPLETE']),
    subTaskSortIndex: zod_1.z.number().optional(),
    subTasksCompletedCount: zod_1.z.number().optional(),
    subTasksCount: zod_1.z.number().optional(),
    subtasks: zod_1.z.array(zod_1.z.string()).optional(),
    taskGroup: atoms_1.TaskGroupSchema.optional(),
    taskList: atoms_1.TaskListReferenceSchema, // Required when creating a task
    taskMentions: zod_1.z.array(zod_1.z.any()).optional(), // Leave untyped for now,
    taskMetaData: atoms_1.TaskMetadataSchema,
    taskOutcomes: zod_1.z.array(zod_1.z.any()).optional(), // Leave untyped for now,
    templateTaskIdentifier: zod_1.z.string().optional(),
    tokenizedDescription: zod_1.z.string().optional(),
    tokenizedDetails: zod_1.z.string().optional(),
    type: zod_1.z.enum(['IN_APP', 'EMAIL', 'TEMPLATE', 'BUNDLE']).optional(),
    updated: zod_1.z.boolean().optional(),
    updatedDateTime: extensions_core_1.DateTimeOptionalSchema,
    workflowStatus: atoms_1.TaskWorkflowStatusReferenceSchema.optional(),
});
exports.CreateTaskSchema = exports.TaskSchema.pick({
    description: true,
    taskList: true,
    patient: true,
    taskMetaData: true,
    taskGroup: true,
});
//# sourceMappingURL=task.schema.js.map