Skip to content

Generic Hotel API for a basic hotel booking system created with NestJS and SQLite.

License

Notifications You must be signed in to change notification settings

betschki/hotel-api

Repository files navigation

Generic Hotel API

Generic Hotel API for a basic hotel booking system created with NestJS and SQLite.

(this is a hobby project to learn NestJS)

Table of contents

ToDos

  • Develop /hotels route
    • split address into address Object instead of string
    • implement /:id/rooms after basic /rooms route is created
    • add "number of rooms" to GET /hotels/:id Issue
    • implement /:id/categories after basic /categories route is created
  • Develop /rooms route
  • Develop /categories route
  • Develop /reservations route
    • add /:id/rooms route
  • Develop /guests route
    • add /:id/reservations
  • Set up typeorm relations (POST)
    • hotel --> rooms (OneToMany)
    • rooms --> hotels (ManyToOne)
    • categories --> rooms (OneToMany)
    • rooms --> categories (ManyToOne)
    • hotel --> cateogies (OneToMany)
    • categories --> hotels (ManyToOne)
    • reservations --> categories (ManyToMany)
    • categories --> reservations (ManyToMany)
    • reservations --> rooms (ManyToMany)
    • rooms --> reservations (ManyToMany)
    • reservations --> guest (ManyToOne)
    • guest --> reservations (OneToMany)
  • Set up typeorm relations for PATCH methods
    • /hotels
    • /rooms
    • /categories
    • /reservations
    • /guests
  • add Swagger for API documentation
  • add validation that POST /rooms can only contain roomCategory that belongs to hotel in request
  • add validation that roomNumbers cannot be used multiple times in same hotel
  • Strategy for date availability checker
  • Integrate authentication
  • Connect with Webflow API (as database option)

General info

This project serves a simple hotel booking system API that includes the following aspects (CRUD):

  • hotels can be created, viewed, updated, and deleted
  • room categories can be created, viewed, updated, and deleted
  • rooms can be created, viewed, updated, and deleted
  • guests can be created, viewed, updated, and deleted
  • reservations can be created, viewed, updated, and deleted

Hotels

A hotel has basic information, such as:

  • id
  • hotel name
  • star rating
  • address
  • number of rooms (dynamic, based on rooms attached to hotel)
  • room categories (dynamic, based on room categories attached to hotel)

Room Categories

Room categories are always tied to a hotel. One room category can not have multiple hotels, but a hotel can have multiple room categories. The name of the room category is shown in the frontend of the booking system (and therefore what a guest books)

A room category has basic information, such as:

  • id
  • hotel
  • name
  • number of rooms (dynamic, based on rooms attached to room category)
  • balcony [true/false]
  • baththub [true/false]
  • shower [true/false]
  • view [park, inland, sea view, partial sea view, sea front]
  • number of adults per room
  • number of children per room
  • price per night

Rooms

A room is tied to a room category and a hotel. Rooms are identified by their room number. The room name (e.g. displayed in a booking frontend) derives from the room category, therefore an individual room has no name.

A room has basic information, such as:

  • id (primary key in database)
  • room number (individual to the hotel's numbering system)
  • hotel
  • room category
  • size
  • smoking allowed [true/false]
  • pets allowed [true/false]

Guests

Guests can have multiple reservations and have basic information, such as:

  • id
  • name
  • gender
  • preferred payment method
  • billing address
  • staff notes

Reservations

Reservations are connected to guests, room categories, and rooms. When a guest makes a reservation, only a room categroy is assigned. Hotel staff can later on assign an individual room. One reservation can have multiple room (categories).

Reservations have basic information, such as:

  • id
  • guest
  • hotel
  • room categories
  • rooms
  • arrival date
  • departure date
  • total price
  • number of adults
  • number of children
  • pets
  • notes

About

Generic Hotel API for a basic hotel booking system created with NestJS and SQLite.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published