Skip to content

SalmaGhareeb/TJHotelsAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TajawalHotels

A REST API application to allow search in hotels inventory by any of the following:

  • Hotel Name
  • Destination [City]
  • Price range [ex: $100:$200]
  • Date range [ex: 10-10-2020:15-10-2020]

and allow sorting by:

  • Hotel Name
  • Price

Installing

  • Run composer install to install the dependencies.
  • Run bin/console server:run

Brief

  • Hotel an object contains (name,city,price,availability)
  • HotelDataMapper for de-serializing the Json data to an object(ArrayCollection) of hotels.
  • HotelService is a service which is responsible of filtering/matching the search query (name, price range, availabilities) and sorting by name/price,

API Sandbox

ScreenShot

Running the tests

  • Run ./vendor/bin/phpunit tests/AppBundle/Controller/API/HotelControllerTest.php

  • Run ./vendor/bin/phpunit tests/AppBundle/Service//HotelServiceTest.php

Built With