• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

48 Hour rule again.

 
Muthaiah Ramanathan
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

First of all, I'm aware that there are lot of posts regarding this issue before. But I just wanted to know if my assumptions below are right. (Not contradicting with the instructions.html).

1. If the date available is in the past(earlier than today) the room has been empty since then and is ready to be booked.
2. If the available date lies in the future, the room is not available.
3. A room cannot be booked in the past.
4. A room can be booked for more than one day.
5. When a room has been booked, the date available will set to the date when the booking ends for that room.
6. The bookings can be done only if the desired booking date lies within 48 hours (2 days from now).

Is there a statement in the requirement that contradicts the above assumptions? If so can you point it?

Your opinion will be much appreciated.
 
Ta Ri Ki Sun
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Incorrect, the room cannot be booked if it was available yesterday for instance.
2. Correct, it is available, but only if system date is within 48 hours of the available date. NB This is the point being debated on the forum, it would appear it's not mandatory to enforce this rule because there's no MUST associated with it.
3. Correct, which confuses me because this is the same as 1. worded differently.
4. Incorrect, the date you see is the date it's available for, nothing more, it's not a start date.
5. Incorrect, the only update you do when booking a room is the client id, no other updates are required.
6. This seems familiar I trust you got the jist of that by now.
 
Muthaiah Ramanathan
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks TQ,


1. Incorrect, the room cannot be booked if it was available yesterday for instance.

This is confusing me. I remember getting the same answer from you few months back. I view the available date as the date from which, the room is free to occupy. I guess this is not clearly stated in the instructions right?


4. Incorrect, the date you see is the date it's available for, nothing more, it's not a start date.
5. Incorrect, the only update you do when booking a room is the client id, no other updates are required.

I understand these issue also boils down to how you view the available date.

I am almost done with my assignment - I got confused while doing the choices.txt and that's why I thought I will ask you guys. If I clearly state my assumptions in the choices.txt, will it be enough?
 
Ta Ri Ki Sun
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Muthaiah, I see why you're confused about this.
If you look at your database schema section in the instructions document, you'll find
Date available date 10 The single night to which this record relates, format is yyyy/mm/dd.


I think you'll need to rework that section of your code, it won't be enough to document your assumption because it's unfounded.
 
Muthaiah Ramanathan
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks TQ,

Yes. Now I understand. Well anyway, its never too late.

Regards,

Muthaiah.
 
Ta Ri Ki Sun
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Muthaiah Ram:
Thanks TQ,

Yes. Now I understand. Well anyway, its never too late.

Regards,

Muthaiah.


You're most welcome, good luck with the exam
 
Muthaiah Ramanathan
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since the available date doesn't contain the time in the database, can the booking be allowed for today, tomorrow and the day after tomorrow.

Say for example, if we assume the current date is Oct 11 2005 10.00am, the user can book the room for today, tomorrow (12th Oct) and for Day after tomorrow (on 14th Oct) until 10.00am actually. But since the database simply contains only the date and not the time, the user is allowed to book until midnight on 13th Oct.

Does this sound meaningful?
 
Ta Ri Ki Sun
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Muthaiah Ram:
Since the available date doesn't contain the time in the database, can the booking be allowed for today, tomorrow and the day after tomorrow.

Say for example, if we assume the current date is Oct 11 2005 10.00am, the user can book the room for today, tomorrow (12th Oct) and for Day after tomorrow (on 14th Oct) until 10.00am actually. But since the database simply contains only the date and not the time, the user is allowed to book until midnight on 13th Oct.

Does this sound meaningful?


Yes, that makes perfect sense. I completely ignored the time, in fact I got today's date and reset the time to zero and then compared it to the db date.
Others have done it differently and it wouldn't be wrong, this sort of decision you can document.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic