"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.SalesModel = exports.SalesSchema = void 0;
const mongoose_1 = __importDefault(require("mongoose"));
const _models_1 = require("./_models");
exports.SalesSchema = new mongoose_1.default.Schema({
    borrowerId: {
        type: String,
        trim: true,
        required: true,
    },
    bbcDate: {
        type: Date,
        required: true,
    },
    uploadUser: {
        type: String,
        trim: true,
    },
    fileHash: {
        type: String,
        trim: true,
    },
    fileName: {
        type: String,
        trim: true,
    },
    sheetName: {
        type: String,
        trim: true,
    },
    comment: {
        type: String,
        trim: true,
    },
    items: [
        {
            bbcDate: {
                type: Date,
                required: true,
            },
            sku: {
                type: String,
                trim: true,
                required: true,
            },
            skuName: {
                type: String,
                trim: true,
            },
            unitsSold: {
                type: Number,
                required: true,
            },
            unitSalePrice: {
                type: Number,
                required: true,
            },
        },
    ],
    __v: { type: Number, select: false },
}, { timestamps: true });
exports.SalesModel = mongoose_1.default.model(_models_1.MODEL_NAMES.sales, exports.SalesSchema);
