This is the submission for the Arise backend challenge.
Filter by hotel id, country
I read the challenge instructions and discovered the Arise API.
I decided to install a graphQL client to abstract the requests. I went with apollo-client. It might not the best choice because it's designed to work first with React. We should probaly use a lighter client or create our own wrapper.
I created a dummy request to test the client integration and get the full data pipeline working.
I updated the code to take real parameters into account.
I then added the booking request, by testing it first with Altair before adding the route and the handler.
I had to update openapi definition to add check-in and check-out dates. Use ids as partner ref hotel and room.
I added custom middlewares to check inputs with Joi library.
I downloaded the SDL from Altair and converted it to TypeScript with an online tool. I then integrated the created types into the app and added the types to the variables.
- Non existant hotel or room id
- Non matching price
- Network error