import mongoose from "mongoose"

const StatSchema = new mongoose.Schema(
    {
        totalCustomers: Number,
        yearlySalesTotal: Number,
        yearlyTotalSoldUnits: Number,
        yaer: Number,
        monthlyData: [
            {
                month: String,
                totalSales: Number,
                totalUnits: Number,
            },
        ],
        dailyData: [
            {
                date: String,
                totalSales: Number,
                totalUnits: Number,
            },
        ],
        salesByCategory:{
            type: Map,
            of: Number,
        },
    },
    {timestamps: true}
);

const Stat = mongoose.model("Stat", StatSchema);
export default Stat;