xbiletskyi / FlightService

GNU Affero General Public License v3.0
1 stars 1 forks source link

[BUG] Calculation metric for cheapest flights is wrong #1

Closed karafra closed 2 months ago

karafra commented 2 months ago

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

xbiletskyi commented 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.