5416f809a3
Code-review Task 6 (non-blocking 🟡): HistoricalImportService объявлен final (симметрия с ImportResult, утилитарный сервис без наследования). Ключ ошибки upsert'а переименован 'line' → 'source_crm_id' — поле хранит идентификатор из исходной CRM, а не файловую строку (в отличие от CsvParseResult::errors). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
24 lines
655 B
PHP
24 lines
655 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Services\Import;
|
|
|
|
/**
|
|
* Итог импорта одного файла.
|
|
*/
|
|
final readonly class ImportResult
|
|
{
|
|
/**
|
|
* @param array<string, int> $unknownStatuses статус_ru => количество вхождений
|
|
* @param array<int, array{source_crm_id: int, message: string}> $errors ошибки upsert'а по строке (идентификатор — source_crm_id)
|
|
*/
|
|
public function __construct(
|
|
public int $added,
|
|
public int $updated,
|
|
public int $skipped,
|
|
public array $unknownStatuses,
|
|
public array $errors,
|
|
) {}
|
|
}
|