| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319 |
- <?php
- declare(strict_types=1);
- namespace App\ApiResources\Shop;
- use ApiPlatform\Metadata\ApiProperty;
- use ApiPlatform\Metadata\ApiResource;
- use ApiPlatform\Metadata\Post;
- use App\Enum\Organization\LegalEnum;
- use App\Enum\Organization\PrincipalTypeEnum;
- use App\State\Processor\Shop\NewStructureArtistPremiumTrialRequestProcessor;
- use Symfony\Component\Validator\Constraints as Assert;
- /**
- * New structure trial request for the artist premium product.
- */
- #[ApiResource(
- operations: [
- new Post(
- uriTemplate: '/public/shop/new-structure-artist-premium-trial-request',
- processor: NewStructureArtistPremiumTrialRequestProcessor::class
- ),
- ]
- )]
- class NewStructureArtistPremiumTrialRequest
- {
- /**
- * Id 'bidon' ajouté par défaut pour permettre la construction
- * de l'IRI par api platform.
- */
- #[ApiProperty(identifier: true)]
- private int $id = 0;
- #[Assert\Length(
- min: 2,
- minMessage: "Structure's name must be at least {{ limit }} characters long",
- )]
- private string $structureName;
- #[Assert\NotBlank]
- private string $address;
- private ?string $addressComplement = null;
- #[Assert\Length(
- min: 3,
- minMessage: 'Postal code must be at least {{ limit }} characters long',
- )]
- private string $postalCode;
- #[Assert\Length(
- min: 1,
- minMessage: 'City must be at least {{ limit }} characters long',
- )]
- private string $city;
- #[Assert\NotBlank]
- #[Assert\Email(message: 'The email {{ value }} is not a valid email.')]
- private string $structureEmail;
- private PrincipalTypeEnum $structureType;
- private LegalEnum $legalStatus;
- #[Assert\Regex(pattern: '/^|(\d{9})$/')]
- private string $siren;
- #[Assert\Length(
- min: 1,
- minMessage: 'Representative first name must be at least {{ limit }} characters long',
- )]
- private string $representativeFirstName;
- #[Assert\Length(
- min: 1,
- minMessage: 'Representative last name must be at least {{ limit }} characters long',
- )]
- private string $representativeLastName;
- #[Assert\Length(
- min: 1,
- minMessage: 'Representative function must be at least {{ limit }} characters long',
- )]
- private string $representativeFunction;
- #[Assert\NotBlank]
- #[Assert\Email(message: 'The email {{ value }} is not a valid email.')]
- private string $representativeEmail;
- #[Assert\Length(
- min: 10,
- minMessage: 'Phone number must be at least {{ limit }} characters long',
- )]
- private string $representativePhone;
- #[Assert\IsTrue(message: 'terms-must-be-accepted')]
- private bool $termsAccepted = false;
- private bool $legalRepresentative = false;
- private bool $newsletterSubscription = false;
- public function getId(): int
- {
- return $this->id;
- }
- public function setId(int $id): self
- {
- $this->id = $id;
- return $this;
- }
- public function getStructureName(): string
- {
- return $this->structureName;
- }
- public function setStructureName(string $structureName): self
- {
- $this->structureName = $structureName;
- return $this;
- }
- public function getAddress(): string
- {
- return $this->address;
- }
- public function setAddress(string $address): self
- {
- $this->address = $address;
- return $this;
- }
- public function getAddressComplement(): ?string
- {
- return $this->addressComplement;
- }
- public function setAddressComplement(?string $addressComplement): self
- {
- $this->addressComplement = $addressComplement;
- return $this;
- }
- public function getPostalCode(): string
- {
- return $this->postalCode;
- }
- public function setPostalCode(string $postalCode): self
- {
- $this->postalCode = $postalCode;
- return $this;
- }
- public function getCity(): string
- {
- return $this->city;
- }
- public function setCity(string $city): self
- {
- $this->city = $city;
- return $this;
- }
- public function getStructureEmail(): string
- {
- return $this->structureEmail;
- }
- public function setStructureEmail(string $structureEmail): self
- {
- $this->structureEmail = $structureEmail;
- return $this;
- }
- public function getStructureType(): PrincipalTypeEnum
- {
- return $this->structureType;
- }
- public function setStructureType(PrincipalTypeEnum $structureType): self
- {
- $this->structureType = $structureType;
- return $this;
- }
- public function getLegalStatus(): LegalEnum
- {
- return $this->legalStatus;
- }
- public function setLegalStatus(LegalEnum $legalStatus): self
- {
- $this->legalStatus = $legalStatus;
- return $this;
- }
- public function getSiren(): string
- {
- return $this->siren;
- }
- public function setSiren(string $siren): self
- {
- $this->siren = $siren;
- return $this;
- }
- public function getRepresentativeFirstName(): string
- {
- return $this->representativeFirstName;
- }
- public function setRepresentativeFirstName(string $representativeFirstName): self
- {
- $this->representativeFirstName = $representativeFirstName;
- return $this;
- }
- public function getRepresentativeLastName(): string
- {
- return $this->representativeLastName;
- }
- public function setRepresentativeLastName(string $representativeLastName): self
- {
- $this->representativeLastName = $representativeLastName;
- return $this;
- }
- public function getRepresentativeFunction(): string
- {
- return $this->representativeFunction;
- }
- public function setRepresentativeFunction(string $representativeFunction): self
- {
- $this->representativeFunction = $representativeFunction;
- return $this;
- }
- public function getRepresentativeEmail(): string
- {
- return $this->representativeEmail;
- }
- public function setRepresentativeEmail(string $representativeEmail): self
- {
- $this->representativeEmail = $representativeEmail;
- return $this;
- }
- public function getRepresentativePhone(): string
- {
- return $this->representativePhone;
- }
- public function setRepresentativePhone(string $representativePhone): self
- {
- $this->representativePhone = $representativePhone;
- return $this;
- }
- public function getTermsAccepted(): bool
- {
- return $this->termsAccepted;
- }
- public function setTermsAccepted(bool $termsAccepted): self
- {
- $this->termsAccepted = $termsAccepted;
- return $this;
- }
- public function getLegalRepresentative(): bool
- {
- return $this->legalRepresentative;
- }
- public function setLegalRepresentative(bool $legalRepresentative): self
- {
- $this->legalRepresentative = $legalRepresentative;
- return $this;
- }
- public function getNewsletterSubscription(): bool
- {
- return $this->newsletterSubscription;
- }
- public function setNewsletterSubscription(bool $newsletterSubscription): self
- {
- $this->newsletterSubscription = $newsletterSubscription;
- return $this;
- }
- }
|