-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Flight api skeleton #85
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a reasonable interface to me, but maybe we could combine these methods into one flight search method, where you can optionally specify
- Airline
- Airport
- Flight number
- Date
and it would give you a list of matching flights that we could show to the user and let them pick.
app/services/flights/service.rb
Outdated
# Caller note: there do not appear to be guarantees that there will only be one | ||
# flight for a given flight number, so we should be prepared to handle the case | ||
# where we get multiple back |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multiple results is fine. I would imagine entering a date and flight number as more of a search operation, and then we let the user pick out their flight from a list (possibly with length 1 for an exact match or 0 for not found)
app/services/flights/service.rb
Outdated
# Possible results: ApiError, [Flight] | ||
# | ||
# Uses same api endpoint as find_flight_by_number | ||
def find_flight_by_airport |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the parameters here? Airport + airline + date?
app/services/flights/service.rb
Outdated
# and hopefully a flightaware faFlightID we can use to keep track of the flight | ||
# in the future | ||
# | ||
# Possible results: ApiError, FlightNotFound, NonEmpty [Flight] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are "FlightNotFound, NonEmpty [Flight]" separate options? "FlightNotFound" is just the bottom case of a list.
@AlexanderOtavka the environment variables in heroku will need to be updated for this to work |
Just added the environment variables to this review app. This is just a reminder for myself: DON'T FORGET TO ADD THE KEYS TO THE WHOLE PIPELINE |
Provides a start on #27 (and to some extent #28). I'm mostly looking for feedback here on potential additional information that would be needed for an MVP, or if there is preference for a different interface in the code.