Support oft parent groups
This commit is contained in:
@@ -14,6 +14,7 @@ use App\Domains\Event\Actions\UpdateEvent\UpdateEventCommand;
|
||||
use App\Domains\Event\Actions\UpdateEvent\UpdateEventRequest;
|
||||
use App\Domains\Event\Actions\UpdateManagers\UpdateManagersCommand;
|
||||
use App\Domains\Event\Actions\UpdateManagers\UpdateManagersRequest;
|
||||
use App\Enumerations\ParticipantGroupType;
|
||||
use App\Enumerations\ParticipationFeeType;
|
||||
use App\Enumerations\ParticipationType;
|
||||
use App\Providers\InertiaProvider;
|
||||
@@ -27,7 +28,10 @@ use Illuminate\Http\Response;
|
||||
class DetailsController extends CommonController {
|
||||
public function __invoke(string $eventId) {
|
||||
$event = $this->events->getByIdentifier($eventId);
|
||||
return new InertiaProvider('Event/Details', ['event' => $event])->render();
|
||||
return new InertiaProvider('Event/Details', [
|
||||
'event' => $event,
|
||||
'participantGroupLabel' => $event->participantGroupType()->label(),
|
||||
])->render();
|
||||
}
|
||||
|
||||
public function summary(int $eventId, Request $request) : JsonResponse {
|
||||
@@ -65,6 +69,7 @@ class DetailsController extends CommonController {
|
||||
(bool)$request->input('swimmingPermissionRequired', true),
|
||||
$request->input('street'),
|
||||
$request->input('houseNumber'),
|
||||
ParticipantGroupType::tryFrom((string) $request->input('participantGroupType')),
|
||||
);
|
||||
|
||||
$eventUpdateCommand = new UpdateEventCommand($eventUpdateRequest);
|
||||
@@ -185,6 +190,7 @@ class DetailsController extends CommonController {
|
||||
'rows' => $participants,
|
||||
'kitchenRequirements' => $kitchenOverview,
|
||||
'participantsForKitchenList' => $this->eventParticipants->getParticipantsWithIntolerances($event, $request),
|
||||
'participantGroupLabel' => $event->participantGroupType()->label(),
|
||||
])->render();
|
||||
|
||||
$pdf = PdfGenerateAndDownloadProvider::fromHtml(
|
||||
@@ -208,6 +214,9 @@ class DetailsController extends CommonController {
|
||||
$csv = view('csvs.' . $listType, [
|
||||
'event' => $event->name,
|
||||
'rows' => $participants,
|
||||
// Die Anschriftsspalten beschreiben immer die Local Group, die Gruppenspalte die gewählte Gruppe.
|
||||
'localGroupLabel' => ParticipantGroupType::LocalGroup->label(),
|
||||
'participantGroupLabel' => $event->participantGroupType()->label(),
|
||||
])->render();
|
||||
|
||||
return response($csv, 200, [
|
||||
@@ -220,7 +229,7 @@ class DetailsController extends CommonController {
|
||||
$event = $this->events->getByIdentifier($eventId);
|
||||
switch ($listType) {
|
||||
case 'by-local-group':
|
||||
$participants = $this->eventParticipants->groupByLocalGroup($event, $request);
|
||||
$participants = $this->eventParticipants->groupByParticipantGroup($event, $request);
|
||||
break;
|
||||
case 'by-participation-group':
|
||||
$participants = $this->eventParticipants->groupByParticipationType($event, $request);
|
||||
|
||||
Reference in New Issue
Block a user