Giter VIP home page Giter VIP logo

hotel-api's Introduction

HotelAPI

This document provides a comprehensive guide to the tasks and models required for a hotel reservation system. The system encompasses functionalities for user management, room management, and reservation management, ensuring a smooth and efficient process for both administrators and users.

ERD:

ERD

Hotel Reservation System Tasks

User Model

  1. User Registration:
  • A user can create a new account in the system.
  • A username, password, and email address are required.
  • The password must be at least 8 characters long and contain uppercase/lowercase letters, numbers, and special characters.
  • The email address must be in a valid format.
  • When a user is registered, the password should be encrypted and stored in the database.
{
  "task": "User Registration",
  "data": {
    "username": "john_doe",
    "password": "Password123!",
    "email": "[email protected]"
  }
}
  1. User Login:
  • A registered user can log in with their username/email and password.
  • The password should be verified upon login.
{
  "task": "User Login",
  "data": {
    "username": "john_doe",
    "password": "Password123!"
  }
}

or

{
  "task": "User Login",
  "data": {
    "email": "[email protected]",
    "password": "Password123!"
  }
}
  1. Update User Information:
  • A user can update their own information (email address or password).
  • The new password must comply with the specified rules.
  • The email address must be in a valid format.
{
  "task": "Update User Information",
  "data": {
    "userId": "60b6a9f1e1d1b24bfc13e0a8",
    "email": "[email protected]",
    "password": "NewPassword123!"
  }
}

Room Model

  1. Create Room:
  • A user with admin privileges can add a new room to the system.
  • A room number, bed type, and price are required.
  • The room number must be unique.
{
  "task": "Create Room",
  "data": {
    "roomNumber": 101,
    "image": "room101.jpg",
    "bedType": "Large Bed",
    "price": "150"
  }
}
  1. Update Room Information:
  • A user with admin privileges can update the information of an existing room (price, bed type, etc.). Note: The room ID is required.
{
  "task": "Update Room Information",
  "data": {
    "roomId": "60b6a9f1e1d1b24bfc13e0a9",
    "bedType": "Medium Bed",
    "price": "120"
  }
}

Reservation Model

  1. Create Reservation:
  • A user can make a reservation for a room for specific dates.
  • User ID, room ID, arrival and departure dates, guest number, and number of nights are required.
  • The total price should be calculated by multiplying the number of nights by the room price.
{
  "task": "Create Reservation",
  "data": {
    "userId": "60b6a9f1e1d1b24bfc13e0a8",
    "roomId": "60b6a9f1e1d1b24bfc13e0a9",
    "arrivalDate": "2024-07-10",
    "departureDate": "2024-07-15",
    "guestNumber": 2,
    "night": 5,
    "price": 150
  }
}
  1. Cancel Reservation:
  • A user can cancel a specific reservation. Note: The reservation ID is required.
{
  "task": "Cancel Reservation",
  "data": {
    "reservationId": "60b6a9f1e1d1b24bfc13e0aa"
  }
}

Additional Tasks

  1. List Users:
  • A user with admin privileges can list all users in the system.
{
  "task": "List Users"
}
  1. List Reservations:
  • A user with admin privileges can list all reservations.
{
  "task": "List Reservations"
}

Documentations

View Postman Documentation View Swagger Documentation View Redoc Documentation View Json Documentation

hotel-api's People

Contributors

omrfrkcpr 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.