Package boarding station updates

This commit is contained in:
Stephanos A
2026-07-06 08:53:56 +03:00
parent 76bf81eec3
commit 19308e3969
2 changed files with 25 additions and 6 deletions

View File

@@ -40,7 +40,7 @@ interface TrainInfo {
operatorName: string;
}
interface StopTime {
interface RouteStop {
sequence: number;
station: Station;
}
@@ -55,7 +55,7 @@ interface Schedule {
originStation: Station;
destinationStation: Station;
train: TrainInfo;
stopTimes?: StopTime[];
routeStops?: RouteStop[];
}
interface PriceTier {
@@ -438,9 +438,9 @@ export default function PackageDetailPage() {
enabled: !!id,
});
// Build departure station list from the outbound schedule's route stops (ordered by sequence)
const routeStopStations: Station[] = pkg?.outboundSchedule?.stopTimes?.length
? pkg.outboundSchedule.stopTimes.map((st) => st.station).filter(Boolean)
// Build departure station list from live route stops (always reflects current route definition)
const routeStopStations: Station[] = pkg?.outboundSchedule?.routeStops?.length
? pkg.outboundSchedule.routeStops.map((rs) => rs.station).filter(Boolean)
: [];
const selectedTier = pkg?.priceTiers?.find((t) => t.id === selectedTierId);