I wonder which input do you request from the user when booking a room besides the 8 digit customer id. Do you for example ask the user to input the number of accommodations for the room?
And if you do, I wonder how you handle tihe unbooking of a room? When a room is booked lets say for 5 days, when do you let the user unbook the room? The booking period might be shorter, longer than requested. How do cope with it?
Thanks for helping.
I took a very simple approach:
That's it. Pretty easy, isn't it
Axel Leucht wrote:Do I understand you correctly that once you booked a room you can't book it again (and it stay booked forever) as it is now booked?
I reread my assignment and indeed the unbooking method isn't required, but this seems to be weird to me, isn't it?
Hi Axel, the assignment really requires the book and search methods. Once a room is booked, it is booked. You may provide a unbook method for the client UI but that's not necessary. If you asked about the book method, you may also wondering what about the delete method (like once a room is created, can I delete it).
In my implementation of UB I provided book/unbook, search, create/delete methods. Again the delete method is not necessary. Now regarding your earlier post about when to you allow a room to unbook itself... I did mine as anytime. Meaning once I book it, I can immediately unbook it. You may noticed the 48-hour window for booking rooms. I used this info to set the date also. Some people just ignore the date when booking rooms.
The assignment is more than complicated enough, so I did only what was required:
So you can now implement unbook functionality and do a lot of thinking about it, with some rules. And then the business guys come up with a whole other set of rules for unbooking a room, so all your work will be gc'ed
They asked for finding rooms and booking a room, so that's what they got. And indeed it's a bit weird, but you won't get any extra credit/points for doing more than what's expected, you may even lose some points...