Skip to content
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

Upstream merge 2024-06-21 #216

Merged
merged 24 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
6ba74b9
Refactor NearbyStopsFinder to follow strategy pattern.
habrahamsson-skanetrafiken Jun 12, 2024
44c79dc
Fix too large response cancellation
vpaturet Jun 14, 2024
597ed90
Keep container image snapshots for 90 days [ci skip]
leonardehrenfried Jun 19, 2024
9be3805
Apply review suggestions
vpaturet Jun 19, 2024
d9706b6
chore(deps): update dependency org.apache.maven.plugins:maven-jar-plu…
renovate[bot] Jun 19, 2024
69191b5
Merge pull request #5908 from entur/fix_too_large_response_cancellation
vpaturet Jun 20, 2024
aa7cdd9
Add changelog entry for #5908 [ci skip]
Jun 20, 2024
960480d
Small update of documentation
habrahamsson-skanetrafiken Jun 20, 2024
2257f88
Merge pull request #5906 from Skanetrafiken/nearby-stop-finder-refactor
leonardehrenfried Jun 20, 2024
0ed11e7
Store search state in URL
leonardehrenfried Jun 20, 2024
6124015
fix(orca-fares): allow senior fares with cash
daniel-heppner-ibigroup Jun 20, 2024
28273d2
Create hook for managing trip query variables, including url state
testower Jun 20, 2024
0f74cb5
Make new debug client more appealing
leonardehrenfried Jun 19, 2024
263ea6a
Make edge layer visible at lower zoom levels
leonardehrenfried Jun 19, 2024
4581cd9
Finetune border details of leg details
leonardehrenfried Jun 19, 2024
74728f3
Merge commit '28273d2b0e95ab317a9e071ec3b9e16a873c0cd8' into debug-it…
leonardehrenfried Jun 20, 2024
adbaf96
Also use short time format for real time
leonardehrenfried Jun 20, 2024
1c001be
Also add hash to pushState
leonardehrenfried Jun 20, 2024
9e16294
Also add hash to pushState
leonardehrenfried Jun 20, 2024
e8ea4dd
Merge pull request #5918 from leonardehrenfried/debug-itinerary
leonardehrenfried Jun 20, 2024
3367ae7
Upgrade debug client to version 2024/06/2024-06-20T21:29
Jun 20, 2024
7ac4f0e
run formatter
daniel-heppner-ibigroup Jun 21, 2024
c934781
Merge pull request #5922 from ibi-group/allow-cash-senior
leonardehrenfried Jun 21, 2024
746b530
Merge remote-tracking branch 'upstream/dev-2.x' into upstream-merge-2…
leonardehrenfried Jun 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/prune-container-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
# remove all snapshot container images that have not been pulled for over a year
# --keep-semver makes sure that any image with a x.y.z version scheme is unaffected by this
pip install prune-container-repo==0.0.4
prune-container-repo -u ${CONTAINER_REGISTRY_USER} -r ${CONTAINER_REPO} --days=365 --keep-semver --activate
prune-container-repo -u ${CONTAINER_REGISTRY_USER} -r ${CONTAINER_REPO} --days=90 --keep-semver --activate
2 changes: 1 addition & 1 deletion client-next/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VITE_API_URL=/otp/routers/default/transmodel/index/graphql
VITE_API_URL=/otp/transmodel/v3
VITE_DEBUG_STYLE_URL=/otp/routers/default/inspector/vectortile/style.json
2 changes: 1 addition & 1 deletion client-next/.env.development
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VITE_API_URL=http://localhost:8080/otp/routers/default/transmodel/index/graphql
VITE_API_URL=http://localhost:8080/otp/transmodel/v3
VITE_DEBUG_STYLE_URL=http://localhost:8080/otp/routers/default/inspector/vectortile/style.json
35 changes: 21 additions & 14 deletions client-next/src/components/ItineraryList/ItineraryLegDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,27 @@ import { formatDuration } from '../../util/formatDuration.ts';

export function ItineraryLegDetails({ leg, isLast }: { leg: Leg; isLast: boolean }) {
return (
<div style={{ border: '1px dotted grey' }}>
<LegTime aimedTime={leg.aimedStartTime} expectedTime={leg.expectedStartTime} hasRealtime={leg.realtime} />-{' '}
<LegTime aimedTime={leg.aimedEndTime} expectedTime={leg.expectedEndTime} hasRealtime={leg.realtime} />{' '}
<b>{leg.mode}</b>{' '}
{leg.line && (
<>
<u>
{leg.line.publicCode} {leg.toEstimatedCall?.destinationDisplay?.frontText}
</u>
, {leg.authority?.name}
</>
)}{' '}
{formatDistance(leg.distance)}, {formatDuration(leg.duration)}
{leg.mode !== Mode.Foot && <u>from {leg.fromPlace.name}</u>} {!isLast && <u>to {leg.toPlace.name}</u>}
<div className="itinerary-leg-details">
<div className="times">
{formatDistance(leg.distance)}, {formatDuration(leg.duration)}
</div>
<div>
<LegTime aimedTime={leg.aimedStartTime} expectedTime={leg.expectedStartTime} hasRealtime={leg.realtime} /> -{' '}
<LegTime aimedTime={leg.aimedEndTime} expectedTime={leg.expectedEndTime} hasRealtime={leg.realtime} />
</div>
<div className="mode">
<b>{leg.mode}</b>{' '}
{leg.line && (
<>
<u>
{leg.line.publicCode} {leg.toEstimatedCall?.destinationDisplay?.frontText}
</u>
, {leg.authority?.name}
</>
)}{' '}
<div></div>
{leg.mode !== Mode.Foot && <u>{leg.fromPlace.name}</u>} {!isLast && <u>→ {leg.toPlace.name}</u>}
</div>
</div>
);
}
6 changes: 3 additions & 3 deletions client-next/src/components/ItineraryList/LegTime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ export function LegTime({
}) {
return aimedTime !== expectedTime ? (
<>
<span style={{ color: 'red' }}>{formatTime(expectedTime)}</span>
<span style={{ textDecoration: 'line-through' }}>{formatTime(aimedTime)}</span>
<span style={{ color: 'red' }}>{formatTime(expectedTime, 'short')}</span>
<span style={{ textDecoration: 'line-through' }}>{formatTime(aimedTime, 'short')}</span>
</>
) : (
<span>
{formatTime(expectedTime)}
{formatTime(expectedTime, 'short')}
{hasRealtime && <span> (on time)</span>}
</span>
);
Expand Down
3 changes: 3 additions & 0 deletions client-next/src/components/MapView/LayerControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ class LayerControl implements IControl {
.getLayersOrder()
.map((l) => map.getLayer(l))
.filter((s) => s?.type !== 'raster')
// the polylines of the routing result are put in map layers called jsx-1, jsx-2...
// we don't want them to show up in the debug layer selector
.filter((s) => !s?.id.startsWith('jsx'))
.reverse()
.forEach((layer) => {
if (layer) {
Expand Down
33 changes: 33 additions & 0 deletions client-next/src/hooks/useTripQueryVariables.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { useEffect, useState } from 'react';
import { TripQueryVariables } from '../gql/graphql.ts';

const DEFAULT_VARIABLES: TripQueryVariables = {
from: {},
to: {},
dateTime: new Date().toISOString(),
};

const getInitialVariables = () => {
const urlParams = new URLSearchParams(window.location.search);
const variablesJson = urlParams.get('variables');
return variablesJson ? JSON.parse(decodeURIComponent(variablesJson)) : DEFAULT_VARIABLES;
};

const updateUrlWithVariables = (variables: TripQueryVariables) => {
const urlParams = new URLSearchParams(window.location.search);
urlParams.set('variables', encodeURIComponent(JSON.stringify(variables)));
history.pushState({}, '', '?' + urlParams.toString() + window.location.hash);
};

export const useTripQueryVariables = () => {
const [tripQueryVariables, setTripQueryVariables] = useState<TripQueryVariables>(getInitialVariables());

useEffect(() => {
updateUrlWithVariables(tripQueryVariables);
}, [tripQueryVariables]);

return {
tripQueryVariables,
setTripQueryVariables,
};
};
10 changes: 2 additions & 8 deletions client-next/src/screens/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,12 @@ import { MapView } from '../components/MapView/MapView.tsx';
import { SearchBar } from '../components/SearchBar/SearchBar.tsx';
import { ItineraryListContainer } from '../components/ItineraryList/ItineraryListContainer.tsx';
import { useState } from 'react';
import { TripQueryVariables } from '../gql/graphql.ts';
import { useTripQuery } from '../hooks/useTripQuery.ts';
import { useServerInfo } from '../hooks/useServerInfo.ts';

const INITIAL_VARIABLES: TripQueryVariables = {
from: {},
to: {},
dateTime: new Date().toISOString(),
};
import { useTripQueryVariables } from '../hooks/useTripQueryVariables.ts';

export function App() {
const [tripQueryVariables, setTripQueryVariables] = useState<TripQueryVariables>(INITIAL_VARIABLES);
const { tripQueryVariables, setTripQueryVariables } = useTripQueryVariables();
const [tripQueryResult, loading, callback] = useTripQuery(tripQueryVariables);
const serverInfo = useServerInfo();
const [selectedTripPatternIndex, setSelectedTripPatternIndex] = useState<number>(0);
Expand Down
17 changes: 17 additions & 0 deletions client-next/src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,23 @@
--bs-accordion-active-bg: pink;
}

.itinerary-leg-details {
border: 1px solid #80808063;
padding: 10px;
border-radius: 3px;
margin-bottom: 3px;
}

.itinerary-leg-details .times {
margin-top: 3px;
float: right;
font-size: 11px;
}

.itinerary-leg-details .mode {
margin-top: 10px;
}

.itinerary-header-itinerary-number {
position: absolute;
}
Expand Down
28 changes: 14 additions & 14 deletions client-next/src/util/getColorForMode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ import { Mode } from '../gql/graphql.ts';

export const getColorForMode = function (mode: Mode) {
if (mode === Mode.Foot) return '#444';
if (mode === Mode.Bicycle) return '#44f';
if (mode === Mode.Scooter) return '#88f';
if (mode === Mode.Bicycle) return '#5076D9';
if (mode === Mode.Scooter) return '#253664';
if (mode === Mode.Car) return '#444';
if (mode === Mode.Rail) return '#b00';
if (mode === Mode.Coach) return '#0f0';
if (mode === Mode.Metro) return '#f00';
if (mode === Mode.Bus) return '#0f0';
if (mode === Mode.Tram) return '#f00';
if (mode === Mode.Trolleybus) return '#0f0';
if (mode === Mode.Water) return '#f0f';
if (mode === Mode.Air) return '#f0f';
if (mode === Mode.Cableway) return '#f0f';
if (mode === Mode.Funicular) return '#f0f';
if (mode === Mode.Monorail) return '#f0f';
if (mode === Mode.Taxi) return '#f0f';
if (mode === Mode.Rail) return '#86BF8B';
if (mode === Mode.Coach) return '#25642A';
if (mode === Mode.Metro) return '#D9B250';
if (mode === Mode.Bus) return '#25642A';
if (mode === Mode.Tram) return '#D9B250';
if (mode === Mode.Trolleybus) return '#25642A';
if (mode === Mode.Water) return '#81304C';
if (mode === Mode.Air) return '#81304C';
if (mode === Mode.Cableway) return '#81304C';
if (mode === Mode.Funicular) return '#81304C';
if (mode === Mode.Monorail) return '#81304C';
if (mode === Mode.Taxi) return '#81304C';
return '#aaa';
};
1 change: 1 addition & 0 deletions docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ based on merged pull requests. Search GitHub issues and pull requests for smalle
- Add plan query that follows the relay connection specification [#5185](https://github.com/opentripplanner/OpenTripPlanner/pull/5185)
- Fix debug client after breaking change in dependency graphql-request [#5899](https://github.com/opentripplanner/OpenTripPlanner/pull/5899)
- Remove TravelTime API [#5890](https://github.com/opentripplanner/OpenTripPlanner/pull/5890)
- Improve cancellation of large response in TransModel API [#5908](https://github.com/opentripplanner/OpenTripPlanner/pull/5908)
[](AUTOMATIC_CHANGELOG_PLACEHOLDER_DO_NOT_REMOVE)

## 2.5.0 (2024-03-13)
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.1</version>
<version>3.4.2</version>
<configuration>
<archive>
<manifestEntries>
Expand Down
4 changes: 2 additions & 2 deletions src/client/debug-client-preview/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<link rel="icon" type="image/svg+xml" href="/img/otp-logo.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>OTP Debug Client</title>
<script type="module" crossorigin src="https://cdn.jsdelivr.net/gh/opentripplanner/debug-client-assets@main/2024/06/2024-06-17T08:43/assets/index-DblAyaea.js"></script>
<link rel="stylesheet" crossorigin href="https://cdn.jsdelivr.net/gh/opentripplanner/debug-client-assets@main/2024/06/2024-06-17T08:43/assets/index-DP6CFc2j.css">
<script type="module" crossorigin src="https://cdn.jsdelivr.net/gh/opentripplanner/debug-client-assets@main/2024/06/2024-06-20T21:29/assets/index-c3s7HdOc.js"></script>
<link rel="stylesheet" crossorigin href="https://cdn.jsdelivr.net/gh/opentripplanner/debug-client-assets@main/2024/06/2024-06-20T21:29/assets/index-DAapFGZ4.css">
</head>
<body>
<div id="root"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ private static void assertLegFareEquals(
void calculateFareForSingleAgency() {
List<Leg> rides = List.of(getLeg(COMM_TRANS_AGENCY_ID, "400", 0));
calculateFare(rides, regular, DEFAULT_TEST_RIDE_PRICE);
calculateFare(rides, FareType.senior, DEFAULT_TEST_RIDE_PRICE);
calculateFare(rides, FareType.senior, TWO_DOLLARS);
calculateFare(rides, FareType.youth, ZERO_USD);
calculateFare(rides, FareType.electronicSpecial, TWO_DOLLARS);
calculateFare(rides, FareType.electronicRegular, DEFAULT_TEST_RIDE_PRICE);
Expand All @@ -154,18 +154,14 @@ void calculateFareWithNoFreeTransfer() {
getLeg(COMM_TRANS_AGENCY_ID, 2)
);
calculateFare(rides, regular, DEFAULT_TEST_RIDE_PRICE.times(3));
calculateFare(rides, FareType.senior, DEFAULT_TEST_RIDE_PRICE.times(3));
calculateFare(rides, FareType.senior, DEFAULT_TEST_RIDE_PRICE.plus(usDollars(2.25f)));
calculateFare(rides, FareType.youth, Money.ZERO_USD);
calculateFare(
rides,
FareType.electronicSpecial,
DEFAULT_TEST_RIDE_PRICE.plus(usDollars(1.25f))
);
calculateFare(
rides,
FareType.electronicRegular,
DEFAULT_TEST_RIDE_PRICE.plus(DEFAULT_TEST_RIDE_PRICE)
);
calculateFare(rides, FareType.electronicRegular, DEFAULT_TEST_RIDE_PRICE.times(2));
calculateFare(rides, FareType.electronicSenior, DEFAULT_TEST_RIDE_PRICE.plus(usDollars(1.25f)));
calculateFare(rides, FareType.electronicYouth, Money.ZERO_USD);
}
Expand Down Expand Up @@ -200,7 +196,7 @@ void calculateFareThatExceedsTwoHourFreeTransferWindow() {
);

calculateFare(rides, regular, DEFAULT_TEST_RIDE_PRICE.times(2));
calculateFare(rides, FareType.senior, DEFAULT_TEST_RIDE_PRICE.times(2));
calculateFare(rides, FareType.senior, TWO_DOLLARS);
calculateFare(rides, FareType.youth, ZERO_USD);
calculateFare(rides, FareType.electronicSpecial, TWO_DOLLARS);
calculateFare(rides, FareType.electronicRegular, DEFAULT_TEST_RIDE_PRICE.times(2));
Expand All @@ -227,7 +223,7 @@ void calculateFareThatIncludesNoFreeTransfers() {
calculateFare(
rides,
FareType.senior,
DEFAULT_TEST_RIDE_PRICE.times(2).plus(usDollars(.50f)).plus(HALF_FERRY_FARE)
ONE_DOLLAR.plus(ONE_DOLLAR).plus(HALF_FERRY_FARE).plus(usDollars(0.5f))
);
calculateFare(rides, FareType.youth, Money.ZERO_USD);
// We don't get any fares for the skagit transit leg below here because they don't accept ORCA (electronic)
Expand Down Expand Up @@ -263,7 +259,7 @@ void calculateFareThatExceedsTwoHourFreeTransferWindowTwice() {
getLeg(KITSAP_TRANSIT_AGENCY_ID, 270)
);
calculateFare(rides, regular, DEFAULT_TEST_RIDE_PRICE.times(3));
calculateFare(rides, FareType.senior, DEFAULT_TEST_RIDE_PRICE.times(3));
calculateFare(rides, FareType.senior, usDollars(3));
calculateFare(rides, FareType.youth, Money.ZERO_USD);
calculateFare(rides, FareType.electronicSpecial, usDollars(3));
calculateFare(rides, FareType.electronicRegular, DEFAULT_TEST_RIDE_PRICE.times(3));
Expand All @@ -286,7 +282,7 @@ void calculateFareThatStartsWithACashFare() {
getLeg(KITSAP_TRANSIT_AGENCY_ID, 149)
);
calculateFare(rides, regular, DEFAULT_TEST_RIDE_PRICE.times(2));
calculateFare(rides, FareType.senior, DEFAULT_TEST_RIDE_PRICE.times(2));
calculateFare(rides, FareType.senior, DEFAULT_TEST_RIDE_PRICE.plus(ONE_DOLLAR));
calculateFare(rides, FareType.youth, Money.ZERO_USD);
calculateFare(rides, FareType.electronicSpecial, DEFAULT_TEST_RIDE_PRICE.plus(ONE_DOLLAR));
calculateFare(
Expand All @@ -305,7 +301,7 @@ void calculateFareThatStartsWithACashFare() {
void calculateFareForKitsapFastFerry() {
List<Leg> rides = List.of(getLeg(KITSAP_TRANSIT_AGENCY_ID, 0, 4, "404", "east"));
calculateFare(rides, regular, TWO_DOLLARS);
calculateFare(rides, FareType.senior, TWO_DOLLARS);
calculateFare(rides, FareType.senior, ONE_DOLLAR);
calculateFare(rides, FareType.youth, Money.ZERO_USD);
calculateFare(rides, FareType.electronicSpecial, ONE_DOLLAR);
calculateFare(rides, FareType.electronicRegular, TWO_DOLLARS);
Expand All @@ -314,7 +310,7 @@ void calculateFareForKitsapFastFerry() {

rides = List.of(getLeg(KITSAP_TRANSIT_AGENCY_ID, 0, 4, "404", "west"));
calculateFare(rides, regular, usDollars(10f));
calculateFare(rides, FareType.senior, usDollars(10f));
calculateFare(rides, FareType.senior, usDollars(5f));
calculateFare(rides, FareType.youth, Money.ZERO_USD);
calculateFare(rides, FareType.electronicSpecial, usDollars(5f));
calculateFare(rides, FareType.electronicRegular, usDollars(10f));
Expand Down Expand Up @@ -349,7 +345,7 @@ void calculateFareForSTRail() {
getLeg(SOUND_TRANSIT_AGENCY_ID, "S Line", 100, "King Street Station", "Auburn Station")
);
calculateFare(rides, regular, DEFAULT_TEST_RIDE_PRICE.times(2));
calculateFare(rides, FareType.senior, DEFAULT_TEST_RIDE_PRICE.times(2));
calculateFare(rides, FareType.senior, TWO_DOLLARS);
calculateFare(rides, FareType.youth, Money.ZERO_USD);
calculateFare(rides, FareType.electronicSpecial, ORCA_SPECIAL_FARE);
calculateFare(rides, FareType.electronicRegular, DEFAULT_TEST_RIDE_PRICE);
Expand All @@ -364,7 +360,7 @@ void calculateFareForSTRail() {
void calculateWaterTaxiFares() {
List<Leg> rides = List.of(getLeg(KC_METRO_AGENCY_ID, "973", 1));
calculateFare(rides, regular, WEST_SEATTLE_WATER_TAXI_CASH_FARE);
calculateFare(rides, FareType.senior, WEST_SEATTLE_WATER_TAXI_CASH_FARE);
calculateFare(rides, FareType.senior, usDollars(2.50f));
calculateFare(rides, FareType.youth, Money.ZERO_USD);
calculateFare(rides, FareType.electronicSpecial, usDollars(3.75f));
calculateFare(rides, FareType.electronicRegular, usDollars(5f));
Expand All @@ -374,7 +370,7 @@ void calculateWaterTaxiFares() {
rides = List.of(getLeg(KC_METRO_AGENCY_ID, "975", 1));

calculateFare(rides, regular, VASHON_WATER_TAXI_CASH_FARE);
calculateFare(rides, FareType.senior, VASHON_WATER_TAXI_CASH_FARE);
calculateFare(rides, FareType.senior, usDollars(3f));
calculateFare(rides, FareType.youth, Money.ZERO_USD);
calculateFare(rides, FareType.electronicSpecial, usDollars(4.50f));
calculateFare(rides, FareType.electronicRegular, usDollars(5.75f));
Expand All @@ -395,8 +391,7 @@ void calculateSoundTransitBusFares() {
getLeg(KC_METRO_AGENCY_ID, "550", 240)
);
calculateFare(rides, regular, usDollars(9.75f));
// Sound Transit does not accept senior fares in cash
calculateFare(rides, FareType.senior, usDollars(9.75f));
calculateFare(rides, FareType.senior, usDollars(3.00f));
calculateFare(rides, FareType.youth, Money.ZERO_USD);
calculateFare(rides, FareType.electronicSpecial, usDollars(3f));
calculateFare(rides, FareType.electronicRegular, usDollars(9.75f));
Expand All @@ -410,7 +405,7 @@ void calculateSoundTransitBusFares() {
getLeg(PIERCE_COUNTY_TRANSIT_AGENCY_ID, "501", 60)
);
calculateFare(rides, regular, DEFAULT_TEST_RIDE_PRICE.times(2));
calculateFare(rides, FareType.senior, DEFAULT_TEST_RIDE_PRICE.times(2));
calculateFare(rides, FareType.senior, TWO_DOLLARS);
calculateFare(rides, FareType.youth, Money.ZERO_USD);
calculateFare(rides, FareType.electronicSpecial, usDollars(1f));
calculateFare(rides, FareType.electronicRegular, DEFAULT_TEST_RIDE_PRICE);
Expand All @@ -430,7 +425,7 @@ void calculateCashFreeTransferKCMetroAndKitsap() {
getLeg(KITSAP_TRANSIT_AGENCY_ID, 132)
);
calculateFare(rides, regular, DEFAULT_TEST_RIDE_PRICE.times(4));
calculateFare(rides, FareType.senior, DEFAULT_TEST_RIDE_PRICE.times(4));
calculateFare(rides, FareType.senior, usDollars(4.25f));
calculateFare(rides, FareType.youth, Money.ZERO_USD);
calculateFare(rides, FareType.electronicSpecial, usDollars(1.25f));
calculateFare(rides, FareType.electronicRegular, DEFAULT_TEST_RIDE_PRICE.times(2));
Expand All @@ -442,12 +437,12 @@ void calculateCashFreeTransferKCMetroAndKitsap() {
void calculateTransferExtension() {
List<Leg> rides = List.of(
getLeg(KITSAP_TRANSIT_AGENCY_ID, 0, 4, "Kitsap Fast Ferry", "east"), // 2.00
getLeg(KC_METRO_AGENCY_ID, 100), // Default ride price, extends transfer
getLeg(KC_METRO_AGENCY_ID, 100), // Default ride price, extends transfer for regular fare
getLeg(KITSAP_TRANSIT_AGENCY_ID, 150, 4, "Kitsap Fast Ferry", "west") // 10.00
);
var regularFare = usDollars(2.00f).plus(DEFAULT_TEST_RIDE_PRICE).plus(usDollars(10f));
calculateFare(rides, regular, regularFare);
calculateFare(rides, FareType.senior, regularFare);
calculateFare(rides, FareType.senior, usDollars(7f));
calculateFare(rides, FareType.youth, Money.ZERO_USD);
calculateFare(rides, FareType.electronicSpecial, usDollars(6f));
calculateFare(rides, FareType.electronicRegular, usDollars(10f)); // transfer extended on second leg
Expand Down
Loading
Loading