Skip to content

Commit

Permalink
📝 add default tag trwl:passenger_rights (#2175)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKrisKrisu authored Nov 30, 2023
1 parent 4b99525 commit b6c313a
Show file tree
Hide file tree
Showing 7 changed files with 259 additions and 238 deletions.
24 changes: 13 additions & 11 deletions app/Enum/StatusTagKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,23 @@

enum StatusTagKey: string implements IconEnumInterface
{
case SEAT = 'trwl:seat';
case WAGON = 'trwl:wagon';
case TICKET = 'trwl:ticket';
case TRAVEL_CLASS = 'trwl:travel_class';
case SEAT = 'trwl:seat';
case WAGON = 'trwl:wagon';
case TICKET = 'trwl:ticket';
case TRAVEL_CLASS = 'trwl:travel_class';
case LOCOMOTIVE_CLASS = 'trwl:locomotive_class';
case WAGON_CLASS = 'trwl:wagon_class';
case ROLE = 'trwl:role';
case VEHICLE_NUMBER = 'trwl:vehicle_number';
case WAGON_CLASS = 'trwl:wagon_class';
case ROLE = 'trwl:role';
case VEHICLE_NUMBER = 'trwl:vehicle_number';
case PASSENGER_RIGHTS = 'trwl:passenger_rights';

public function faIcon(): ?string {
return match ($this) {
self::SEAT => 'fa-couch',
self::ROLE => 'fa-briefcase',
self::TICKET => 'fa-qrcode',
default => null,
self::SEAT => 'fa-couch',
self::ROLE => 'fa-briefcase',
self::TICKET => 'fa-qrcode',
self::PASSENGER_RIGHTS => 'fa-user-shield',
default => null,
};
}

Expand Down
17 changes: 12 additions & 5 deletions app/Http/Controllers/API/v1/StatusTagController.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,18 @@ public function update(Request $request, int $statusId, string $tagKey): JsonRes
* description="Creates a single StatusTag Object, if user is authorized to. <br><br>The key of a tag is free
* text. You can choose it as you need it. However, <b>please use a namespace for tags</b>
* (<i>namespace:xxx</i>) that only affect your own application.<br><br>For tags related to standard actions
* we recommend the following tags in the trwl namespace:<br><ul><li>trwl:seat (i.e. 61)</li><li>trwl:wagon
* (i.e. 25)</li><li>trwl:ticket (i.e. BahnCard 100 first))</li><li>trwl:travel_class (i.e. 1, 2, business,
* economy, ...)</li><li>trwl:locomotive_class (BR424, BR450)</li><li>trwl:wagon_class (i.e. Bpmz)</li>
* <li>trwl:role (i.e. Tf, Zf, Gf, Lokführer, conducteur de train, ...)</li><li>trwl:vehicle_number (i.e. 425
* 001, Tz9001, 123, ...)</li></ul>",
* we recommend the following tags in the trwl namespace:<br>
* <ul>
* <li>trwl:seat (i.e. 61)</li>
* <li>trwl:wagon (i.e. 25)</li>
* <li>trwl:ticket (i.e. BahnCard 100 first))</li>
* <li>trwl:travel_class (i.e. 1, 2, business, economy, ...)</li>
* <li>trwl:locomotive_class (BR424, BR450)</li>
* <li>trwl:wagon_class (i.e. Bpmz)</li>
* <li>trwl:role (i.e. Tf, Zf, Gf, Lokführer, conducteur de train, ...)</li>
* <li>trwl:vehicle_number (i.e. 425 001, Tz9001, 123, ...)</li>
* <li>trwl:passenger_rights (i.e. yes / no / ID of claim)</li>
* </ul>",
* @OA\Parameter (
* name="statusId",
* in="path",
Expand Down
Loading

0 comments on commit b6c313a

Please sign in to comment.