| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- <?php
- declare(strict_types=1);
- namespace App\ApiResources\Dolibarr;
- use ApiPlatform\Core\Annotation\ApiProperty;
- use ApiPlatform\Core\Annotation\ApiResource;
- use Symfony\Component\Serializer\Annotation\Groups;
- /**
- * Lines (services) included in a society contract, as retrieved from dolibarr
- */
- #[ApiResource(
- collectionOperations: [
- 'get' => [
- 'method' => 'GET',
- 'path' => '/dolibarr/contract-lines/{contractId}',
- 'requirements' => ['contractId' => '\d+'],
- 'normalization_context' => [
- 'groups' => ['dolibarr_get']
- ]
- ],
- ]
- )]
- class DolibarrContractLine
- {
- #[ApiProperty(identifier: true)]
- #[Groups('dolibarr_get')]
- private int $id;
- /**
- * Id of the contract's line
- */
- #[Groups('dolibarr_get')]
- private int $contractId;
- /**
- * Reference of the contracted service ( = product's reference)
- */
- #[Groups('dolibarr_get')]
- private string $serviceRef;
- /**
- * Label of the contracted service
- */
- #[Groups('dolibarr_get')]
- private string $serviceLabel;
- /**
- * Service active from date ...
- */
- #[Groups('dolibarr_get')]
- private \DateTime $dateStart;
- /**
- * Service active to date ...
- */
- #[Groups('dolibarr_get')]
- private \DateTime $dateEnd;
- public function getId(): int
- {
- return $this->id;
- }
- public function setId(int $id): void
- {
- $this->id = $id;
- }
- public function getContractId(): int
- {
- return $this->contractId;
- }
- public function setContractId(int $contractId): void
- {
- $this->contractId = $contractId;
- }
- public function getServiceRef(): string
- {
- return $this->serviceRef;
- }
- public function setServiceRef(string $serviceRef): void
- {
- $this->serviceRef = $serviceRef;
- }
- public function getServiceLabel(): string
- {
- return $this->serviceLabel;
- }
- public function setServiceLabel(string $serviceLabel): void
- {
- $this->serviceLabel = $serviceLabel;
- }
- public function getDateStart(): \DateTime
- {
- return $this->dateStart;
- }
- public function setDateStart(\DateTime $dateStart): void
- {
- $this->dateStart = $dateStart;
- }
- public function isDateEnd(): \DateTime
- {
- return $this->dateEnd;
- }
- public function setDateEnd(\DateTime $dateEnd): void
- {
- $this->dateEnd = $dateEnd;
- }
- }
|