Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions API_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ Check back here regularly to stay ahead of removals.

---

# 2026-03-14 (Freight train category)

Added new transport category `freightTrain` to `HafasTravelType`. Users can now create manual trips with the freight train type.

---

# 2026-03-07 (UUID support for Users)

The `UserResource` now includes a `uuid` field alongside the existing integer `id`.
Expand Down
6 changes: 4 additions & 2 deletions app/Enum/HafasTravelType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
description: 'Category of transport.',
type: 'string',
example: 'suburban',
enum: ['nationalExpress', 'national', 'regionalExp', 'regional', 'suburban', 'bus', 'ferry', 'subway', 'tram', 'taxi', 'plane'],
enum: ['nationalExpress', 'national', 'regionalExp', 'regional', 'suburban', 'bus', 'ferry', 'subway', 'tram', 'taxi', 'plane', 'freightTrain'],
)]
enum HafasTravelType: string
{
Expand All @@ -26,6 +26,7 @@ enum HafasTravelType: string
case TRAM = 'tram';
case TAXI = 'taxi';
case PLANE = 'plane';
case FREIGHT_TRAIN = 'freightTrain';

public function getEmoji(): string
{
Expand All @@ -40,6 +41,7 @@ public function getEmoji(): string
'tram' => '🚊',
'taxi' => '🚖',
'plane' => '✈️',
'freightTrain' => '🚂',
default => '',
};
}
Expand All @@ -57,7 +59,7 @@ public function getORRProfile(): ?OpenRailRoutingProfile
return match ($this) {
HafasTravelType::NATIONAL_EXPRESS, HafasTravelType::NATIONAL => OpenRailRoutingProfile::TGV_ALL,
HafasTravelType::TRAM, HafasTravelType::SUBWAY => OpenRailRoutingProfile::TRAM_TRAIN,
HafasTravelType::REGIONAL_EXP, HafasTravelType::REGIONAL, HafasTravelType::SUBURBAN => OpenRailRoutingProfile::ALL_TRACKS,
HafasTravelType::REGIONAL_EXP, HafasTravelType::REGIONAL, HafasTravelType::SUBURBAN, HafasTravelType::FREIGHT_TRAIN => OpenRailRoutingProfile::ALL_TRACKS,
default => null,
};
}
Expand Down
1 change: 1 addition & 0 deletions lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,7 @@
"transport_types.businessPlural": "Geschäftliche Reisen",
"transport_types.express": "Fernverkehr",
"transport_types.ferry": "Schiffe",
"transport_types.freightTrain": "Güterzug",
"transport_types.national": "Intercity- und Eurocityzüge",
"transport_types.nationalExpress": "Hochgeschwindigkeitszüge",
"transport_types.plane": "Flugzeug",
Expand Down
1 change: 1 addition & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,7 @@
"transport_types.businessPlural": "Business trips",
"transport_types.express": "Express",
"transport_types.ferry": "Ferry",
"transport_types.freightTrain": "Freight train",
"transport_types.national": "Intercity and Eurocity trains",
"transport_types.nationalExpress": "High speed trains",
"transport_types.plane": "Plane",
Expand Down
1 change: 1 addition & 0 deletions lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,7 @@
"transport_types.businessPlural": "Voyages professionnels",
"transport_types.express": "Grandes lignes",
"transport_types.ferry": "Ferry",
"transport_types.freightTrain": "Train de marchandises",
"transport_types.national": "Trains Intercity et Eurocity",
"transport_types.nationalExpress": "Trains à grande vitesse",
"transport_types.plane": "Avion",
Expand Down
1 change: 1 addition & 0 deletions resources/types/Api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ export enum HafasTravelType {
Tram = "tram",
Taxi = "taxi",
Plane = "plane",
FreightTrain = "freightTrain",
}

/**
Expand Down
16 changes: 10 additions & 6 deletions resources/vue/components/ProductIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,18 @@ const iconForProduct = (product: string) => {
return null;
};

const fontAwesomeIcon = (product: string) => {
const fontAwesomeIcons = (product: string): string[] => {
switch (product) {
case 'taxi':
return 'fa-taxi';
return ['fa-taxi'];
case 'plane':
return 'fa-plane';
return ['fa-plane'];
case 'ferry':
return 'fa-ship';
return ['fa-ship'];
case 'freightTrain':
return ['fa-train', 'fa-boxes-stacked'];
default:
return 'fa-train';
return ['fa-train'];
}
};

Expand Down Expand Up @@ -67,7 +69,9 @@ const motisFontAwesomeIcon = (mode: MotisCategory) => {
<template>
<template v-if="mode === null">
<img v-if="iconForProduct(product)" :alt="product" :src="iconForProduct(product) || ''" class="product-icon" />
<i v-else class="fas" :class="fontAwesomeIcon(product)" />
<template v-else>
<i v-for="icon in fontAwesomeIcons(product)" :key="icon" class="fas" :class="icon" />
</template>
</template>
<template v-else>
<img v-if="iconForMode(mode)" :alt="mode?.toString()" :src="iconForMode(mode) || ''" class="product-icon" />
Expand Down
1 change: 1 addition & 0 deletions resources/vue/components/TripCreation/TripCreationForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export default {
{ value: 'tram', text: 'tram', emoji: '🚊' },
{ value: 'taxi', text: 'taxi', emoji: '🚖' },
{ value: 'plane', text: 'plane', emoji: '✈️' },
{ value: 'freightTrain', text: 'freightTrain', emoji: '🚂' },
],
operators: [],
disallowed: ['fahrrad', 'auto', 'fuss', 'fuß', 'foot', 'car', 'bike'],
Expand Down
3 changes: 2 additions & 1 deletion storage/api-docs/api-docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -6091,7 +6091,8 @@
"subway",
"tram",
"taxi",
"plane"
"plane",
"freightTrain"
]
},
"MapProvider": {
Expand Down
Loading