I tried to give it a chance without thinking much and this is what I came up with:
Room
----
| ID | No. | Type | Price | Beds | Hotel| Size | Minibar | Images | Booked |
| ---|------|---------|---------|----- | --- | ---- | ----- | ----- | ----- |
| 1 | 101 | Deluxe | 5000.00 | 2 | A | 31m^2 | yes |
| 2 | 102 | Economy | 4000.00 | 1 | A | 25m^2 | no
| 1 | 103 | Deluxe | 5000.00 | 1 | A | 31m^2 | yes
| 2 | 104 | Suite | 9000.00 | 2 | A | 50m^2 | yes
Room continued
| ID | TV | Bathroom
| ---| -------- | ------
| 1 | 32inch(hdtv) | Private
| 2 | 30inch(flat) |
| 1 | |
| 2 | 70inch(LED) |
I see that there are many facilities which belongs to a room and I tried to create a column for each but it started looking hairy. Also, Hotel
column will be a many2one field as well as Images
column too.
I know that the booking information shouldn't belong to Room
instead it should go to Booking
table. I am thinking where should the booking time and checkout time go? in Booking
table?
Apart from these information, what other information do I need to persist?
Update
While designing persistence layer I observed that the problem is same as in programming I need to keep a good balance between tables such that I maintain low coupling and high cohesion.
Use Case
There is a merchant
which can have many hotels
probably at many locations
. Given a user it can check availability of the rooms
at any given hotel and should be able to book a room
for any particular time frame.
description
column which could contain some general information or special features, this column would be HTML formatted. Good suggestion regarding thumbnail.