The Hotel Manager App is a web application which allows hotel managers to manage bookings and users to book those rooms.
- Spring Boot
- Spring Data JPA
- Spring Web
- Postgresql
- Clone the repository:
git clone https://github.com/PiravenNan/HotelManager - Navigate to the project directory
cd HotelManager- Ensure you have Java, Maven and PostgreSQL installed and running. Create the database:
createdb hotelBooking- Build the project
mvn clean install- Start the application
mvn spring-boot:run- Access the application at https://localhost:8080
-
Add New User:
- Method:
Post - URL:
/users/addUser - Request Body:
{ "username" : "String", "password" : "String", "name" : "String" }
- Method:
-
Update User Info:
- Method:
Patch - URL:
/users/updateUser/{userId} - Request Body:
{ "password" : "String (optional)", "name" : "String (optional)" }
- Method:
-
Book User to Room:
- Method:
POST - URL:
/users/booking/{userId}/{roomId}
- Method:
-
Remove User from Room:
- Method:
DELETE - URL:
/users/booking/{userId}/{roomId}
- Method:
-
Get User by ID:
- Method:
GET - URL:
/users/user/{userId}
- Method:
-
Get Manager by Id:
- Method:
GET - URL:
/managers/{managerId}
- Method:
-
Add New Manager:
- Method:
Post - URL:
/managers/addManager - Request Body:
{ "username" : "String", "password" : "String", "name" : "String" }
- Method:
-
Update Manager Info:
- Method:
Patch - URL:
/managers/updateManager/{managerId} - Request Body:
{ "password" : "String (optional)", "name" : "String (optional)" }
- Method:
-
Add New Building:
- Method:
Post - URL:
/managers/addNewBuilding/1 - Request Body:
{ "numberOfFloors" : "int", "roomsPerFloor" : "int", "capacityPerRoom" : "int", "dayRate" : "int" }
- Method:
-
Get All Buildings by Manager's Id:
- Method:
GET - URL:
/allBuildings/{managerId}
- Method:
-
Get Building by Id:
- Method:
GET - URL:
/buildings/{buildingId}
- Method:
-
Get Room by Id:
- Method:
GET - URL:
/rooms/{roomId}
- Method:
-
Get Room by Building and RoomNumber:
- Method:
GET - URL:
/rooms/getRoomByDoorNumber/{buildingID}/{doorNumber}
- Method:
-
Update Room Properties:
- Method:
Patch - URL:
/rooms/updateRoom/{roomId} - Request Body:
{ "Capacity" : "int (optional)", "DayRate" : "int (optional)" }
- Method: