| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275 |
- <?php
- namespace App\ApiResources\Organization;
- use ApiPlatform\Metadata\ApiProperty;
- use ApiPlatform\Metadata\ApiResource;
- use ApiPlatform\Metadata\Post;
- use App\Enum\Organization\LegalEnum;
- use App\Enum\Organization\PrincipalTypeEnum;
- use App\Enum\Organization\SettingsProductEnum;
- use App\State\Processor\Organization\OrganizationCreationRequestProcessor;
- #[ApiResource(
- operations: [
- new Post(
- uriTemplate: '/internal/organization/create',
- security: 'user.getSuperAdminAccess()'
- ),
- ],
- processor: OrganizationCreationRequestProcessor::class
- )]
- class OrganizationCreationRequest
- {
- /**
- * Id 'bidon' ajouté par défaut pour permettre la construction
- * de l'IRI par api platform.
- */
- #[ApiProperty(identifier: true)]
- private int $id = 0;
- private string $name;
- private LegalEnum $legalStatus;
- private SettingsProductEnum $product;
- private string $streetAddress1;
- private ?string $streetAddress2 = null;
- private ?string $streetAddress3 = null;
- private string $postalCode;
- private string $city;
- private int $countryId = 72; // France's id
- private string $phoneNumber;
- private string $email;
- private string $subdomain;
- private int $parentId;
- private int $networkId;
- private PrincipalTypeEnum $principalType;
- private ?OrganizationMemberCreationRequest $president = null;
- private ?OrganizationMemberCreationRequest $director = null;
- private bool $createWebsite = true;
- public function getId(): int
- {
- return $this->id;
- }
- public function setId(int $id): self
- {
- $this->id = $id;
- return $this;
- }
- public function getName(): string
- {
- return $this->name;
- }
- public function setName(string $name): self
- {
- $this->name = $name;
- return $this;
- }
- public function getLegalStatus(): LegalEnum
- {
- return $this->legalStatus;
- }
- public function setLegalStatus(LegalEnum $legalStatus): self
- {
- $this->legalStatus = $legalStatus;
- return $this;
- }
- public function getProduct(): SettingsProductEnum
- {
- return $this->product;
- }
- public function setProduct(SettingsProductEnum $product): self
- {
- $this->product = $product;
- return $this;
- }
- public function getStreetAddress1(): string
- {
- return $this->streetAddress1;
- }
- public function setStreetAddress1(string $streetAddress1): self
- {
- $this->streetAddress1 = $streetAddress1;
- return $this;
- }
- public function getStreetAddress2(): ?string
- {
- return $this->streetAddress2;
- }
- public function setStreetAddress2(?string $streetAddress2): self
- {
- $this->streetAddress2 = $streetAddress2;
- return $this;
- }
- public function getStreetAddress3(): ?string
- {
- return $this->streetAddress3;
- }
- public function setStreetAddress3(?string $streetAddress3): self
- {
- $this->streetAddress3 = $streetAddress3;
- 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 getCountryId(): int
- {
- return $this->countryId;
- }
- public function setCountryId(int $countryId): self
- {
- $this->countryId = $countryId;
- return $this;
- }
- public function getPhoneNumber(): string
- {
- return $this->phoneNumber;
- }
- public function setPhoneNumber(string $phoneNumber): self
- {
- $this->phoneNumber = $phoneNumber;
- return $this;
- }
- public function getEmail(): string
- {
- return $this->email;
- }
- public function setEmail(string $email): self
- {
- $this->email = $email;
- return $this;
- }
- public function getSubdomain(): string
- {
- return $this->subdomain;
- }
- public function setSubdomain(string $subdomain): self
- {
- $this->subdomain = $subdomain;
- return $this;
- }
- public function getParentId(): int
- {
- return $this->parentId;
- }
- public function setParentId(int $parentId): self
- {
- $this->parentId = $parentId;
- return $this;
- }
- public function getNetworkId(): int
- {
- return $this->networkId;
- }
- public function setNetworkId(int $networkId): self
- {
- $this->networkId = $networkId;
- return $this;
- }
- public function getPrincipalType(): PrincipalTypeEnum
- {
- return $this->principalType;
- }
- public function setPrincipalType(PrincipalTypeEnum $principalType): self
- {
- $this->principalType = $principalType;
- return $this;
- }
- public function getPresident(): ?OrganizationMemberCreationRequest
- {
- return $this->president;
- }
- public function setPresident(?OrganizationMemberCreationRequest $president): self
- {
- $this->president = $president;
- return $this;
- }
- public function getDirector(): ?OrganizationMemberCreationRequest
- {
- return $this->director;
- }
- public function setDirector(?OrganizationMemberCreationRequest $director): self
- {
- $this->director = $director;
- return $this;
- }
- public function getCreateWebsite(): bool
- {
- return $this->createWebsite;
- }
- public function setCreateWebsite(bool $createWebsite): self
- {
- $this->createWebsite = $createWebsite;
- return $this;
- }
- }
|