headrun / SWIFT

2 stars 0 forks source link

Global - Route level flight & layover times are wrong #29

Closed malla794 closed 4 years ago

malla794 commented 4 years ago

Example Route to demonstrate the issue -

{
            "distance": null,
            "num_stops": 1,
            "connections": [
                {
                    "airlines": "VS",
                    "departures": {
                        "when": "2020-09-15T22:45",
                        "airport": "LAX"
                    },
                    "arrivals": {
                        "when": "2020-09-16T07:10",
                        "airport": "JFK"
                    },
                    "distance": null,
                    "flight": [
                        "DL1908"
                    ],
                    "aircraft": {
                        "model": "767-300",
                        "manufacturer": "Boeing"
                    },
                    "redemptions": null,
                    "payments": null,
                    "tickets": null,
                    "times": {
                        "flight": "5:25",
                        "layover": "1:5"
                    },
                    "cabin": "Main Cabin",
                    "fare_class": "N"
                },
                {
                    "airlines": "VS",
                    "departures": {
                        "when": "2020-09-16T08:15",
                        "airport": "JFK"
                    },
                    "arrivals": {
                        "when": "2020-09-16T20:10",
                        "airport": "LHR"
                    },
                    "distance": null,
                    "flight": [
                        "VS26"
                    ],
                    "aircraft": {
                        "model": "A350-1000",
                        "manufacturer": "Airbus"
                    },
                    "redemptions": null,
                    "payments": null,
                    "tickets": null,
                    "times": {
                        "flight": "6:55",
                        "layover": null
                    },
                    "cabin": "Economy",
                    "fare_class": "A"
                }
            ],
            "times": {
                "flight": "6:55",
                "layover": null
            },
            "site_key": "A",
            "award_type": "Main Cabin,Economy Classic",
            "redemptions": [
                {
                    "miles": 22500,
                    "program": "Virgin Atlantic"
                }
            ],
            "payments": [
                {
                    "currency": "USD",
                    "taxes": "149.50",
                    "fees": null
                }
            ]
        }

In the above route, connection 1's flight time is 5:25 and connection 2's flight time is 6:55, so at the ROUTE level it should have returned the flight time as 12:20 (5:25+6:55). But its returning wrong. Also, layover should have been 1:5 at the route level.

Preethi266 commented 4 years ago

@nigitha1995 Total flight time is the sum of the connection one flight time and connection two flight time it should return in the routes level and populated the layover time in the routes level.

nigitha1995 commented 4 years ago

@Preethi266 , data is fine for flight time.Checked that layover time was added in routes level.