feat: improved validation of personal data

This commit is contained in:
Björn Fromme
2025-04-11 08:29:06 +02:00
parent 011fe9c5c4
commit 9c1aa60782
5 changed files with 53 additions and 27 deletions
+16 -6
View File
@@ -2,13 +2,23 @@
namespace App\BusProNet\Model;
use Symfony\Component\Validator\Constraints as Assert;
class Address
{
public ?string $street = null;
public ?string $postCode = null;
public ?string $city = null;
public ?string $district = null;
public ?string $country = null;
#[Assert\NotBlank(message: 'Bitte angeben', groups: ['personal_data'])]
public ?string $street = '';
#[Assert\NotBlank(message: 'Bitte angeben', groups: ['personal_data'])]
public ?string $postCode = '';
#[Assert\NotBlank(message: 'Bitte angeben', groups: ['personal_data'])]
public ?string $city = '';
public ?string $district = '';
#[Assert\NotBlank(message: 'Bitte angeben', groups: ['personal_data'])]
public ?string $country = '';
public function toPayload(): array
{
@@ -20,4 +30,4 @@ class Address
'land' => $this->country,
];
}
}
}