2026-01-27 00:24:22 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2026-01-27 16:23:12 +00:00
|
|
|
namespace Core\Mod\Commerce\Console;
|
2026-01-27 00:24:22 +00:00
|
|
|
|
|
|
|
|
use Illuminate\Console\Command;
|
2026-01-27 16:23:12 +00:00
|
|
|
use Core\Mod\Commerce\Services\ReferralService;
|
2026-01-27 00:24:22 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Mature referral commissions that are past their maturation date.
|
|
|
|
|
*
|
|
|
|
|
* Should be run daily via scheduler.
|
|
|
|
|
*/
|
|
|
|
|
class MatureReferralCommissions extends Command
|
|
|
|
|
{
|
|
|
|
|
protected $signature = 'commerce:mature-commissions';
|
|
|
|
|
|
|
|
|
|
protected $description = 'Mature referral commissions that are past their maturation date';
|
|
|
|
|
|
|
|
|
|
public function handle(ReferralService $referralService): int
|
|
|
|
|
{
|
|
|
|
|
$count = $referralService->matureReadyCommissions();
|
|
|
|
|
|
|
|
|
|
$this->info("Matured {$count} commissions.");
|
|
|
|
|
|
|
|
|
|
return self::SUCCESS;
|
|
|
|
|
}
|
|
|
|
|
}
|