-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Adding CLI batch command-handler wrapper missed in migration. (d…
- Loading branch information
Showing
3 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
app/api/module/Cli/src/Command/Batch/DuplicateVehicleRemovalCommand.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace Dvsa\Olcs\Cli\Command\Batch; | ||
|
||
use Dvsa\Olcs\Api\Domain\Command\Vehicle\ProcessDuplicateVehicleRemoval; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
||
class DuplicateVehicleRemovalCommand extends AbstractBatchCommand | ||
{ | ||
protected static $defaultName = 'batch:duplicate-vehicle-removal'; | ||
|
||
protected function configure() | ||
{ | ||
$this->setDescription('Duplicate vehicle removal'); | ||
} | ||
|
||
protected function execute(InputInterface $input, OutputInterface $output): int | ||
{ | ||
$this->initializeOutputInterface($output); | ||
|
||
$result = $this->handleCommand([ProcessDuplicateVehicleRemoval::create([])]); | ||
|
||
return $this->outputResult( | ||
$result, | ||
'Successfully removed duplicate vehicles', | ||
'Failed to remove duplicate vehicles' | ||
); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
app/api/test/module/Cli/src/Command/Batch/DuplicateVehicleRemovalCommandTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace Dvsa\OlcsTest\Cli\Command\Batch; | ||
|
||
use Dvsa\Olcs\Api\Domain\Command\Vehicle\ProcessDuplicateVehicleRemoval; | ||
use Dvsa\Olcs\Cli\Command\Batch\DuplicateVehicleRemovalCommand; | ||
|
||
class DuplicateVehicleRemovalCommandTest extends AbstractBatchCommandCases | ||
{ | ||
protected function getCommandClass() | ||
{ | ||
return DuplicateVehicleRemovalCommand::class; | ||
} | ||
|
||
protected function getCommandName() | ||
{ | ||
return 'batch:duplicate-vehicle-removal'; | ||
} | ||
|
||
protected function getCommandDTOs() | ||
{ | ||
return [ | ||
ProcessDuplicateVehicleRemoval::create([]), | ||
]; | ||
} | ||
} |