Handling of event addons
This commit is contained in:
@@ -2,8 +2,12 @@
|
||||
|
||||
namespace App\Domains\Event\Controllers;
|
||||
|
||||
use App\Domains\Event\Actions\SetEventAddons\SetEventAddonsCommand;
|
||||
use App\Domains\Event\Actions\SetEventAddons\SetEventAddonsRequest;
|
||||
use App\Domains\Event\Actions\SetParticipationFees\SetParticipationFeesCommand;
|
||||
use App\Domains\Event\Actions\SetParticipationFees\SetParticipationFeesRequest;
|
||||
use App\Domains\Event\Actions\SetParticipationOptions\SetParticipationOptionsCommand;
|
||||
use App\Domains\Event\Actions\SetParticipationOptions\SetParticipationOptionsRequest;
|
||||
use App\Domains\Event\Actions\SetPaymentMethods\SetPaymentMethodsCommand;
|
||||
use App\Domains\Event\Actions\SetPaymentMethods\SetPaymentMethodsRequest;
|
||||
use App\Domains\Event\Actions\UpdateEvent\UpdateEventCommand;
|
||||
@@ -142,6 +146,28 @@ class DetailsController extends CommonController {
|
||||
return response()->json(['status' => $response->success ? 'success' : 'error']);
|
||||
}
|
||||
|
||||
public function updateParticipationOptions(int $eventId, Request $request): JsonResponse
|
||||
{
|
||||
$event = $this->events->getById($eventId);
|
||||
|
||||
$setRequest = new SetParticipationOptionsRequest($event, (array)$request->input('questions', []));
|
||||
$setCommand = new SetParticipationOptionsCommand($setRequest);
|
||||
$response = $setCommand->execute();
|
||||
|
||||
return response()->json(['status' => $response->success ? 'success' : 'error', 'message' => $response->message]);
|
||||
}
|
||||
|
||||
public function updateEventAddons(int $eventId, Request $request): JsonResponse
|
||||
{
|
||||
$event = $this->events->getById($eventId);
|
||||
|
||||
$setRequest = new SetEventAddonsRequest($event, (array)$request->input('addons', []));
|
||||
$setCommand = new SetEventAddonsCommand($setRequest);
|
||||
$response = $setCommand->execute();
|
||||
|
||||
return response()->json(['status' => $response->success ? 'success' : 'error', 'message' => $response->message]);
|
||||
}
|
||||
|
||||
public function downloadPdfList(string $eventId, string $listType, Request $request): Response
|
||||
{
|
||||
$event = $this->events->getByIdentifier($eventId);
|
||||
@@ -195,6 +221,12 @@ class DetailsController extends CommonController {
|
||||
case 'by-participation-group':
|
||||
$participants = $this->eventParticipants->groupByParticipationType($event, $request);
|
||||
break;
|
||||
case 'by-participation-option':
|
||||
$participants = $this->eventParticipants->groupByParticipationOption($event, $request);
|
||||
break;
|
||||
case 'by-addon':
|
||||
$participants = $this->eventParticipants->groupByAddon($event, $request);
|
||||
break;
|
||||
case 'signed-off':
|
||||
$participants = $this->eventParticipants->getSignedOffParticipants($event, $request);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user