-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy pathbookingModels.js
More file actions
29 lines (23 loc) · 869 Bytes
/
bookingModels.js
File metadata and controls
29 lines (23 loc) · 869 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// models/bookingModels.js
const mongoose = require("mongoose");
// Define Room schema
const roomSchema = new mongoose.Schema({
roomNumber: { type: String, required: true },
roomType: { type: String, required: true },
pricePerHour: { type: Number, required: true },
});
const Room = mongoose.model("Room", roomSchema);
// Define Booking schema
const bookingSchema = new mongoose.Schema({
userEmail: { type: String, required: true },
roomNumber: { type: String, required: true },
startTime: { type: Date, required: true },
roomType : {type : String, required : true},
endTime: { type: Date, required: true },
totalPrice: { type: Number},
// New fields
isReported: {type: Boolean, default:false},
reportReason: {type: String, defult: null},
});
const Booking = mongoose.model("Booking", bookingSchema);
module.exports = { Booking, Room };