Coder Social home page Coder Social logo

tajawal-task's Introduction

Build Status

Description

This repository is created to fetch hotels data from Tajawal api and apply search and sorting on this data .

Requirements

  • npm
  • node > 9

Installation

npm install && npm start

Notes

  • filter criterias are name ,price,city,date(availability)
  • price and date criteria accept range format, for example : 120:150 and 10-10-2020:15-10-2020

Usage

  • To fetch all hotels use /hotels endpoint
  • To filter hotels with a criteria add query paramater after /hotels endpoint /hotels?name=Concorde Hotel
  • To sort hotels add add query paramater sort_by after /hotels
  • To search and sort http://localhost:3000/hotels?price=50:200&sort_by=price

Full example

  • Get hotel details by name http://localhost:3000/hotels?name=Concorde%20Hotel
  • Get hotel details by price and city http://localhost:3000/hotels?price=102.2&city=dubai
  • Sort hotels by price http://localhost:3009/hotels?sort_by=name

Assumptions

  • If you searched a hotel by name (ex :Dubai) , the word Dubai will be converted to lowercase letters dubai (better user experience)
  • For price range , the first value shouldn't be greater than the second value .

Testing

npm test

Todo

  • Adding better error handling
  • Validation
  • Date Range search (availability)
  • Adding Docker image for easier installation
  • Adding test coverage to codeclimate

tajawal-task's People

Contributors

abdelrahmanahmed avatar

Stargazers

Roman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.