From 9d452cefa6adf6a2e082dbb0b8113c8b43a118f9 Mon Sep 17 00:00:00 2001 From: sova-ci Date: Tue, 9 Jun 2026 15:42:04 +0300 Subject: [PATCH] chore(#27): sync issues/27 from monorepo (bfeabe5 issues/27: fix date immutable) --- config/services.yaml | 22 ------------ src/Command/UploadFilialsCommand.php | 5 ++- src/Command/UploadPriceCommand.php | 3 +- src/Command/UploadPriceDepCommand.php | 3 +- .../AlwaysValidSmartCaptchaClientService.php | 23 ------------ .../Stub/NoopCalltouchClientService.php | 24 ------------- .../Client/Stub/NoopSmsClientService.php | 35 ------------------- .../XmlFeedGeneratorService.php | 7 ++-- .../XmlFeedGeneratorV1Service.php | 5 ++- 9 files changed, 9 insertions(+), 118 deletions(-) delete mode 100644 src/Service/Client/Stub/AlwaysValidSmartCaptchaClientService.php delete mode 100644 src/Service/Client/Stub/NoopCalltouchClientService.php delete mode 100644 src/Service/Client/Stub/NoopSmsClientService.php diff --git a/config/services.yaml b/config/services.yaml index 81c413c..810547c 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -7,11 +7,6 @@ parameters: app.timezone: 'Europe/Moscow' upload_directory: '%kernel.project_dir%/public/uploads' api.baseurl: '%env(string:API_BASE_URL)%' - api.public_url: '%env(default:api_base_url_default:API_PUBLIC_URL)%' - api_base_url_default: '%env(API_BASE_URL)%' - env(WIDGET_API_URL): '' - widget_api_url: '%env(default:mis_url_default:WIDGET_API_URL)%' - mis_url_default: '%env(MIS_URL)%' mailer_from_email: 'noreply@sova.clinic' mailer_from_name: 'Sova Clinic' mailer_access_token: '' @@ -66,8 +61,6 @@ services: alias: App\Service\Translite\TransliteService App\Command\UploadFilialsCommand: - arguments: - $widgetApiUrl: '%widget_api_url%' tags: ['console.command'] App\Command\UploadDoctorsCommand: @@ -77,13 +70,9 @@ services: tags: ['console.command'] App\Command\UploadPriceDepCommand: - arguments: - $widgetApiUrl: '%widget_api_url%' tags: ['console.command'] App\Command\UploadPriceCommand: - arguments: - $widgetApiUrl: '%widget_api_url%' tags: ['console.command'] App\Command\BitrixUpdateDoctorsCommand: @@ -154,15 +143,6 @@ services: $token: '%env(string:SMSRU_TOKEN)%' $sender: '%env(string:SMSRU_SENDER)%' - App\Service\Client\Interfaces\CalltouchClientServiceInterface: - alias: App\Service\Client\CalltouchClientService - - App\Service\Client\Interfaces\SmartCaptchaClientServiceInterface: - alias: App\Service\Client\SmartCaptchaClientService - - App\Service\Client\Interfaces\SmsClientServiceInterface: - alias: App\Service\Client\SmsruClientService - App\Service\Bitrix\BitrixService: public: true arguments: @@ -192,7 +172,6 @@ services: $specialistService: '@App\Service\Specialist\SpecialistService' $locationService: '@App\Service\Location\LocationService' $filialService: '@App\Service\Filial\FilialService' - $apiPublicUrl: '%api.public_url%' App\Service\XmlFeedGenerator\XmlFeedGeneratorV1Service: arguments: @@ -201,7 +180,6 @@ services: $helperService: '@App\Service\Helper\HelperService' $connection: '@doctrine.dbal.default_connection' $logger: '@logger' - $apiPublicUrl: '%api.public_url%' App\Service\ScheduleCache\ScheduleCacheService: arguments: diff --git a/src/Command/UploadFilialsCommand.php b/src/Command/UploadFilialsCommand.php index d1d1e65..664ff9f 100644 --- a/src/Command/UploadFilialsCommand.php +++ b/src/Command/UploadFilialsCommand.php @@ -23,8 +23,7 @@ class UploadFilialsCommand extends Command private LoggerInterface $logger, private EntityManagerInterface $entityManager, private HttpClientInterface $client, - private TransliteServiceInterface $transliteService, - private string $widgetApiUrl, + private TransliteServiceInterface $transliteService ) { parent::__construct(); @@ -41,7 +40,7 @@ class UploadFilialsCommand extends Command $response = $this->client->request('GET', '/filials/list', [ 'verify_peer' => false, 'verify_host' => false, - 'base_uri' => $this->widgetApiUrl, + 'base_uri' => 'https://widget.sovamed.ru', 'headers' => [ 'Content-Type' => 'application/json', 'User-Agent' => 'sovamed_bot' diff --git a/src/Command/UploadPriceCommand.php b/src/Command/UploadPriceCommand.php index 2435fd0..9b1555a 100644 --- a/src/Command/UploadPriceCommand.php +++ b/src/Command/UploadPriceCommand.php @@ -25,7 +25,6 @@ class UploadPriceCommand extends Command public function __construct( private EntityManagerInterface $entityManager, private HttpClientInterface $client, - private string $widgetApiUrl, ) { parent::__construct(); @@ -145,7 +144,7 @@ class UploadPriceCommand extends Command 'verify_peer' => false, 'verify_host' => false, 'timeout' => 60, - 'base_uri' => $this->widgetApiUrl, + 'base_uri' => 'https://widget.sovamed.ru', 'headers' => [ 'Content-Type' => 'application/json', 'User-Agent' => 'sovamed_bot' diff --git a/src/Command/UploadPriceDepCommand.php b/src/Command/UploadPriceDepCommand.php index acd09a7..defb90e 100644 --- a/src/Command/UploadPriceDepCommand.php +++ b/src/Command/UploadPriceDepCommand.php @@ -20,7 +20,6 @@ class UploadPriceDepCommand extends Command public function __construct( private EntityManagerInterface $entityManager, private HttpClientInterface $client, - private string $widgetApiUrl, ) { parent::__construct(); @@ -35,7 +34,7 @@ class UploadPriceDepCommand extends Command $response = $this->client->request('GET', '/pricelist/departments', [ 'verify_peer' => false, 'verify_host' => false, - 'base_uri' => $this->widgetApiUrl, + 'base_uri' => 'https://widget.sovamed.ru', 'headers' => [ 'Content-Type' => 'application/json', 'User-Agent' => 'sovamed_bot' diff --git a/src/Service/Client/Stub/AlwaysValidSmartCaptchaClientService.php b/src/Service/Client/Stub/AlwaysValidSmartCaptchaClientService.php deleted file mode 100644 index 9d3d9cd..0000000 --- a/src/Service/Client/Stub/AlwaysValidSmartCaptchaClientService.php +++ /dev/null @@ -1,23 +0,0 @@ -logger->info('SmartCaptcha suppressed (noop stub)', [ - 'ip' => $clientIp, - ]); - - return ['status' => 'ok', 'message' => '', 'stub' => true]; - } -} diff --git a/src/Service/Client/Stub/NoopCalltouchClientService.php b/src/Service/Client/Stub/NoopCalltouchClientService.php deleted file mode 100644 index 809df62..0000000 --- a/src/Service/Client/Stub/NoopCalltouchClientService.php +++ /dev/null @@ -1,24 +0,0 @@ -logger->info('Calltouch lead suppressed (noop stub)', [ - 'regionId' => $requests->regionId ?? null, - ]); - - return ['leadId' => 'test-stub', 'stub' => true]; - } -} diff --git a/src/Service/Client/Stub/NoopSmsClientService.php b/src/Service/Client/Stub/NoopSmsClientService.php deleted file mode 100644 index 7956f42..0000000 --- a/src/Service/Client/Stub/NoopSmsClientService.php +++ /dev/null @@ -1,35 +0,0 @@ -logger->info('SMS suppressed (noop stub)', ['to' => $to]); - - return ['status' => 'ok', 'stub' => true]; - } - - public function senders(): array - { - $this->logger->info('SMS senders suppressed (noop stub)'); - - return ['status' => 'ok', 'stub' => true, 'senders' => []]; - } - - public function balance(): array - { - $this->logger->info('SMS balance suppressed (noop stub)'); - - return ['status' => 'ok', 'stub' => true, 'balance' => 0]; - } -} diff --git a/src/Service/XmlFeedGenerator/XmlFeedGeneratorService.php b/src/Service/XmlFeedGenerator/XmlFeedGeneratorService.php index 896db13..dfa7a1d 100644 --- a/src/Service/XmlFeedGenerator/XmlFeedGeneratorService.php +++ b/src/Service/XmlFeedGenerator/XmlFeedGeneratorService.php @@ -28,8 +28,7 @@ class XmlFeedGeneratorService private SpecialistService $specialistService, private LocationService $locationService, private FilialService $filialService, - private SpecialistDcodeDescriptionRepository $specialistDcodeDescriptionRepository, - private string $apiPublicUrl, + private SpecialistDcodeDescriptionRepository $specialistDcodeDescriptionRepository ) { $this->dom = new DOMDocument('1.0', 'UTF-8'); $this->dom->formatOutput = true; @@ -115,7 +114,7 @@ class XmlFeedGeneratorService } }; - return rtrim($this->apiPublicUrl, '/') . "/images/logo/{$picture}"; + return "https://api.sovamed.ru/images/logo/{$picture}"; } private function getSpecialistLink(Specialist $specialist): string @@ -172,7 +171,7 @@ class XmlFeedGeneratorService $location->getDepartment() ); $this->addTextElement($doctorElement, 'description', $doctorDescription ?? ''); - $picture = rtrim($this->apiPublicUrl, '/') . "/specialist/picture/{$id}"; + $picture = "https://api.sovamed.ru/specialist/picture/{$id}"; $this->addTextElement($doctorElement, 'picture', $picture); $this->addTextElement($doctorElement, 'name', $doctor->getName() ?? ''); $this->addTextElement($doctorElement, 'first_name', $doctor->getFullName()['firstName'] ?? ''); diff --git a/src/Service/XmlFeedGenerator/XmlFeedGeneratorV1Service.php b/src/Service/XmlFeedGenerator/XmlFeedGeneratorV1Service.php index d4502f2..dc60a3f 100644 --- a/src/Service/XmlFeedGenerator/XmlFeedGeneratorV1Service.php +++ b/src/Service/XmlFeedGenerator/XmlFeedGeneratorV1Service.php @@ -26,7 +26,6 @@ class XmlFeedGeneratorV1Service private SpecialistService $specialistService, private HelperService $helperService, private Connection $connection, - private string $apiPublicUrl, private ?LoggerInterface $logger = null, ) { $this->dom = new DOMDocument('1.0', 'UTF-8'); @@ -140,7 +139,7 @@ class XmlFeedGeneratorV1Service } }; - return rtrim($this->apiPublicUrl, '/') . "/images/logo/{$picture}"; + return "https://api.sovamed.ru/images/logo/{$picture}"; } private function getSpecialistLink(Specialist $specialist): string @@ -220,7 +219,7 @@ class XmlFeedGeneratorV1Service $this->addTextElement($offerElement, 'url', $url); $this->addTextElement($offerElement, 'set-ids', $specialist->getDcodes()); - $picture = rtrim($this->apiPublicUrl, '/') . "/specialist/picture/{$specialist->getId()}"; + $picture = "https://api.sovamed.ru/specialist/picture/{$specialist->getId()}"; $this->addTextElement($offerElement, 'picture', $picture); $this->addTextElement($offerElement, 'categoryId', '1'); $this->addTextElement($offerElement, 'currencyId', 'RUR');