Deploy Ladill Transfer / deploy (push) Successful in 44s
Recipients can be emailed the download link immediately and at optional reminders (7/3/1 days before unavailable, or when grace period starts). Co-authored-by: Cursor <cursoragent@cursor.com>
31 lines
941 B
PHP
31 lines
941 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use App\Services\Transfer\TransferBillingService;
|
|
use App\Services\Transfer\TransferRecipientMailService;
|
|
use Illuminate\Console\Command;
|
|
|
|
class ProcessTransferBillingCommand extends Command
|
|
{
|
|
protected $signature = 'transfer:process-billing';
|
|
|
|
protected $description = 'Renew monthly transfer storage billing and delete transfers past the grace period';
|
|
|
|
public function handle(TransferBillingService $billing, TransferRecipientMailService $recipients): int
|
|
{
|
|
$result = $billing->processDueRenewals();
|
|
$recipientEmails = $recipients->processDueMilestones();
|
|
|
|
$this->info(sprintf(
|
|
'Transfer billing: %d renewed, %d entered grace, %d deleted, %d recipient reminders sent.',
|
|
$result['renewed'],
|
|
$result['graced'],
|
|
$result['deleted'],
|
|
$recipientEmails,
|
|
));
|
|
|
|
return self::SUCCESS;
|
|
}
|
|
}
|