|
@@ -0,0 +1,180 @@
|
|
|
|
|
+<?php
|
|
|
|
|
+declare(strict_types=1);
|
|
|
|
|
+
|
|
|
|
|
+namespace App\ApiResources\Dolibarr;
|
|
|
|
|
+
|
|
|
|
|
+use ApiPlatform\Core\Annotation\ApiProperty;
|
|
|
|
|
+use ApiPlatform\Core\Annotation\ApiResource;
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * Données de l'organization retournées par l'API Dolibarr
|
|
|
|
|
+ *
|
|
|
|
|
+ * @ApiResource(
|
|
|
|
|
+ * compositeIdentifier=false,
|
|
|
|
|
+ * itemOperations={
|
|
|
|
|
+ * "get"={
|
|
|
|
|
+ * "method"="GET",
|
|
|
|
|
+ * "path"="/dolibarr/account/{organizationId}"
|
|
|
|
|
+ * }
|
|
|
|
|
+ * }
|
|
|
|
|
+ * )
|
|
|
|
|
+ */
|
|
|
|
|
+class DolibarrAccount
|
|
|
|
|
+{
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @var int
|
|
|
|
|
+ * @ApiProperty(identifier=true)
|
|
|
|
|
+ */
|
|
|
|
|
+ private int $organizationId;
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Dolibarr societies pk
|
|
|
|
|
+ * @var int
|
|
|
|
|
+ */
|
|
|
|
|
+ private int $socId;
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Opentalent client ref
|
|
|
|
|
+ * @var string
|
|
|
|
|
+ */
|
|
|
|
|
+ private string $clientNumber;
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Opentalent product owned
|
|
|
|
|
+ * @var string
|
|
|
|
|
+ */
|
|
|
|
|
+ private string $product;
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Services currently actives
|
|
|
|
|
+ * @var array
|
|
|
|
|
+ */
|
|
|
|
|
+ private array $services;
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Sms credit remaining
|
|
|
|
|
+ * @var string
|
|
|
|
|
+ */
|
|
|
|
|
+ private string $smsCredit;
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Last bills
|
|
|
|
|
+ * @var array
|
|
|
|
|
+ */
|
|
|
|
|
+ private array $bills;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @return int
|
|
|
|
|
+ */
|
|
|
|
|
+ public function getOrganizationId(): int
|
|
|
|
|
+ {
|
|
|
|
|
+ return $this->organizationId;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @param int $organizationId
|
|
|
|
|
+ */
|
|
|
|
|
+ public function setOrganizationId(int $organizationId): void
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->organizationId = $organizationId;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @return int
|
|
|
|
|
+ */
|
|
|
|
|
+ public function getSocId(): int
|
|
|
|
|
+ {
|
|
|
|
|
+ return $this->socId;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @param int $socId
|
|
|
|
|
+ */
|
|
|
|
|
+ public function setSocId(int $socId): void
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->socId = $socId;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @return string
|
|
|
|
|
+ */
|
|
|
|
|
+ public function getClientNumber(): string
|
|
|
|
|
+ {
|
|
|
|
|
+ return $this->clientNumber;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @param string $clientNumber
|
|
|
|
|
+ */
|
|
|
|
|
+ public function setClientNumber(string $clientNumber): void
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->clientNumber = $clientNumber;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @return string
|
|
|
|
|
+ */
|
|
|
|
|
+ public function getProduct(): string
|
|
|
|
|
+ {
|
|
|
|
|
+ return $this->product;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @param string $product
|
|
|
|
|
+ */
|
|
|
|
|
+ public function setProduct(string $product): void
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->product = $product;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @return array
|
|
|
|
|
+ */
|
|
|
|
|
+ public function getServices(): array
|
|
|
|
|
+ {
|
|
|
|
|
+ return $this->services;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @param array $services
|
|
|
|
|
+ */
|
|
|
|
|
+ public function setServices(array $services): void
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->services = $services;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @return string
|
|
|
|
|
+ */
|
|
|
|
|
+ public function getSmsCredit(): string
|
|
|
|
|
+ {
|
|
|
|
|
+ return $this->smsCredit;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @param string $smsCredit
|
|
|
|
|
+ */
|
|
|
|
|
+ public function setSmsCredit(string $smsCredit): void
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->smsCredit = $smsCredit;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @return array
|
|
|
|
|
+ */
|
|
|
|
|
+ public function getBills(): array
|
|
|
|
|
+ {
|
|
|
|
|
+ return $this->bills;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @param array $bills
|
|
|
|
|
+ */
|
|
|
|
|
+ public function setBills(array $bills): void
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->bills = $bills;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @param DolibarrBill $bill
|
|
|
|
|
+ */
|
|
|
|
|
+ public function addBill(DolibarrBill $bill): void
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->bills[] = $bill;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+}
|