|
|
@@ -26,6 +26,8 @@ use App\Service\Utils\DatesUtils;
|
|
|
use App\Service\Utils\UrlBuilder;
|
|
|
use Doctrine\DBAL\Exception;
|
|
|
use Doctrine\ORM\EntityManagerInterface;
|
|
|
+use Doctrine\ORM\Exception\ORMException;
|
|
|
+use Doctrine\ORM\OptimisticLockException;
|
|
|
use JsonException;
|
|
|
use libphonenumber\PhoneNumberUtil;
|
|
|
use Psr\Log\LoggerInterface;
|
|
|
@@ -39,6 +41,14 @@ use Symfony\Component\Uid\Uuid;
|
|
|
|
|
|
/**
|
|
|
* Service for managing shop requests.
|
|
|
+ *
|
|
|
+ * This service handles various shop-related operations.
|
|
|
+ * It provides functionality for:
|
|
|
+ * - Registering new shop requests
|
|
|
+ * - Validating and processing shop requests
|
|
|
+ * - Creating organizations based on trial requests
|
|
|
+ * - Starting premium trials for organizations
|
|
|
+ * - Generating subdomains from structure names
|
|
|
*/
|
|
|
class ShopService
|
|
|
{
|
|
|
@@ -223,7 +233,17 @@ class ShopService
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- protected function handleNewStructureArtistPremiumTrialRequest(string $token): void
|
|
|
+ /**
|
|
|
+ * Handles the processing of a new structure artist premium trial request.
|
|
|
+ *
|
|
|
+ * @param string $token The token identifying the shop request
|
|
|
+ * @return void
|
|
|
+ * @throws Exception
|
|
|
+ * @throws JsonException
|
|
|
+ * @throws ORMException
|
|
|
+ * @throws OptimisticLockException
|
|
|
+ */
|
|
|
+ public function handleNewStructureArtistPremiumTrialRequest(string $token): void
|
|
|
{
|
|
|
// Retrieve the ShopRequest entity using its token
|
|
|
$shopRequest = $this->entityManager->find(ShopRequest::class, $token);
|
|
|
@@ -249,6 +269,12 @@ class ShopService
|
|
|
$this->logger->info('Successfully processed NewStructureArtistPremiumTrial for token: ' . $token);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Creates a new organization based on a trial request.
|
|
|
+ *
|
|
|
+ * @param NewStructureArtistPremiumTrialRequest $trialRequest The trial request containing organization data
|
|
|
+ * @return Organization The created organization
|
|
|
+ */
|
|
|
protected function createOrganization(NewStructureArtistPremiumTrialRequest $trialRequest): Organization
|
|
|
{
|
|
|
// Generate an OrganizationCreationRequest object
|
|
|
@@ -281,6 +307,9 @@ class ShopService
|
|
|
|
|
|
/**
|
|
|
* Generate a subdomain from a structure name.
|
|
|
+ *
|
|
|
+ * @param string $name The structure name to generate a subdomain from
|
|
|
+ * @return string The generated subdomain
|
|
|
*/
|
|
|
protected function generateSubdomain(string $name): string
|
|
|
{
|
|
|
@@ -317,6 +346,8 @@ class ShopService
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * Vérifie la validité d'une requête d'essai artist premium pour une nouvelle structure
|
|
|
+ *
|
|
|
* @param NewStructureArtistPremiumTrialRequest $request
|
|
|
* @return void
|
|
|
*/
|