Closed karafra closed 2 months ago
Good day, and thank you for your feedback.
To start with, this service is part of a larger project. The main goal of this container is to reduce API calls independently from the logical core, Find Route service. It doesn't make much sense to be used stand-alone.
It is indeed a wrapper for the Ryanair API with a cacher. However, I have high hopes for other carriers to add an 'Any destination' feature to their public API so the service would consider several carriers and manage data standardization for other services.
Regarding 'cheapest flights,' it is an issue with naming. The bigger idea of the whole project is to find a cheap way around Europe, but this service returns all possible flights for the given parameters without additional filtering by price, which is done outside this service. This misleading naming originated from earlier stages of modeling the project and is to be changed as soon as possible.
Once again, thank you for pointing out the mistakes I left behind. The project is currently closer to its beginning than its release, so I would be glad to see your suggestions along the way.
Bug description
Right now calculation metric for cheapest flight assumes that the cheapest flight is the one returned by API, thus current code simply acts as a wrapper around Ryanair REST API. This assumption is not correct as basic market logic states that the products on which customer has to spent least amount of effort to consume are the most valued.
In the sense of flights this means that flights with connections on local airports will most of the time be cheaper than direct flights. This problem is directly proportional to the distance traveled.
Resolution proposal
rename current endpoint and adjust documentation to mention that this service produces cheapest direct flight. In my opinion this is not correct solution as this is only part of functionality end user wants, thus limiting usage of the application only to people wanting to find direct flights
implement BFS or DFS or any other tree traversal algorithm evaluate final price of traveling from once airport to another with connecting flights. This solution has benefit of being more resilient as it will deduplicate code and it will also give correct, brother, functionality to end user.