Skip to content

MartinMartinni/RoomOccupancyManager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solution Room Occupancy Manager

Description:

Application is written by using SOLID principles, DDD and also clean architecture (ports and adapters) where domain is completely separated from framework. I also used design patterns like factory and strategy for clean code purposes. There also tests to check appropriate code working: interfaces layer, domain layer and unit.

Workflow:

  1. Guests are saved in database
  2. Client sends request to the server on endpoint POST "room-occupancy" with body: freeEconomyRooms, freePremiumRooms
  3. Server calculates rooms occupancy for guests represented by prices combination with "room-occupancy" body
  4. Server responds with calculated values: economyUsage, economyTotalPrice, premiumUsage, premiumTotalPrice

Environment variables:

In application.yaml:

  • "bound-price" is responsible for bound price where economy rooms are finish and premium start.
  • "initialize-guests" is responsible for initialization guests You can adjust them according to your needs.

Error handling:

In the app only MethodArgumentNotValidException is handled because client shouldn't know about any other:

Requirements:

  • java 17

Run build:

mvn clean install

Run app:

mvn spring-boot:run

Run tests:

mvn test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages