Hello guys, iam working on the design of a LIMS database . I should implement a simplified version, which is more common with a Booking System. So every user should be able to Book a resource ( Classroom, Waffer Machine etc). Every user should be able to see its Bookings and the admin should be able to see all bookings per user. The admin should also be able to see Bookings per Resource, and of course the web app should be able to retrieve booked dates of a specific resource in order to prevent overlaped bookings for the same resource. So my schema is this:
Users {
_Id: ObjectId
name: String
email: String
hashed_password: String
phone: String
role: String, enum:[“admin”,“user”]
}Bookings{
_Id: ObjectId
userID: reference User
date_started:Date
date_finished:Date
Project_title: String
Project_description: String
total_cost: Number
}Resources{
_Id: ObjectId
name: String
status: String, enum [“available”,“reserved”]
cost_per_day: Number
photoURL: String
reservation: [
BookingID: reference Booking
date_started: Date
date_finished: Date
}
I would like to hear your opinions, if this schema satisfies both the functional requirements and anti-patterns hints, like unbounded arrays etc