Skip to content

HaithamKhedrSalem/Hotel-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hotel API (Nodejs 9.1)

Setup

  • Pull the repo and cd to the directory.
  • Run sudo docker build -t tajawal .
  • Run sudo docker run --name tajawal -p 8080:8080 tajawal

Architecture

  • HotelAPIController is responsible for fetch all hotels.
  • Parsing is responsible for parsing price and date range to valid data. PriceRangeParse and DateRangeParse extend Parsing and implement parse method to parse the price range and date range.
  • Validation is responsible for validating all the url parameters. PriceRangeValidation, DateRangeValidation and SortValidation extend Validation and implement the validate method which validate the price and date ranges and the sort parameters.
  • Filter is responsible for filtering the hotels list according to the passed parameters in the query url. It is an implementation of the Chain of Responsiblity design pattern.
  • Sort is responsible for sorting the hotels list according to the the sort parameters in the query url. It is an implementation of strategy design pattern wherer HotelNameSort and HotelPriceSort are the two strategies.
  • HotelProbertySortFactory is responsible for creating one of the two sort strategies depending on the sort parameters.

API documenation

UnitTest - (Open New Terminal)

  • Run sudo docker exec tajawal jest to run all the unittests.
  • Run sudo docker exec tajawal jest --coverage to get the unittest coverage.

CodeClimate:

Maintainability

Travis

Build Status

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published