Updated command signatures for MailTest, SyncProductIncosCommand, and UserCreate to maintain consistency in naming conventions.
38 lines
1.2 KiB
PHP
38 lines
1.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use App\Actions\ProductIncos\SynchronizeProductIncosWithArcadiaApi;
|
|
use App\Contracts\ActionInputEmpty;
|
|
use App\Contracts\Executor;
|
|
use App\Jobs\FetchAndUpsertArcadiaProductIncos;
|
|
use Illuminate\Console\Attributes\Description;
|
|
use Illuminate\Console\Attributes\Signature;
|
|
use Illuminate\Console\Command;
|
|
|
|
#[Description('Synchronize all product INCO sheets with Arcadia API')]
|
|
#[Signature('uwil:incos:sync {--queue : Dispatch the synchronization job to the queue}')]
|
|
class SyncProductIncosCommand extends Command
|
|
{
|
|
public function handle(
|
|
Executor $executor,
|
|
SynchronizeProductIncosWithArcadiaApi $action
|
|
): int {
|
|
if ($this->option('queue')) {
|
|
$this->info('Dispatching FetchAndUpsertArcadiaProductIncos job to queue...');
|
|
FetchAndUpsertArcadiaProductIncos::dispatch();
|
|
$this->info('Job dispatched.');
|
|
|
|
return self::SUCCESS;
|
|
}
|
|
|
|
$this->info('Starting synchronous INCO synchronization with Arcadia API...');
|
|
/** @var int $count */
|
|
$count = $executor->execute($action, new ActionInputEmpty());
|
|
$this->info("Successfully synchronized {$count} INCO sheets.");
|
|
|
|
return self::SUCCESS;
|
|
}
|
|
}
|