Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into dev-ks/friend-checkin
Browse files Browse the repository at this point in the history
# Conflicts:
#	app/Http/Controllers/API/v1/SettingsController.php
#	app/Http/Controllers/API/v1/TransportController.php
#	app/Models/User.php
#	resources/views/includes/status.blade.php
#	storage/api-docs/api-docs.json
  • Loading branch information
HerrLevin committed Jul 28, 2024
2 parents 2d324cc + 0dc5cb1 commit ef35152
Show file tree
Hide file tree
Showing 139 changed files with 6,587 additions and 2,843 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
4 changes: 0 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,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_BACKEND=false
YEAR_IN_REVIEW_ALERT=false
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.

3 changes: 1 addition & 2 deletions .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
105 changes: 105 additions & 0 deletions app/Dto/Internal/CheckInRequestDto.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<?php

declare(strict_types=1);

namespace App\Dto\Internal;

use App\Enum\Business;
use App\Enum\StatusVisibility;
use App\Models\Event;
use App\Models\Station;
use App\Models\Trip;
use Carbon\Carbon;
use Illuminate\Contracts\Auth\Authenticatable;

class CheckInRequestDto
{
public Authenticatable $user;
public Trip $trip;
public Station $origin;
public Carbon $departure;
public Station $destination;
public Carbon $arrival;
public Business $travelReason;
public StatusVisibility $statusVisibility;
public ?string $body;
public ?Event $event;
public bool $forceFlag;
public bool $postOnMastodonFlag;
public bool $chainFlag;

public function __construct() {
$this->travelReason = Business::PRIVATE;
$this->statusVisibility = StatusVisibility::PUBLIC;
$this->body = null;
$this->event = null;
$this->forceFlag = false;
$this->postOnMastodonFlag = false;
$this->chainFlag = false;
}

public function setUser(Authenticatable $user): CheckInRequestDto {
$this->user = $user;
return $this;
}

public function setTrip(Trip $trip): CheckInRequestDto {
$this->trip = $trip;
return $this;
}

public function setOrigin(Station $origin): CheckInRequestDto {
$this->origin = $origin;
return $this;
}

public function setDeparture(Carbon $departure): CheckInRequestDto {
$this->departure = $departure;
return $this;
}

public function setDestination(Station $destination): CheckInRequestDto {
$this->destination = $destination;
return $this;
}

public function setArrival(Carbon $arrival): CheckInRequestDto {
$this->arrival = $arrival;
return $this;
}

public function setTravelReason(Business $travelReason): CheckInRequestDto {
$this->travelReason = $travelReason;
return $this;
}

public function setStatusVisibility(StatusVisibility $statusVisibility): CheckInRequestDto {
$this->statusVisibility = $statusVisibility;
return $this;
}

public function setBody(?string $body): CheckInRequestDto {
$this->body = $body;
return $this;
}

public function setEvent(?Event $event): CheckInRequestDto {
$this->event = $event;
return $this;
}

public function setForceFlag(bool $forceFlag): CheckInRequestDto {
$this->forceFlag = $forceFlag;
return $this;
}

public function setPostOnMastodonFlag(bool $postOnMastodonFlag): CheckInRequestDto {
$this->postOnMastodonFlag = $postOnMastodonFlag;
return $this;
}

public function setChainFlag(bool $chainFlag): CheckInRequestDto {
$this->chainFlag = $chainFlag;
return $this;
}
}
25 changes: 25 additions & 0 deletions app/Dto/Internal/CheckinSuccessDto.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

declare(strict_types=1);

namespace App\Dto\Internal;

use App\Dto\PointCalculation;
use App\Models\Status;
use Illuminate\Database\Eloquent\Collection;

readonly class CheckinSuccessDto
{
public Status $status;
public PointCalculation $pointCalculation;
/**
* @var Collection<Status>
*/
public Collection $alsoOnThisConnection;

public function __construct(Status $status, PointCalculation $pointCalculation, Collection $alsoOnThisConnection) {
$this->status = $status;
$this->pointCalculation = $pointCalculation;
$this->alsoOnThisConnection = $alsoOnThisConnection;
}
}
2 changes: 1 addition & 1 deletion app/Dto/LivePointDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
* @OA\Property(
* title="statusId",
* description="ID of status",
* format="int64",
* format="int",
* example=12345
* )
**/
Expand Down
Loading

0 comments on commit ef35152

Please sign in to comment.