• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

UrlyBird - they take booking only within 48 hours...

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I am close to submit, I want to review the way I implemented the booking method:

I do have these requirements :

-"They take bookings only within 48 hours of the start of room occupancy"

-The field owner (customer) is described as follows "If this field is all blanks, the record is available for sale"

- date field has the following description : "Date available : The single night to which this record relates, format is yyyy/mm/dd."

1- which parameters do you provide when booking the room?

I povide the booking date and the duration (which the number of nights the room is booked for) - the date field will be the booking date increased by the duration. I wonder if I am providing more parameters than required?

2- I am getting confused about the role of the owner and date fields, In my implementation the booking request is accepted If (date is today and owner is empty) or (date is tomorrow and owner is empty) or (date is after tomorrow and owner is empty). am I wrong?

3- If available date is yesterday and owner is not empty, do we allow the room to be booked? (it is available but owner is not empty!)

5- If date is after today +48 hours and the owner is empty, do we allow the room to be booked. (it is beyond the scope of 48 hours but not affected to any one!)

Please help

Best Regards
 
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


1- which parameters do you provide when booking the room?



Your approach is interesting, because your are providing the duration. So, you reset the availability date to the end of the reservation period.

In my case I am just setting the ownership of the record and keeping the date as is. I believe that changing the date of record would tell when the reservation period ends, but not when it started, and I my case I believe that the important thing is to know when the client is going to get to the hotel.

Now, it is not stated in the specification, but I guess there should a process, in the future, that allows a client to cancel a reservation or to check out from the hotel, in whose case, the availability date would be reset to a new value.

My booking method signature is: DAOHotel.book(Hotel hotel,String owner). And it simply assigns the value of the owner to the hotel hotel record and updates the corresponing object.

However, as you know,I would not dare to say that your approach is incorrect.


2- I am getting confused about the role of the owner and date fields, In my implementation the booking request is accepted If (date is today and owner is empty) or (date is tomorrow and owner is empty) or (date is after tomorrow and owner is empty). am I wrong?



I am doing the same thing, I determine availability of a room based on the current time plus 48 hours. I do the calculation using a Calendar:



So, basically it is the same thing that your are doing, that might work for today, tomorrow and the day after tomorrow. But I've been feeling like you, that is: is this what 48-hours really mean?


3- If available date is yesterday and owner is not empty, do we allow the room to be booked? (it is available but owner is not empty!)



As I said before, I consider this rooms not available. I assume that another process (unknown to me) of guest checkout or reservation cancelation is responsible of reseting the values of these rooms, or maybe the guest simply decided to stay longer in the hotel. Therefore I consider this rooms not available.


5- If date is after today +48 hours and the owner is empty, do we allow the room to be booked. (it is beyond the scope of 48 hours but not affected to any one!)



I consider these cases as "not available". And this particular case I would not risk to do otherwise.
[ October 11, 2006: Message edited by: Edwin Dalorzo ]
 
rubbery bacon. crispy tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic