You are going to create a simple service that allows finding the best cat with the best price for customer location.
There are cat shops that have pricelists accessible via REST API. What your service will do is just get prices from each shop, compare them and suggest the best deal for a customer!
We created 2 fake test shops for you.
- "Cats Unlimited" API (JSON response) - https://nh7b1g9g23.execute-api.us-west-2.amazonaws.com/dev/cats/json
- "Happy Cats" API (XML response) - https://nh7b1g9g23.execute-api.us-west-2.amazonaws.com/dev/cats/xml
As of now, service only supports "Cats Unlimited" integration. On top of that, existing code was written by Trainee Ruby developer and could use some refactoring.
- Implement "XML" integration, and improve business logic to find the best deal amongst two shops.
- Make service an API-only. Let's remove FE implementation.
- Refactor or rewrite the existing code. We wanna see a clean design, readable code, good test coverage.
- Right now our product supports only two cat shops. However, that can change in a future.
- As you know, 3rd-party integrations often behave unpredictably. Let's make sure that our product can handle errors from these services.