Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/hex/req-0.5.8
Browse files Browse the repository at this point in the history
  • Loading branch information
KaylaBrady authored Dec 9, 2024
2 parents f295c77 + 0cbc79c commit e4b594b
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion lib/mbta_v3_api/store/alerts.ex
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,28 @@ defmodule MBTAV3API.Store.Alerts.Impl do
}
end

# Conver the struct to a record for ETS
# override alert 611483 behavior to temporarily address GL Park St alert boundary issue
defp to_record(
%Alert{
id: "611483"
} = alert
) do
entities =
alert.informed_entity
|> Enum.reject(fn entity ->
(entity.stop == "70196" && entity.route != "Green-B") ||
(entity.stop == "70197" && entity.route != "Green-C") ||
(entity.stop == "70198" && entity.route != "Green-D") ||
(entity.stop == "70199" && entity.route != "Green-E")
end)

{
"611483",
%{alert | informed_entity: entities}
}
end

# Convert the struct to a record for ETS
defp to_record(
%Alert{
id: id
Expand Down

0 comments on commit e4b594b

Please sign in to comment.