Direct payments for invoices
Events can be moved to archive and moved back Fixed validation
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domains\Event\Controllers;
|
||||
|
||||
use App\Domains\Event\Actions\ArchiveEvent\ArchiveEventCommand;
|
||||
use App\Domains\Event\Actions\ArchiveEvent\ArchiveEventRequest;
|
||||
use App\Scopes\CommonController;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class EventArchiveController extends CommonController
|
||||
{
|
||||
public function __invoke(string $eventId, Request $request): JsonResponse {
|
||||
$event = $this->events->getByIdentifier($eventId);
|
||||
|
||||
$archiveEventRequest = new ArchiveEventRequest($event);
|
||||
$archiveEventCommand = new ArchiveEventCommand($archiveEventRequest);
|
||||
$response = $archiveEventCommand->execute();
|
||||
|
||||
return response()->json([
|
||||
'status' => $response->success ? 'success' : 'error',
|
||||
'message' => $response->success ? 'Das Event wurde erfolgreich archiviert.' : 'Beim Archivieren des Events ist ein Fehler aufgetreten.'
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user