2026-11-14 16:06:12 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace App\Cqs\Actions\Contact;
|
|
|
|
|
|
|
|
|
|
use App\Contracts\ActionInput;
|
2026-11-14 23:15:10 +01:00
|
|
|
use Domain\Models\ValueObjects\OrderReference;
|
2026-11-14 16:06:12 +01:00
|
|
|
use Illuminate\Http\UploadedFile;
|
|
|
|
|
use Webmozart\Assert\Assert;
|
|
|
|
|
|
|
|
|
|
final readonly class SubmitContactFormInput implements ActionInput
|
|
|
|
|
{
|
|
|
|
|
public function __construct(
|
|
|
|
|
public string $lastName,
|
|
|
|
|
public string $firstName,
|
|
|
|
|
public string $email,
|
|
|
|
|
public string $subject,
|
|
|
|
|
public string $message,
|
2026-11-14 23:15:10 +01:00
|
|
|
public ?OrderReference $orderRef = null,
|
2026-11-14 16:06:12 +01:00
|
|
|
public ?UploadedFile $file = null,
|
|
|
|
|
) {
|
|
|
|
|
Assert::stringNotEmpty(trim($this->lastName));
|
|
|
|
|
Assert::stringNotEmpty(trim($this->firstName));
|
|
|
|
|
Assert::stringNotEmpty(trim($this->email));
|
|
|
|
|
Assert::stringNotEmpty(trim($this->subject));
|
|
|
|
|
Assert::stringNotEmpty(trim($this->message));
|
|
|
|
|
}
|
|
|
|
|
}
|