"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 referralOrder_zod_1 = require("../../../validation/referralOrder.zod");
const lodash_1 = require("lodash");
exports.fields = {
    referralOrderId: {
        id: 'referralOrderId',
        label: 'Referral Order ID',
        type: extensions_core_1.FieldType.NUMERIC,
        required: true,
    },
    resolutionState: {
        id: 'resolutionState',
        label: 'Resolution state',
        type: extensions_core_1.FieldType.STRING,
        required: true,
        options: {
            dropdownOptions: Object.values(referralOrder_zod_1.ResolutionStateSchema.enum).map((resolution) => ({
                label: (0, lodash_1.startCase)(resolution),
                value: resolution,
            })),
        },
    },
    resolvingDocument: {
        id: 'resolvingDocument',
        label: 'Resolving document',
        type: extensions_core_1.FieldType.NUMERIC,
        required: true,
        description: 'The ID of the document that resolves the referral order. Can be f.e. a reference to a non-visit note. Required if the resolution state is "fulfilled".',
    },
};
exports.FieldsValidationSchema = zod_1.z.object({
    referralOrderId: extensions_core_1.NumericIdSchema,
    resolutionState: referralOrder_zod_1.ResolutionStateSchema,
    // Making it optional as making it required would break the extension for existing workflows
    // I'll make it required once we've updated the Suvida flows
    resolvingDocument: extensions_core_1.NumericIdSchema.optional(),
});
//# sourceMappingURL=fields.js.map