Reservation system for hotel


#1

Hi, I’m trying to make an app for a small hotel where I could load
rooms into a database then assign a different nightly rate to them for
each day in a calendar year. Each room would be loaded individually
into the DB and and have it’s own rate, you would then be able to
search for a room by entering a date rang, the app would display all
available rooms and the total nightly rate
I’m not sure what the best practice to set this up would be. Does
anyone know of an example app I could look at?

Thanks for your help - Greg.


#2

Simple.

Two tables.

Rooms :
Has info like double bed, fridge, size and such.

costs : <---- might need a better name
room_id
day
price

Then you would say something like room has many costs
And then I would just use julian dates and you can easily ask each
room for dates in a given range.

Trausti


#3

Trausti Thor J. wrote:

Simple.

Two tables.

Rooms :
Has info like double bed, fridge, size and such.

costs : <---- might need a better name
room_id
day
price

Then you would say something like room has many costs
And then I would just use julian dates and you can easily ask each
room for dates in a given range.

Julian dates? Isn’t that a bit of a low-level implementation detail?
Personally, I’d try to do this using native Ruby and DB date types.

Trausti

Best,

Marnen Laibow-Koser
http://www.marnen.org
removed_email_address@domain.invalid


#4

You should also track inventory of rooms and handle a range of dates
(periods).

Other than that I like it :stuck_out_tongue:

On Nov 13, 10:15 am, Trausti Thor J. removed_email_address@domain.invalid


#5

Thanks for your help! So I’m trying to put this together, when I
create a new unit in the units table I also want the unit_id field
that is entered by the user to enter into the unit_id column of the
rates table as well. I know this stuff is simple, I’m still learning,
I’ve trolled through these forums but can’t seem to find an answer.
Any help is greatly appreciated.

This is what I have to enter into the unit_id column in the unit
table:

<% form_for(@unit) do |f| %>

Unit
<%= f.text_field :unit_id %>

Thanks!

On Nov 13 2009, 8:15Â am, Trausti Thor J. removed_email_address@domain.invalid


#6

Thanks for your help - Greg.

Hi Greg and everybody,

Have you figured out a way to implement advanced rate changes? To
clarify what this is, let me give you an example.

Assume today is the first of January.
Hotel management decides that effective February 1, all room rates
will increase.
You still can’t change the values in the rates table, obviously. But
if somebody books in advance for February 2, the system should use the
new rates (which would have been effective already by then.)

I’ve been thinking about this for a few days now and i still haven’t
come up with a good solution. I could create a RateChange model with
the effectivity date and the new rate, and then a room will have many
rate_changes. I don’t know yet. I’m really stumped.


#7

On Feb 1, 2010, at 7:57 PM, adrianb wrote:

I’m not sure what the best practice to set this up would be. Does
anyone know of an example app I could look at?

Thanks for your help - Greg.

Hi Greg and everybody,

Have you figured out a way to implement advanced rate changes? To
clarify what this is, let me give you an example.

Your question isn’t really a Rails question, but a good way to do this
would be to have a bookings model and an inventory model.

The rooms are ‘inventory’. Their selling price is in the inventory
model. Dynamic changes can take place to the inventory while retaining
previously booked room rates. .

The pricing model is linked to the inventory by date, or season, etc.
Rake tasks nightly could update the inventory based on objects in the
pricing model.

When a booking occurs you create a booking to lock-in the rate, and
eventually that booking turns into an invoice when the customer checks
in.

You’re going to have to allow for the employee to make changes to the
booking rate (with manager approval, of course) in the event the
customer comes in and changes their room after a pricing event has
taken place. etc.

-john


John Adams (@netik)
Retina Communications
removed_email_address@domain.invalid
http://www.retina.net/tech
this email is: [ ] bloggable [ x ] ask first [ ] confidential


#8

I would put both start date and end date. That could simplify the
calculations a little.

Milan D.
http://www.milandobrota.com


#9

Thanks for the insight John. I think i glossed over my problem in my
post. My system isn’t a hotel reservation system but a ticketing
system for a shipping line. I got the reservation part down (by
treating cots as inventory - which is exactly ChilliCoder’s
suggestion), but the client would like advanced rate changes to be
setup to allow for bookings made in advance.

The models i’m using are Voyage, Vessel, Route, Rate,
AccommodationType, Reservation, etc. Voyage belongs to Route, Route
belongs to Vessel, Vessel has many AccommodationTypes, Route has many
Rates, Rate belongs to AccommodationType. I decided to put an
effectivity date in the Rate model and do some checking to determine
which rate is effective based on the Voyage’s departure date. So far
so good.


#10
Greg..
Take a look at OpenCampground.com for a gpl licensed app that is similar in requirements.  It is for campground space reservations but the general requirements are similar.

Norm



You received this message because you are subscribed to the Google
Groups “Ruby on Rails: Talk” group.

To post to this group, send email to
removed_email_address@domain.invalid.

To unsubscribe from this group, send email to
removed_email_address@domain.invalid.

For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.