| 12345678910111213141516171819 |
- <?php
- namespace App\Console\Commands;
- use App\Services\RewardBaseSyncService;
- use Illuminate\Console\Command;
- class SyncRewardBases extends Command
- {
- protected $signature = 'rewards:sync-bases {--from= : New York start date Y-m-d for backfill} {--to= : New York end date Y-m-d for backfill}';
- protected $description = 'Refresh unpaid rebate/backflow rows from per-category bet facts; never touches paid rows or wallets';
- public function handle(RewardBaseSyncService $service): int
- {
- $result = $service->run($this->option('from') ?: null, $this->option('to') ?: null);
- $this->line(json_encode($result, JSON_UNESCAPED_UNICODE));
- return $result['failed'] > 0 ? self::FAILURE : self::SUCCESS;
- }
- }
|