aboutsummaryrefslogtreecommitdiffstats
path: root/backend/src/models/Table.js
diff options
context:
space:
mode:
Diffstat (limited to 'backend/src/models/Table.js')
-rw-r--r--backend/src/models/Table.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/backend/src/models/Table.js b/backend/src/models/Table.js
new file mode 100644
index 0000000..7653b3e
--- /dev/null
+++ b/backend/src/models/Table.js
@@ -0,0 +1,36 @@
+const mongoose = require('mongoose');
+
+const tableSchema = new mongoose.Schema(
+ {
+ tableNumber: {
+ type: Number,
+ required: [true, 'Table number is required'],
+ unique: true
+ },
+ capacity: {
+ type: Number,
+ required: [true, 'Capacity is required'],
+ min: 1
+ },
+ location: {
+ type: String,
+ enum: ['indoor', 'outdoor', 'balcony', 'private'],
+ default: 'indoor'
+ },
+ available: {
+ type: Boolean,
+ default: true
+ },
+ isReserved: {
+ type: Boolean,
+ default: false
+ }
+ },
+ {
+ timestamps: true
+ }
+);
+
+const Table = mongoose.model('Table', tableSchema);
+
+module.exports = Table; \ No newline at end of file