"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Table = exports.Floor = exports.Product = exports.Category = void 0;
const mongoose_1 = __importDefault(require("mongoose"));
// --- Category ---
const CategorySchema = new mongoose_1.default.Schema({
    name: { type: String, required: true },
    icon: String,
    color: String,
});
exports.Category = mongoose_1.default.models.Category || mongoose_1.default.model('Category', CategorySchema);
// --- Product ---
const ProductSchema = new mongoose_1.default.Schema({
    name: { type: String, required: true },
    price: { type: Number, required: true },
    category: { type: mongoose_1.default.Schema.Types.ObjectId, ref: 'Category' },
    image: String,
    available: { type: Boolean, default: true },
    isAddon: { type: Boolean, default: false },
});
exports.Product = mongoose_1.default.models.Product || mongoose_1.default.model('Product', ProductSchema);
// --- Floor ---
const FloorSchema = new mongoose_1.default.Schema({
    id: { type: Number, required: true, unique: true }, // Using number ID to match frontend for now, or could use auto-generated _id
    name: { type: String, required: true },
});
exports.Floor = mongoose_1.default.models.Floor || mongoose_1.default.model('Floor', FloorSchema);
// --- Table ---
const TableSchema = new mongoose_1.default.Schema({
    id: { type: Number, required: true, unique: true }, // Custom ID to match frontend
    name: { type: String, required: true },
    seats: { type: Number, default: 4 },
    floorId: { type: Number, required: true },
    status: { type: String, enum: ['available', 'occupied', 'reserved'], default: 'available' },
    x: { type: Number, default: 0 },
    y: { type: Number, default: 0 },
    width: Number,
    height: Number,
    shape: { type: String, enum: ['rect', 'circle', 'square'], default: 'circle' },
    currentOrderId: { type: mongoose_1.default.Schema.Types.ObjectId, ref: 'Order' },
});
exports.Table = mongoose_1.default.models.Table || mongoose_1.default.model('Table', TableSchema);
// Order model moved to Order.ts
