Skip to content

Ferry[feat]: Handle changes to ferry fares for F10 and F2H#3190

Open
lvachon1 wants to merge 2 commits into
mainfrom
lev/feat/ferry/new_fares_may26
Open

Ferry[feat]: Handle changes to ferry fares for F10 and F2H#3190
lvachon1 wants to merge 2 commits into
mainfrom
lev/feat/ferry/new_fares_may26

Conversation

@lvachon1
Copy link
Copy Markdown
Contributor

@lvachon1 lvachon1 commented May 18, 2026

Scope

Asana Ticket: ⛴️ 💸 Handle changes to ferry fares for F10 and F2H

Implementation

  • Added calculate_ferry overrides for the Hinghum/Hull <-> Logan fare ($2.40)
  • Added override for the new loop ferry (Boat-F10) fare ($2.40)
  • Fixed a bug I noticed with the East Boston ferry where it was charging $9.75 for a journey that should be $2.40 (Long Wharf to Logan). I might want to make a better solution for that if it happens on other route combos.

Unable to test the Boat-F10 stuff yet locally, will do so on dev green.

Screenshots

Wrong fare on dev for E. Boston Ferry to Logan

Screenshot 2026-05-18 at 1 43 40 PM

Fixed on branch

Screenshot 2026-05-18 at 1 43 13 PM

$2.40 Fare for Hinghum/Hull to Logan

Screenshot 2026-05-18 at 1 43 01 PM

$2.40 Fare for Loop Ferry Trips

...Coming Soon

How to test

https://dev-green.mbtace.com/trip-planner?plan=h8QVX3VudXNlZF9kYXRldGltZV90eXBlxADEEl91bnVzZWRfd2hlZWxjaGFpcsQAxAhkYXRldGltZcQZMjAyNi0wNi0xMlQxNTo1MDowMC0wNDowMMQNZGF0ZXRpbWVfdHlwZcQIbGVhdmVfYXTEBGZyb22ExAhsYXRpdHVkZcQJNDIuMzY1NTc3xAlsb25naXR1ZGXECS03MS4wNjEyOcQEbmFtZcQNTm9ydGggU3RhdGlvbsQHc3RvcF9pZMQLcGxhY2Utbm9ydGjEBW1vZGVzhsQDQlVTxAVmYWxzZcQFRkVSUlnEBHRydWXEBFJBSUzEBWZhbHNlxAZTVUJXQVnEBWZhbHNlxA5fcGVyc2lzdGVudF9pZMQBMMQNX3VudXNlZF9GRVJSWcQAxAJ0b4TECGxhdGl0dWRlxAk0Mi4zNTk3ODnECWxvbmdpdHVkZcQJLTcxLjAyNzM0xARuYW1lxBxMb2dhbiBBaXJwb3J0IEZlcnJ5IFRlcm1pbmFsxAdzdG9wX2lkxApCb2F0LUxvZ2Fu

Look for Loop Ferry Fares
Look for East Boston Fares
Look for Hingham/Hull Fares

…$2.40), and the new loop ferry (Boat-F10) fare ($2.40) Also fixed a bug I noticed with the East Boston ferry where it was charging $9.75 for a journey that should be $2.40 (Long Wharf to Logan). I might want to make a better solution for that if it happens on other route combos. Unable to test the Boat-F10 stuff yet locally, will do so on dev green.
@lvachon1 lvachon1 requested a review from a team as a code owner May 18, 2026 17:38
@lvachon1 lvachon1 requested a review from joshlarson May 18, 2026 17:38
…e trips with same origin and destination to satisfy the test code. Updated test error to be a bit more specific
@joshlarson
Copy link
Copy Markdown
Contributor

Hmmmm, related to my comment, would this trip (first result) actually only cost $2.40, or would it cost $9.75 (or twice that?) because it does a full round-trip through Hingham, Hull, and back?

Screenshot 2026-05-21 at 5 39 36 PM

Copy link
Copy Markdown
Contributor

@joshlarson joshlarson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops - I left a comment that alluded to one of my detailed comments here, and I thought that would pull my other comments out of the Pending state. Alas... this comment should do that though!

Comment thread test/fares/fares_test.exs

assert Fares.fare_for_stops(:ferry, origin_id, destination_id) == {:ok, expected_name},
"Unexpected result for #{origin_id} to #{destination_id}"
"Unexpected result for #{origin_id} to #{destination_id}, expected #{expected_name}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this ✨

Comment thread lib/fares/fares.ex
:ferry_east_boston
end

def calculate_ferry(origin, destination)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion/Question (non-blocking): I'm somewhat new to this code, but would it simplify this if we made a list of inner harbor stops, something like:

@inner_harbor_stops [
  "Boat-Lewis",
  "Boat-Logan",
  "Boat-Long",
  # etc...
]

and then compared like

def calculate_ferry(origin, destination)
    when origin in @inner_harbor_stops
    and destination in @inner_harbor_stops do
  :ferry_east_boston
end

I'm not sure that would work quite as simply as I just said, because 👇 trip starts and ends in the inner harbor, but goes out to Quincy in between, which does justify the $6.50 cost.... but I do think there's gotta be an easier way than trying to list out all of the possible origin/destination pairs.

Image

Maybe if we checked the origin and destination and all intermediate stops? I dunno <-- and that's part of why this comment is non-blocking! 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants