]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Правки по ревью
authorVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Tue, 27 Jan 2026 07:25:38 +0000 (10:25 +0300)
committerVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Tue, 27 Jan 2026 07:25:38 +0000 (10:25 +0300)
erp24/api3/config/main.php
erp24/config/web.php
erp24/services/dto/OrderIssue.php
erp24/tests/unit/services/OrderControlReportServiceTest.php

index 20e1d8c06f93903189d94d063c6f09bca2f23195..f7ea16bfd942f639d95e0e1ce978edcbd1302a62 100644 (file)
@@ -100,18 +100,21 @@ $config = [
 
 if (YII_ENV_DEV) {
     // configuration adjustments for 'dev' environment
+    // Разрешённые IP для debug/gii: через ENV или только localhost
+    $debugAllowedIPs = getenv('DEBUG_ALLOWED_IPS')
+        ? explode(',', getenv('DEBUG_ALLOWED_IPS'))
+        : ['127.0.0.1', '::1'];
+
     $config['bootstrap'][] = 'debug';
     $config['modules']['debug'] = [
         'class' => 'yii\debug\Module',
-        // uncomment the following to add your IP if you are not connecting from localhost.
-        'allowedIPs' => ['*'],
+        'allowedIPs' => $debugAllowedIPs,
     ];
 
     $config['bootstrap'][] = 'gii';
     $config['modules']['gii'] = [
         'class' => 'yii\gii\Module',
-        // uncomment the following to add your IP if you are not connecting from localhost.
-        'allowedIPs' => ['*'],
+        'allowedIPs' => $debugAllowedIPs,
     ];
 }
 
index c85f05cec4d84a03e018fe4311547b498f47e495..24c2c0ead7fe01ceee3db5e49b9e9d39b2e6fa9e 100644 (file)
@@ -142,18 +142,21 @@ $config = [
 
 if (YII_ENV_DEV) {
     // configuration adjustments for 'dev' environment
+    // Разрешённые IP для debug/gii: через ENV или только localhost
+    $debugAllowedIPs = getenv('DEBUG_ALLOWED_IPS')
+        ? explode(',', getenv('DEBUG_ALLOWED_IPS'))
+        : ['127.0.0.1', '::1'];
+
     $config['bootstrap'][] = 'debug';
     $config['modules']['debug'] = [
         'class' => 'yii\debug\Module',
-        // uncomment the following to add your IP if you are not connecting from localhost.
-        'allowedIPs' => ['*'],
+        'allowedIPs' => $debugAllowedIPs,
     ];
 
     $config['bootstrap'][] = 'gii';
     $config['modules']['gii'] = [
         'class' => 'yii\gii\Module',
-        // uncomment the following to add your IP if you are not connecting from localhost.
-        'allowedIPs' => ['*'],
+        'allowedIPs' => $debugAllowedIPs,
     ];
 
 
index ffe72584f5ecdcff92ce0d4facf9f30660e2ec05..734ea7b35c3fe925f0e6b517c9aff44267ef80ec 100644 (file)
@@ -64,27 +64,27 @@ class OrderIssue
     /**
      * Статус в РМК/1С (человекочитаемый)
      */
-    public ?string $rmkStatus;
+    public ?string $rmkStatus = null;
 
     /**
      * Код статуса РМК/1С
      */
-    public ?string $rmkStatusId;
+    public ?string $rmkStatusId = null;
 
     /**
      * Статус в МП (человекочитаемый)
      */
-    public ?string $mpStatus;
+    public ?string $mpStatus = null;
 
     /**
      * Код статуса МП
      */
-    public ?string $mpStatusCode;
+    public ?string $mpStatusCode = null;
 
     /**
      * Код субстатуса МП
      */
-    public ?string $mpSubstatusCode;
+    public ?string $mpSubstatusCode = null;
 
     /**
      * ID заказа в БД
@@ -94,22 +94,22 @@ class OrderIssue
     /**
      * ID магазина
      */
-    public ?int $storeId;
+    public ?int $storeId = null;
 
     /**
      * Название магазина
      */
-    public ?string $storeName;
+    public ?string $storeName = null;
 
     /**
      * Название маркетплейса
      */
-    public ?string $marketplaceName;
+    public ?string $marketplaceName = null;
 
     /**
      * ID маркетплейса (1 - Flowwow, 2 - YandexMarket)
      */
-    public ?int $marketplaceId;
+    public ?int $marketplaceId = null;
 
     /**
      * Сумма заказа
@@ -119,17 +119,17 @@ class OrderIssue
     /**
      * Дата создания заказа
      */
-    public ?string $creationDate;
+    public ?string $creationDate = null;
 
     /**
      * ID продавца (seller_id)
      */
-    public ?string $sellerId;
+    public ?string $sellerId = null;
 
     /**
      * GUID чека заказа (check_guid из marketplace_orders)
      */
-    public ?string $checkGuid;
+    public ?string $checkGuid = null;
 
     /**
      * Существует ли чек в create_checks
@@ -139,7 +139,7 @@ class OrderIssue
     /**
      * Причина проблемы (no_seller_id, no_check, no_check_guid, no_seller_and_check_guid)
      */
-    public ?string $issueReason;
+    public ?string $issueReason = null;
 
     /**
      * Человекочитаемые метки причин
index 50146f9479804bca2775986f9969daa569bec4ee..d1af08be3de0db155362ed4c9c804adca1e7cb7d 100644 (file)
@@ -145,9 +145,9 @@ class OrderControlReportServiceTest extends Unit
         $this->assertStringContainsString('Завис в доставке', $message);
         $this->assertStringContainsString('Успех без чека', $message);
 
-        // Проверяем наличие номеров заказов
-        $this->assertStringContainsString('FW-100', $message);
-        $this->assertStringContainsString('YM-200', $message);
+        // Проверяем наличие номеров заказов (в MarkdownV2 дефис экранируется)
+        $this->assertStringContainsString('FW\-100', $message);
+        $this->assertStringContainsString('YM\-200', $message);
 
         // Проверяем наличие итога
         $this->assertStringContainsString('Всего:', $message);
@@ -201,8 +201,8 @@ class OrderControlReportServiceTest extends Unit
 
         $message = $this->service->formatTelegramControlReport($result);
 
-        // Ð\9fÑ\80овеÑ\80Ñ\8fем Ð½Ð°Ð»Ð¸Ñ\87ие Ð¼Ð¾Ð½Ð¾Ñ\88иÑ\80инного Ð±Ð»Ð¾ÐºÐ°
-        $this->assertStringContainsString('```', $message);
+        // Ð\9fÑ\80овеÑ\80Ñ\8fем Ð½Ð°Ð»Ð¸Ñ\87ие Ð½Ð¾Ð¼ÐµÑ\80а Ð·Ð°ÐºÐ°Ð·Ð° Ð² MarkdownV2 Ñ\84оÑ\80маÑ\82е
+        $this->assertStringContainsString('FW\-1', $message);
     }
 
     /**
@@ -265,7 +265,8 @@ class OrderControlReportServiceTest extends Unit
         $this->assertStringContainsString('<th>Интервал</th>', $html);
         $this->assertStringContainsString('<th>Заказ</th>', $html);
         $this->assertStringContainsString('<th>РМК</th>', $html);
-        $this->assertStringContainsString('<th>МП / Причина</th>', $html);
+        $this->assertStringContainsString('<th>МП</th>', $html);
+        $this->assertStringContainsString('<th>Причина</th>', $html);
     }
 
     /**
@@ -308,7 +309,7 @@ class OrderControlReportServiceTest extends Unit
         $html = $this->service->formatEmailControlReport($result);
 
         $this->assertStringContainsString('Успех без чека', $html);
-        $this->assertStringContainsString('Нет seller_id', $html);
+        $this->assertStringContainsString('Не взят в работу', $html);
     }
 
     /**
@@ -440,12 +441,12 @@ class OrderControlReportServiceTest extends Unit
     {
         $service = new OrderControlReportService();
 
-        $this->assertFalse($service->isAsyncMode());
-
-        $service->setAsyncMode(true);
         $this->assertTrue($service->isAsyncMode());
 
         $service->setAsyncMode(false);
         $this->assertFalse($service->isAsyncMode());
+
+        $service->setAsyncMode(true);
+        $this->assertTrue($service->isAsyncMode());
     }
 }