. */ namespace SP\Domain\Import\Services; use SP\Core\Application; use SP\Domain\Common\Ports\Repository; use SP\Domain\Common\Services\Service; use SP\Domain\Common\Services\ServiceException; use SP\Domain\Import\Dtos\ImportParamsDto; use SP\Domain\Import\Ports\ImportService; use SP\Domain\Import\Ports\ImportStrategyService; use SP\Domain\Import\Ports\ItemsImportService; /** * Import assets from CSV or XML files */ final class Import extends Service implements ImportService { public function __construct( Application $application, private readonly ImportStrategyService $importStrategy, private readonly Repository $repository ) { parent::__construct($application); } /** * Iniciar la importación de cuentas. * * @param ImportParamsDto $importParams * @return ItemsImportService * @throws ServiceException */ public function doImport(ImportParamsDto $importParams): ItemsImportService { set_time_limit(0); return $this->repository->transactionAware( fn(): ItemsImportService => $this->importStrategy->buildImport($importParams)->doImport($importParams), $this ); } }