chore: complete update

This commit is contained in:
2025-07-17 16:24:20 +02:00
parent 899227b0a4
commit 64a7051137
1300 changed files with 85570 additions and 2756 deletions

View File

@@ -0,0 +1,42 @@
<?php
declare(strict_types=1);
namespace App\Application\Newsletter\SignUp;
use App\Framework\Attributes\Route;
use App\Framework\CommandBus\CommandBus;
use App\Framework\CommandBus\DefaultCommandBus;
use App\Framework\Http\Method;
use App\Framework\Http\Status;
use App\Framework\Router\Result\ContentNegotiationResult;
use App\Framework\Router\Result\JsonResult;
final readonly class NewsletterSignup
{
public function __construct(
public CommandBus $commandBus,
) {}
#[Route(path: '/newsletter/register', method: Method::POST)]
public function __invoke(NewsletterSignupRequest $request): ContentNegotiationResult
{
// Den internen Command ausführen
$command = new SignupUserToNewsletter($request->name, $request->email);
$result = $this->commandBus->dispatch($command);
// Hier könnten Sie das Ergebnis weiterverarbeiten oder loggen
return new ContentNegotiationResult(
jsonPayload: [
'success' => true,
'message' => 'Anmeldung erfolgreich!',
'data' => [
$request->name,
$request->email,
],
],
redirectTo: '/'
);
}
}