Skip to content

Commit

Permalink
Merge branch 'develop' into dev-ks/dbperf
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKrisKrisu authored Jul 31, 2024
2 parents 88226c1 + 0692f2f commit b182e2b
Show file tree
Hide file tree
Showing 96 changed files with 4,837 additions and 4,926 deletions.
4 changes: 0 additions & 4 deletions .env.docker
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ MIX_LEGAL_TEL="01234 / 56789"
TELEGRAM_ADMIN_ID=123456789
TELEGRAM_TOKEN=12345678:abcdefghijklmnop

# ORTS Backend for support tickets
TICKET_HOST=https://example.org
TICKET_APIKEY=xxx

# Should the year in review be visible to the users?
YEAR_IN_REVIEW_ACTIVE=false

Expand Down
15 changes: 4 additions & 11 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,14 @@ MIX_LEGAL_ADDRESS2="12345 Musterstadt"
MIX_LEGAL_EMAIL="[email protected]"
MIX_LEGAL_TEL="01234 / 56789"

# Telegram Bot credentials. Currently only used for the admin backend
TELEGRAM_ADMIN_ID=123456789
TELEGRAM_TOKEN=12345678:abcdefghijklmnop

# ORTS Backend for support tickets
TICKET_HOST=https://example.org
TICKET_APIKEY=xxx

# Should the year in review be visible to the users?
YEAR_IN_REVIEW_BACKEND=false
YEAR_IN_REVIEW_ALERT=false

# Webhook urls which will be called when a new event is suggested
ADMIN_NOTIFICATION_URL=https://api.telegram.org/bot.../sendMessage
ADMIN_NOTIFICATION_CHAT_ID=123456789
# Telegram Bot credentials - used for admin notifications
TELEGRAM_ADMIN_ACTIVE=false # Set to true to enable Telegram notifications
TELEGRAM_ADMIN_TOKEN=0000000000:0000000000000000000000000000
TELEGRAM_ADMIN_CHAT_ID=123456789

# Shall webhooks actually call other servers? Default is off to work privacy-preserving.
WEBHOOKS_ACTIVE=true
Expand Down
178 changes: 178 additions & 0 deletions .idea/LNKD.tech Editor.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/trwl.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 13 additions & 4 deletions API_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@ In this we try to keep track of changes to the API.
Primarily this should document changes that are not backwards compatible or belongs to already documented endpoints.
This is to help you keep track of the changes and to help you update your code accordingly.

# 2024-07-17

The Endpoint `/report` now correctly uses camelCase for the `subjectType` and `subjectId` field.
Since the current usage of this endpoint is very low, the old snake_case fields will be removed after 2024-08-17.

# 2024-06-28

The `LeaderboardUserResource` is now returning the whole `LightUserResource` for the user who created it in the `user` field.
Thus the following fields of the `LeaderboardUserResource` are now **marked as deprecated and will be removed after August 2024**.
The `LeaderboardUserResource` is now returning the whole `LightUserResource` for the user who created it in the `user`
field.
Thus the following fields of the `LeaderboardUserResource` are now **marked as deprecated and will be removed after
August 2024**.

- `id`
- `displayName`
Expand All @@ -22,8 +29,10 @@ Changed `/operator` to `/operators`

## 2024-05-31

The `StatusResource` is now returning the whole `LightUserResource` for the user who created it in the `userDetails` field.
Thus the following fields of the `StatusResource` are now **marked as deprecated and will be removed after August 2024**.
The `StatusResource` is now returning the whole `LightUserResource` for the user who created it in the `userDetails`
field.
Thus the following fields of the `StatusResource` are now **marked as deprecated and will be removed after August 2024
**.

- `user`
- `username`
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ WORKDIR /usr/src/trwl
RUN composer install --ignore-platform-reqs --no-interaction --no-progress --no-suggest --optimize-autoloader
RUN php artisan optimize

FROM php:8.3.8-apache
FROM php:8.3.9-apache
ENV APACHE_DOCUMENT_ROOT=/var/www/html/public

RUN apt update && \
Expand Down
21 changes: 11 additions & 10 deletions app/Enum/HafasTravelType.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,17 @@ enum HafasTravelType: string

public function getEmoji(): string {
return match ($this->value) {
'nationalExpress', 'national' => '🚄',
'regionalExp', 'regional' => '🚆',
'suburban' => '🚋',
'bus' => '🚌',
'ferry' => '',
'subway' => '🚇',
'tram' => '🚊',
'taxi' => '🚖',
'plane' => '✈️',
default => '',
'nationalExpress' => '🚄',
'regionalExp', 'national' => '🚆',
'regional' => '🚞',
'suburban' => '🚋',
'bus' => '🚌',
'ferry' => '',
'subway' => '🚇',
'tram' => '🚊',
'taxi' => '🚖',
'plane' => '✈️',
default => '',
};
}

Expand Down
6 changes: 4 additions & 2 deletions app/Enum/PointReason.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
/**
* @OA\Schema(
* title="PointsReason",
* description="What is the reason for the points calculation factor? (0=in time => 100%, 1=good enough => 25%, 2=not sufficient (1 point), 3=forced => no points)",
* description="What is the reason for the points calculation factor? (0=in time => 100%, 1=good enough => 25%, 2=not sufficient (1 point), 3=forced => no points, 4=manual trip => no points, 5=points disabled)",
* type="integer",
* enum={0,1,2,3},
* enum={0,1,2,3,4,5},
* example=1
* )
*/
Expand All @@ -23,4 +23,6 @@ enum PointReason: int
* Trip was manually created by the user => no points.
*/
case MANUAL_TRIP = 4;

case POINTS_DISABLED = 5;
}
1 change: 1 addition & 0 deletions app/Enum/Report/ReportableSubject.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ enum ReportableSubject: string
case EVENT = 'Event';
case STATUS = 'Status';
case USER = 'User';
case TRIP = 'Trip';
}
4 changes: 4 additions & 0 deletions app/Http/Controllers/API/v1/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@
* name="Webhooks",
* description="Manage Webhooks for third party applications"
* )
* @OA\Tag(
* name="Report",
* description="Report a Status, Event or User to the admins"
* )
*/
class Controller extends \App\Http\Controllers\Controller
{
Expand Down
Loading

0 comments on commit b182e2b

Please sign in to comment.