"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.UploadedFileSchema = void 0;
const mongoose_1 = __importDefault(require("mongoose"));
const _models_1 = require("./_models");
const mongooseLeanId = require('../plugins/id.plugin');
exports.UploadedFileSchema = new mongoose_1.default.Schema({
    filename: {
        type: String,
        required: false,
        trim: false,
    },
    originalName: {
        type: String,
        required: false,
        trim: false,
    },
    borrowerId: {
        type: mongoose_1.default.Schema.Types.ObjectId,
        ref: _models_1.MODEL_NAMES.borrowers,
        required: false,
    },
    userId: {
        type: String,
        required: false,
    },
    converted: {
        type: Boolean,
        default: false,
    },
    type: {
        type: String,
        required: true,
    },
    __v: { type: Number, select: false },
}, { timestamps: true });
exports.UploadedFileSchema.plugin(mongooseLeanId);
exports.default = mongoose_1.default.model(_models_1.MODEL_NAMES.uploadedFile, exports.UploadedFileSchema);
