| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <?php
- namespace App\ApiResources\Organization;
- use ApiPlatform\Metadata\ApiProperty;
- use ApiPlatform\Metadata\ApiResource;
- use ApiPlatform\Metadata\Post;
- use App\State\Processor\Organization\OrganizationDeletionRequestProcessor;
- use Symfony\Component\Validator\Constraints as Assert;
- /**
- * Requête de création d'une nouvelle organisation
- */
- #[ApiResource(
- operations: [
- new Post(
- uriTemplate: '/internal/organization/delete',
- ),
- ],
- processor: OrganizationDeletionRequestProcessor::class
- )]
- class OrganizationDeletionRequest
- {
- /**
- * Id 'bidon' ajouté par défaut pour permettre la construction
- * de l'IRI par api platform.
- */
- #[ApiProperty(identifier: true)]
- private int $id = 0;
- private int $organizationId;
- /**
- * A quelle adresse email notifier la création de l'organisation, ou d'éventuelles erreurs ?
- * @var string|null
- */
- #[Assert\Email(message: 'The email {{ value }} is not a valid email.')]
- private ?string $sendConfirmationEmailAt = null;
- /**
- * For testing purposes only
- * @var bool
- */
- private bool $async = true;
- public function getId(): int
- {
- return $this->id;
- }
- public function setId(int $id): self
- {
- $this->id = $id;
- return $this;
- }
- public function getOrganizationId(): int
- {
- return $this->organizationId;
- }
- public function setOrganizationId(int $organizationId): self
- {
- $this->organizationId = $organizationId;
- return $this;
- }
- public function getSendConfirmationEmailAt(): ?string
- {
- return $this->sendConfirmationEmailAt;
- }
- public function setSendConfirmationEmailAt(?string $sendConfirmationEmailAt): self
- {
- $this->sendConfirmationEmailAt = $sendConfirmationEmailAt;
- return $this;
- }
- public function isAsync(): bool
- {
- return $this->async;
- }
- public function setAsync(bool $async): self
- {
- $this->async = $async;
- return $this;
- }
- }
|