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
2 changes: 2 additions & 0 deletions API_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ Check back here regularly to stay ahead of removals.

# 2026-10-17

New field `operator` in `DepartureResource` (`GET /station/{id}/departures`): the operator of the trip, `null` if unknown.

Removed the following deprecated fields, announced in 2026-03 and 2026-04:

- `EventDetailsResource.trainDistance`: use `totalDistance` instead
Expand Down
4 changes: 3 additions & 1 deletion app/Http/Resources/DepartureResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#[OA\Schema(
title: 'Departure',
description: 'A single departure at a station',
required: ['tripId', 'when', 'plannedWhen', 'platform', 'plannedPlatform', 'direction', 'line', 'cancelled', 'station'],
required: ['tripId', 'when', 'plannedWhen', 'platform', 'plannedPlatform', 'direction', 'line', 'cancelled', 'station', 'operator'],
properties: [
new OA\Property(property: 'tripId', description: 'Unique trip identifier', type: 'string', example: '1|200513|0|81|6012023'),
new OA\Property(property: 'when', description: 'Actual departure time (null if no realtime data)', type: 'string', format: 'date-time', example: '2023-01-06T13:49:00+01:00', nullable: true),
Expand All @@ -35,6 +35,7 @@
),
new OA\Property(property: 'cancelled', description: 'Whether this departure is cancelled', type: 'boolean', example: false),
new OA\Property(property: 'station', ref: '#/components/schemas/StationResource'),
new OA\Property(property: 'operator', ref: OperatorResource::class, nullable: true),
],
)]
class DepartureResource extends JsonResource
Expand Down Expand Up @@ -63,6 +64,7 @@ public function toArray($request): array
],
'cancelled' => $this->resource->cancelled,
'station' => new StationResource($this->resource->station),
'operator' => $this->resource->trip->operator ? new OperatorResource($this->resource->trip->operator) : null,
];
}
}
9 changes: 8 additions & 1 deletion resources/tailwind-app/pages/Checkin/LineRunPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const displayLineName = computed(() => (lineName.value ?? '').replaceAll(/\(.*?\

const tripCategory = ref<HafasTravelType | null>(initialCategory.value);
const tripUuid = ref<string | null>(null);
const operatorName = ref<string | null>(null);

function handleBack(): void {
router.back();
Expand All @@ -44,6 +45,7 @@ function handleBack(): void {
function onTrip(trip: TripResource): void {
tripCategory.value = trip.category ?? initialCategory.value;
tripUuid.value = trip.uuid ?? tripUuid.value;
operatorName.value = trip.operator?.name ?? null;
}

function selectStart(stopover: StopoverResource): void {
Expand Down Expand Up @@ -112,7 +114,12 @@ function selectDestination(stopover: StopoverResource): void {
:background-color="color"
:color="textColor"
/>
<span class="font-medium text-sm truncate">{{ direction }}</span>
<div class="flex flex-col min-w-0">
<span class="font-medium text-sm truncate">{{ direction }}</span>
<span v-if="operatorName" class="text-xs text-base-content/60 truncate">
{{ operatorName }}
</span>
</div>
</div>

<!-- Stop list: no startId yet lists every stop but the last for
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 @@ -1368,6 +1368,7 @@ export interface DepartureResource {
*/
cancelled: boolean;
station: StationResource;
operator: OperatorResource | null;
}

/**
Expand Down
17 changes: 16 additions & 1 deletion storage/api-docs/api-docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -13715,7 +13715,8 @@
"direction",
"line",
"cancelled",
"station"
"station",
"operator"
],
"properties": {
"tripId": {
Expand Down Expand Up @@ -13806,6 +13807,20 @@
},
"station": {
"$ref": "#/components/schemas/StationResource"
},
"operator": {
"oneOf": [
{
"$ref": "#/components/schemas/OperatorResource"
},
{
"type": "object",
"nullable": true,
"enum": [
null
]
}
]
}
},
"type": "object"
Expand Down
Loading