GithubHelp home page GithubHelp logo

restaurant-reservations-system_backend's Introduction

Capstone: Restaurant Reservation System Backend

  • code for the back end of the final capstone project in the Thinkful curriculum.

Restaurant Reservations-System-Back-End - created with PostgreSQL, Express, Node.js (with npm packages) --> using HTML5, JavaScript, Bootstrap

--> A full-stack restaurant reservation system for restaurant operators to use to keep track of reservations and tables at the restaurant given restaurant schedule as parameters.

API Documentation

/reservations

GET: ?date=YYYY-MM-DD

Returns a list of reservations made for a given date.

GET: ?mobile_number={mobile-number}

Returns a full or partial phone number matched to a reservation(s)

POST

** All requests that send a reservation object will have data validation to pass.

  • First name and last name have no constraints.
  • The mobile number must be in a hyphenated format. xxx-xxxx or xxx-xxx-xxxx.
  • The date must be in the format YYYY-MM-DD. Also, the date must occur either on the current day or in the future.
  • The time must be in 24H (HH:MM) format. Also, if the date property is on today's date, the time must not have passed on that day when the request is made.
  • People must be an integer greater than 0.
  • Returns status 201 and the created reservation object.

/reservations/:reservation_id

GET

If the reservation defined by it's reservation_id in the request URL exists, it returns the reservation object.

PUT

Returns status 200 and the updated reservation.


/reservations/:reservation_id/status

PUT

Returns status 200 and an updated status for a reservation


/tables

GET

Returns a list of all tables for the restaurant in the database

POST

  • table_name does not need to include a # sign, but it must be a string greater than one character.
  • capacity must be an integer greater than 0.
  • reservation_id is optional, but if one is passed, it must be the ID of a reservation that does exist in the database.
  • Returns 201 and the created table.

/tables/:table_id

GET

If the table defined by its table_id in the request URL exists, it returns the reservation object.


/tables/:table_id/seat

PUT

  • If the table_id passed in the parameters exists, the reservation_id passed in the body exists, and the table is currently not occupied as well as the reservation belonging to the reservation_id is only booked, and not seated, finished, or canceled: the table will be updated with the reservation_id.
  • When the table is updated with a reservation_id, that means the reservation is now seated at a table. Accordingly, the reservation's status will also be updated to reflect its "seated" status.
  • Returns status 200 and the updated reservation, not the table.

DELETE

  • If the table exists, and the table has a reservation_id property that is not null or undefined, the table's reservation_id property will be set to 'free'.
  • Returns status 200 and the updated reservation object associated with the change to the table.

restaurant-reservations-system_backend's People

Contributors

ada-ai3915 avatar

Stargazers

Tyrese, BlockWarrior avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.