-
customer
id
(INT, PK)name
(VARCHAR)phone
(VARCHAR)email
(VARCHAR)
-
hotel
id
(INT, PK)name
(VARCHAR)location
(VARCHAR)status
(ENUM)contact_number
(VARCHAR)
-
rooms
id
(INT, PK)room_type
(ENUM)status
(ENUM)max_occupancy
(INT)
-
pricing_inventory
id
(INT, PK)hotel_id
(FK)room_id
(FK)date
(DATE)price
(DECIMAL)hotel_room_availability
(INT)
-
hotel_room_mapping
id
(INT, PK)hotel_id
(FK)room_id
(FK)inventory
(INT)
-
booking
id
(INT, PK)customer_id
(FK)booking_amount
(DECIMAL)checkin_date
(DATE)checkout_date
(DATE)hotel_id
(FK)room_id
(FK)occupancy
(INT)
- Utilized to extend common functionalities among entities.
- Service layer hides complex logic from controllers.
- Method overloading and interface implementations are used throughout services.
@RestController
- Define REST API controllers.@Service
- Mark classes for business logic.@Repository
- For data access objects (DAOs).@Entity
- Map classes to database tables.@Configuration
- Configuration classes for third-party APIs.@RequestMapping
,@GetMapping
,@PostMapping
- API route mappings.@Autowired
- Dependency injection.@Transactional
- Manage transactions.
- Java 17+
- Maven
- MySQL database setup
- Clone the repository:
git clone https://github.com/your-repo/hotel-management-app.git
- Navigate to the project directory:
cd hotel-management-app
- Build the project:
mvn clean install
- Run the application:
mvn spring-boot:run
- Access the application at:
http://localhost:8080
Method | Endpoint | Description |
---|---|---|
GET | /api/v1/customers |
Get all customers |
POST | /api/v1/customers |
Create a new customer |
GET | /api/v1/hotels |
Get all hotels |
POST | /api/v1/hotels |
Add a new hotel |
GET | /api/v1/rooms |
Get available rooms |
POST | /api/v1/bookings |
Create a new booking |
GET | /api/v1/bookings/{id} |
Get booking details by ID |
This project is licensed under the MIT License. See the LICENSE
file for more details.
For any queries, please reach out to Shubh Agrawal at your-email@example.com.