2026-02-16 09:29:37 +00:00
|
|
|
<?php
|
2026-06-10 18:25:05 +03:30
|
|
|
|
2026-02-16 09:29:37 +00:00
|
|
|
namespace App\Console\Commands;
|
|
|
|
|
|
2026-06-10 18:25:05 +03:30
|
|
|
use App\Services\ProductPriceSyncService;
|
2026-02-16 09:29:37 +00:00
|
|
|
use Illuminate\Console\Command;
|
|
|
|
|
|
|
|
|
|
class UpdateProductStatus extends Command
|
|
|
|
|
{
|
|
|
|
|
protected $signature = 'product:update-status';
|
|
|
|
|
|
|
|
|
|
protected $description = 'Updates product prices and auto closes/opens products';
|
|
|
|
|
|
2026-06-10 18:25:05 +03:30
|
|
|
public function handle(ProductPriceSyncService $syncService): int
|
2026-02-16 09:29:37 +00:00
|
|
|
{
|
2026-06-10 18:25:05 +03:30
|
|
|
$syncService->syncAll();
|
2026-02-16 09:29:37 +00:00
|
|
|
$this->info('Product statuses updated successfully.');
|
2026-06-10 18:25:05 +03:30
|
|
|
|
|
|
|
|
return self::SUCCESS;
|
2026-02-16 09:29:37 +00:00
|
|
|
}
|
|
|
|
|
}
|