Support for round-trip flights
waffle267 opened this issue · 4 comments
This service has been working well for me recently, thank you again! I found one issue however - it looks like the current logic will always select the earliest leg of a reservation. For a round-trip flight, this can be problematic, since we need to schedule the check-in for the return flight, but the earliest leg of the reservation is the outbound flight.
Would it be reasonable to limit validLegs
in findFirstLegDate
to flight legs that are in the future?
I may open a PR to add support for this.
It seems like instead of returning the first validLeg, we should return the entire array of valid legs and schedule them all upfront. Do you see any issues with this approach? You'd only need to schedule your check in for a reservation once, and all your flights under that reservation should be covered.
A PR would be welcomed and appreciated. Otherwise, I'll write the PR myself. It's a great idea.
I agree with the approach of scheduling all future legs up front. findFirstLegDate
should be re-written (and re-named) to return all legs whose departure times are >= 5 minutes in the future.
Working on this now! Should have an initial PR out in a few hours.
Resolved by #6. Thanks @aaron-pham!