0

Build a restaurant reservation system with the following function:

Here's the list of prioritized functions:

Restaurant Owner

  • can set number of tables (assuming all 4 seating per table)
  • can review current reservation,
  • reservation older than 2 hours are automatically cleared
  • can add reservation done over phone for given day/time
  • can remove reservation
  • can update reservation done over phone

Customer

  • can review number of available table for day / time
  • can add reservation for day / time, get confirmation number
  • can cancel reservation with confirmation number
  • can update reservation with confirmation number

I am completely new to ruby on rails, I just need a simple hint on how to get started and what should be my approach for this problem?

1 Answer 1

2

Start by defining the models (entities), their properties, and how they relate to each other. Next, figure out what functionality needs to be exposed to the front end.

(Those steps can occur in either order, or, more realistically, each will affect your thoughts about the other, so it bounces back and forth as you iterate over the various things the system must handle.)

Expand the user stories you have above with conditions you'll encounter and how you'll know it's done. Rails makes it easy to get starting building up preliminary functionality--don't get hung up with how it looks at first, just make sure you can actually do what you need to.

You'll also need a user authentication/authorization system; I recommend using an existing one like authlogic or devise. Whether or not you need something like cancan for authorization I don't know; but you'll need some way of making sure people can only see what they're supposed to be able to.

You'll also need something like eventmachine for sweeping away old reservations (man, in NYC if you're like 10 minutes late, you're outta there!) but take things a step at a time--first just implement the sweeper as a manual process to get the logic worked out.

Good luck!

Sign up to request clarification or add additional context in comments.

2 Comments

Hey Dave, Thanks a lot, but do you think it would a good idea to start by generating scaffold for both Owner and Customer?
@VändänÄPatel Possibly, although I might make them subclasses of a User, or just have an "owner" flag in a single model. I think if I were doing it I'd also start with some high-level sketches of restaurant and reservation models as well, and make sure I understood as muchnasi could about the relationships between them all. Also, if I'm using a canned authentication system, I'd make sure I was creating users I could use with that system without a lot of trouble.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.