Files
boursecu_server/app/Console/Commands/PrunePriceSnapshotsCommand.php
T

22 lines
516 B
PHP
Raw Normal View History

2026-06-13 17:35:40 +03:30
<?php
namespace App\Console\Commands;
use App\Services\PriceSnapshotService;
use Illuminate\Console\Command;
class PrunePriceSnapshotsCommand extends Command
{
protected $signature = 'prices:prune';
protected $description = 'Downsample and prune price history (daily at midnight)';
public function handle(PriceSnapshotService $snapshots): int
{
$stats = $snapshots->pruneHistory();
$this->info(json_encode($stats, JSON_UNESCAPED_UNICODE));
return self::SUCCESS;
}
}