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

| Announced | What? | Safe until | PR |
|------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------|---------------------------------------------------------------|
| 2026-03-07 | `EventDetailsResource.trainDistance` is deprecated → use `totalDistance` instead | 2026-09-30 | [#4554](https://github.com/Traewelling/traewelling/pull/4554) |
| 2026-03-07 | `EventDetailsResource.trainDuration` is deprecated → use `totalDuration` instead | 2026-09-30 | [#4554](https://github.com/Traewelling/traewelling/pull/4554) |
| 2026-03-07 | `CheckinSuccessResource.points.additional` is always `null` and deprecated | 2026-09-30 | [#4553](https://github.com/Traewelling/traewelling/pull/4553) |
| 2026-03-07 | `DepartureResource.destination` is deprecated → use `direction` instead | 2026-09-30 | [#4552](https://github.com/Traewelling/traewelling/pull/4552) |
| 2026-03-07 | `DepartureResource.delay` is deprecated → use `when`/`plannedWhen` difference instead | 2026-09-30 | [#4552](https://github.com/Traewelling/traewelling/pull/4552) |
Expand All @@ -34,6 +36,9 @@ Check back here regularly to stay ahead of removals.

# 2026-03-07

The `EventDetailsResource` fields `trainDistance` and `trainDuration` are now **deprecated** and will be removed after **2026-09-30**.
Use `totalDistance` and `totalDuration` instead — both fields are now returned alongside the old ones.

The `CheckinSuccessResource.points.additional` field is now **deprecated** (always `null`) and will be removed after **2026-09-30**.

The following fields of `DepartureResource` are now **deprecated** and will be removed after **2026-09-30**:
Expand Down
12 changes: 8 additions & 4 deletions app/Http/Resources/EventDetailsResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
properties: [
new OA\Property(property: 'id', type: 'integer', example: 39),
new OA\Property(property: 'slug', type: 'string', example: '9_euro_ticket'),
new OA\Property(property: 'trainDistance', type: 'integer', example: 12345),
new OA\Property(property: 'trainDuration', type: 'integer', example: 12345),
new OA\Property(property: 'totalDistance', description: 'distance travelled in meters', type: 'integer', example: 12345),
new OA\Property(property: 'totalDuration', description: 'duration travelled in minutes', type: 'integer', example: 12345),
new OA\Property(property: 'trainDistance', description: 'Deprecated. Use totalDistance instead.', type: 'integer', example: 12345, deprecated: true),
new OA\Property(property: 'trainDuration', description: 'Deprecated. Use totalDuration instead.', type: 'integer', example: 12345, deprecated: true),
],
)]
class EventDetailsResource extends JsonResource
Expand All @@ -21,8 +23,10 @@ public function toArray($request): array
return [
'id' => $this->id,
'slug' => $this->slug,
'trainDistance' => $this->totalDistance, // @todo: rename key - we have more than just trains
'trainDuration' => $this->totalDuration, // @todo: rename key - we have more than just trains
'totalDistance' => $this->totalDistance,
'totalDuration' => $this->totalDuration,
'trainDistance' => $this->totalDistance, // @deprecated - remove after 2026-09-30
'trainDuration' => $this->totalDuration, // @deprecated - remove after 2026-09-30
];
}
}
22 changes: 20 additions & 2 deletions resources/types/Api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1006,9 +1006,27 @@ export interface EventDetailsResource {
id?: number;
/** @example "9_euro_ticket" */
slug?: string;
/** @example 12345 */
/**
* distance travelled in meters
* @example 12345
*/
totalDistance?: number;
/**
* duration travelled in minutes
* @example 12345
*/
totalDuration?: number;
/**
* Deprecated. Use totalDistance instead.
* @deprecated
* @example 12345
*/
trainDistance?: number;
/** @example 12345 */
/**
* Deprecated. Use totalDuration instead.
* @deprecated
* @example 12345
*/
trainDuration?: number;
}

Expand Down
18 changes: 16 additions & 2 deletions storage/api-docs/api-docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -6908,13 +6908,27 @@
"type": "string",
"example": "9_euro_ticket"
},
"trainDistance": {
"totalDistance": {
"description": "distance travelled in meters",
"type": "integer",
"example": 12345
},
"trainDuration": {
"totalDuration": {
"description": "duration travelled in minutes",
"type": "integer",
"example": 12345
},
"trainDistance": {
"description": "Deprecated. Use totalDistance instead.",
"type": "integer",
"example": 12345,
"deprecated": true
},
"trainDuration": {
"description": "Deprecated. Use totalDuration instead.",
"type": "integer",
"example": 12345,
"deprecated": true
}
},
"type": "object"
Expand Down
Loading