"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Underwriter = exports.UnderwriterSchema = exports.UnderwriterValidationSchema = void 0;
const mongoose_1 = __importDefault(require("mongoose"));
const joi_1 = __importDefault(require("joi"));
const _models_1 = require("./_models");
exports.UnderwriterValidationSchema = joi_1.default.object({
    _id: joi_1.default.string(),
    name: joi_1.default.string().required(),
    email: joi_1.default.string(),
    userId: joi_1.default.string(),
    isDeleted: joi_1.default.boolean(),
    order: joi_1.default.number().required().allow(null),
});
exports.UnderwriterSchema = new mongoose_1.default.Schema({
    isDeleted: {
        type: Boolean,
        default: false,
    },
    name: {
        type: String,
        required: true,
    },
    order: {
        type: Number,
        required: true,
    },
    email: {
        type: String,
    },
    userId: {
        type: String,
        required: false,
    },
}, {
    timestamps: { createdAt: true, updatedAt: true },
    versionKey: false,
});
exports.Underwriter = mongoose_1.default.model(_models_1.MODEL_NAMES.underwriters, exports.UnderwriterSchema);
