|
@@ -10,6 +10,7 @@ use ApiPlatform\Metadata\Post;
|
|
|
use App\Enum\Organization\LegalEnum;
|
|
use App\Enum\Organization\LegalEnum;
|
|
|
use App\Enum\Organization\PrincipalTypeEnum;
|
|
use App\Enum\Organization\PrincipalTypeEnum;
|
|
|
use App\State\Processor\Shop\NewStructureArtistPremiumTrialRequestProcessor;
|
|
use App\State\Processor\Shop\NewStructureArtistPremiumTrialRequestProcessor;
|
|
|
|
|
+use libphonenumber\PhoneNumber;
|
|
|
use Symfony\Component\Validator\Constraints as Assert;
|
|
use Symfony\Component\Validator\Constraints as Assert;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -57,10 +58,7 @@ class NewStructureArtistPremiumTrialRequest implements ShopRequestData
|
|
|
)]
|
|
)]
|
|
|
private string $postalCode;
|
|
private string $postalCode;
|
|
|
|
|
|
|
|
- #[Assert\Length(
|
|
|
|
|
- min: 1,
|
|
|
|
|
- minMessage: 'City must be at least {{ limit }} characters long',
|
|
|
|
|
- )]
|
|
|
|
|
|
|
+ #[Assert\NotBlank]
|
|
|
private string $city;
|
|
private string $city;
|
|
|
|
|
|
|
|
#[Assert\NotBlank]
|
|
#[Assert\NotBlank]
|
|
@@ -78,33 +76,21 @@ class NewStructureArtistPremiumTrialRequest implements ShopRequestData
|
|
|
#[Assert\Regex(pattern: '/^|(\d{9})$/')]
|
|
#[Assert\Regex(pattern: '/^|(\d{9})$/')]
|
|
|
private string $siren;
|
|
private string $siren;
|
|
|
|
|
|
|
|
- #[Assert\Length(
|
|
|
|
|
- min: 1,
|
|
|
|
|
- minMessage: 'Representative first name must be at least {{ limit }} characters long',
|
|
|
|
|
- )]
|
|
|
|
|
|
|
+ #[Assert\NotBlank]
|
|
|
private string $representativeFirstName;
|
|
private string $representativeFirstName;
|
|
|
|
|
|
|
|
- #[Assert\Length(
|
|
|
|
|
- min: 1,
|
|
|
|
|
- minMessage: 'Representative last name must be at least {{ limit }} characters long',
|
|
|
|
|
- )]
|
|
|
|
|
|
|
+ #[Assert\NotBlank]
|
|
|
private string $representativeLastName;
|
|
private string $representativeLastName;
|
|
|
|
|
|
|
|
- #[Assert\Length(
|
|
|
|
|
- min: 1,
|
|
|
|
|
- minMessage: 'Representative function must be at least {{ limit }} characters long',
|
|
|
|
|
- )]
|
|
|
|
|
|
|
+ #[Assert\NotBlank]
|
|
|
private string $representativeFunction;
|
|
private string $representativeFunction;
|
|
|
|
|
|
|
|
#[Assert\NotBlank]
|
|
#[Assert\NotBlank]
|
|
|
#[Assert\Email(message: 'The email {{ value }} is not a valid email.')]
|
|
#[Assert\Email(message: 'The email {{ value }} is not a valid email.')]
|
|
|
private string $representativeEmail;
|
|
private string $representativeEmail;
|
|
|
|
|
|
|
|
- #[Assert\Length(
|
|
|
|
|
- min: 10,
|
|
|
|
|
- minMessage: 'Phone number must be at least {{ limit }} characters long',
|
|
|
|
|
- )]
|
|
|
|
|
- private string $representativePhone;
|
|
|
|
|
|
|
+ #[Assert\NotBlank]
|
|
|
|
|
+ private ?PhoneNumber $representativePhone;
|
|
|
|
|
|
|
|
#[Assert\IsTrue(message: 'terms-must-be-accepted')]
|
|
#[Assert\IsTrue(message: 'terms-must-be-accepted')]
|
|
|
private bool $termsAccepted = false;
|
|
private bool $termsAccepted = false;
|
|
@@ -306,12 +292,12 @@ class NewStructureArtistPremiumTrialRequest implements ShopRequestData
|
|
|
return $this;
|
|
return $this;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public function getRepresentativePhone(): string
|
|
|
|
|
|
|
+ public function getRepresentativePhone(): ?PhoneNumber
|
|
|
{
|
|
{
|
|
|
return $this->representativePhone;
|
|
return $this->representativePhone;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public function setRepresentativePhone(string $representativePhone): self
|
|
|
|
|
|
|
+ public function setRepresentativePhone(?PhoneNumber $representativePhone): self
|
|
|
{
|
|
{
|
|
|
$this->representativePhone = $representativePhone;
|
|
$this->representativePhone = $representativePhone;
|
|
|
|
|
|