"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.SalesItem = exports.SalesItemSchema = exports.SALES_FIELDS = void 0;
const mongoose_1 = __importDefault(require("mongoose"));
const _models_1 = require("./_models");
exports.SALES_FIELDS = [
    '_id',
    'sku',
    'skuName',
    'unitsSold',
    'unitsCost',
    'unitSalePrice',
    'salesPeriodStart',
    'salesPeriodEnd',
    'salesPerDay',
];
exports.SalesItemSchema = 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,
    },
    sku: {
        type: String,
        trim: true,
        required: true,
    },
    skuName: {
        type: String,
        trim: true,
        required: false,
    },
    unitsSold: {
        type: Number,
        required: true,
    },
    unitsCost: {
        type: Number,
        required: false,
    },
    unitSalePrice: {
        type: Number,
        required: false,
    },
    salesPeriodStart: {
        type: Date,
    },
    salesPeriodEnd: {
        type: Date,
    },
    salesPerDay: {
        type: Number,
    },
    __v: { type: Number, select: false },
}, { timestamps: true });
exports.SalesItem = mongoose_1.default.model(_models_1.MODEL_NAMES.salesItem, exports.SalesItemSchema);
