|
|
@@ -26,6 +26,7 @@ use App\Repository\Core\CountryRepository;
|
|
|
use App\Repository\Organization\OrganizationIdentificationRepository;
|
|
|
use App\Repository\Organization\OrganizationRepository;
|
|
|
use App\Repository\Person\PersonRepository;
|
|
|
+use App\Service\ApiLegacy\ApiLegacyRequestService;
|
|
|
use App\Service\Dolibarr\DolibarrApiService;
|
|
|
use App\Service\Typo3\BindFileService;
|
|
|
use App\Service\Typo3\SubdomainService;
|
|
|
@@ -60,7 +61,8 @@ class OrganizationFactory
|
|
|
private readonly EntityManagerInterface $entityManager,
|
|
|
private readonly PersonRepository $personRepository,
|
|
|
private readonly BindFileService $bindFileService,
|
|
|
- private readonly OrganizationIdentificationRepository $organizationIdentificationRepository
|
|
|
+ private readonly OrganizationIdentificationRepository $organizationIdentificationRepository,
|
|
|
+ private readonly ApiLegacyRequestService $apiLegacyRequestService
|
|
|
) {}
|
|
|
|
|
|
#[Required]
|
|
|
@@ -152,6 +154,15 @@ class OrganizationFactory
|
|
|
$this->logger->warning("Typo3 website creation was not required");
|
|
|
}
|
|
|
|
|
|
+ // Création de l'organisation dans la base adminassos (géré par la V1)
|
|
|
+ try {
|
|
|
+ $this->updateAdminassosDb($organization);
|
|
|
+ } catch (\Throwable $e) {
|
|
|
+ $this->logger->critical("An error happened while updating the adminassos db, please proceed manually.");
|
|
|
+ $this->logger->debug($e);
|
|
|
+ $withError = true;
|
|
|
+ }
|
|
|
+
|
|
|
if ($withError) {
|
|
|
$organizationCreationRequest->setStatus(OrganizationCreationRequest::STATUS_OK_WITH_ERRORS);
|
|
|
$this->logger->warning("-- Operation ended with errors, check the logs for more information --");
|
|
|
@@ -680,12 +691,6 @@ class OrganizationFactory
|
|
|
return $subdomain;
|
|
|
}
|
|
|
|
|
|
- protected function updateAdminAssosDb(OrganizationCreationRequest $organizationCreationRequest)
|
|
|
- {
|
|
|
- // oa_assos
|
|
|
- //
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* Créé le site Typo3 et retourne l'id de la page racine du site nouvellement créé, ou null en cas d'erreur
|
|
|
*
|
|
|
@@ -714,6 +719,14 @@ class OrganizationFactory
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ protected function updateAdminassosDb(Organization $organization): void
|
|
|
+ {
|
|
|
+ $this->apiLegacyRequestService->post(
|
|
|
+ '/_internal/secure/organization/creation-event',
|
|
|
+ [ 'organizationId' => $organization->getId() ]
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Normalise la chaine comme sont normalisées les champs de l'entité OrganizationIdentification
|
|
|
*
|