"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.InventoryItemModel = exports.InventoryItemSchema = exports.INVENTORY_FIELDS = void 0;
const mongoose_1 = __importDefault(require("mongoose"));
const _models_1 = require("./_models");
const mongooseLeanId = require('../plugins/id.plugin');
exports.INVENTORY_FIELDS = [
    '_id',
    'skuDate',
    'category',
    'sku',
    'qty',
    'value',
    'expiryDate',
    'location',
    'unitCost',
    'skuDescription1',
    'skuDescription2',
    'skuDescription3',
    'detail1',
    'detail2',
    'detail3',
];
exports.InventoryItemSchema = new mongoose_1.default.Schema({
    bbcSheetId: {
        type: mongoose_1.default.Schema.Types.ObjectId,
        ref: _models_1.MODEL_NAMES.BBCSheets,
        required: true,
    },
    order: {
        type: Number,
        required: true,
    },
    skuDate: {
        type: Date,
        required: true,
    },
    category: {
        type: String,
        trim: true,
        default: 'NO CATEGORY',
    },
    sku: {
        type: String,
        trim: true,
        required: true,
    },
    lotNumber: {
        type: String,
        trim: true,
        required: false,
    },
    qty: {
        type: Number,
        required: true,
    },
    value: {
        type: Number,
        required: true,
    },
    expiryDate: {
        type: Date,
    },
    location: {
        type: String,
        trim: true,
    },
    unitCost: {
        type: Number,
    },
    skuDescription1: {
        type: String,
        trim: true,
    },
    skuDescription2: {
        type: String,
        trim: true,
    },
    skuDescription3: {
        type: String,
        trim: true,
    },
    detail1: {
        type: String,
        trim: true,
    },
    detail2: {
        type: String,
        trim: true,
    },
    detail3: {
        type: String,
        trim: true,
    },
    __v: { type: Number, select: false },
}, { timestamps: true });
exports.InventoryItemSchema.plugin(mongooseLeanId);
exports.InventoryItemModel = mongoose_1.default.model(_models_1.MODEL_NAMES.inventoryItem, exports.InventoryItemSchema);
