Feat: Implement fine grained teamer profile data validation

This commit is contained in:
Björn Fromme
2023-09-19 18:42:01 +02:00
parent 9a95daa3db
commit 7f7a35e7a2
13 changed files with 156 additions and 20 deletions
+8 -7
View File
@@ -32,19 +32,19 @@ class Teamer implements TimestampableEntityInterface
private string $uuid;
#[ORM\Column(length: 255)]
#[Assert\NotBlank(message: 'Bitte gib deinen Vornamen an')]
#[Assert\NotBlank(message: 'Bitte gib deinen Vornamen an', groups: ['profile'])]
private ?string $firstName = null;
#[ORM\Column(length: 255)]
#[Assert\NotBlank(message: 'Bitte gib deinen Nachnamen an')]
#[Assert\NotBlank(message: 'Bitte gib deinen Nachnamen an', groups: ['profile'])]
private ?string $lastName = null;
#[ORM\Column(length: 1)]
#[Assert\NotBlank(message: 'Bitte gib dein Geschlecht an')]
#[Assert\NotBlank(message: 'Bitte gib dein Geschlecht an', groups: ['profile'])]
private ?string $gender = null;
#[ORM\Column(type: Types::DATE_IMMUTABLE)]
#[Assert\NotNull(message: 'Bitte gib dein Geburtsdatum an')]
#[Assert\NotNull(message: 'Bitte gib dein Geburtsdatum an', groups: ['profile'])]
private ?\DateTimeImmutable $dateOfBirth = null;
#[ORM\Column(length: 255, nullable: true)]
@@ -54,7 +54,7 @@ class Teamer implements TimestampableEntityInterface
private ?string $salutation = null;
#[ORM\Column(length: 255, nullable: true)]
#[Assert\NotBlank(message: 'Bitte gib deine Nationalität an')]
#[Assert\NotBlank(message: 'Bitte gib deine Nationalität an', groups: ['profile'])]
private ?string $nationality = null;
#[ORM\Embedded(class: Address::class)]
@@ -70,11 +70,11 @@ class Teamer implements TimestampableEntityInterface
private ?BankAccount $bankAccount = null;
#[ORM\Column(length: 255, nullable: true)]
#[Assert\NotBlank(message: 'Bitte gib deine SteuerID an')]
#[Assert\NotBlank(message: 'Bitte gib deine SteuerID an', groups: ['profile', 'profile_preflight'])]
private ?string $taxId = null;
#[ORM\Column(length: 255, nullable: true)]
#[Assert\NotBlank(message: 'Bitte gib deine Krankenversicherung an')]
#[Assert\NotBlank(message: 'Bitte gib deine Krankenversicherung an', groups: ['profile', 'profile_preflight'])]
private ?string $healthInsuranceCompany = null;
#[ORM\Column(length: 32)]
@@ -87,6 +87,7 @@ class Teamer implements TimestampableEntityInterface
private Collection $availabilities;
#[ORM\OneToOne(cascade: ['persist', 'remove'])]
#[Assert\NotNull(message: 'Bitte lade ein Foto von dir hoch', groups: ['profile', 'profile_preflight'])]
private ?Upload $photo = null;
#[ORM\OneToMany(mappedBy: 'teamer', targetEntity: Feedback::class)]