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
- Run
composer install
to install the dependencies. - Run
bin/console server:run
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,
-
Run
./vendor/bin/phpunit tests/AppBundle/Controller/API/HotelControllerTest.php
-
Run
./vendor/bin/phpunit tests/AppBundle/Service//HotelServiceTest.php
- PHP7.1
- Symfony3
- jms/serializer - Library for (de-)serializing data of any complexity; supports XML, JSON