Deploy Ladill Transfer / deploy (push) Successful in 1m0s
Send grace-entered and countdown emails to owners alongside recipient grace milestones so unpaid transfers get clear wallet top-up reminders before deletion. Co-authored-by: Cursor <cursoragent@cursor.com>
37 lines
1.1 KiB
PHP
37 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use App\Services\Transfer\TransferBillingService;
|
|
use App\Services\Transfer\TransferOwnerMailService;
|
|
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,
|
|
TransferOwnerMailService $owners,
|
|
): int {
|
|
$result = $billing->processDueRenewals();
|
|
$recipientEmails = $recipients->processDueMilestones();
|
|
$ownerEmails = $owners->processGraceReminders();
|
|
|
|
$this->info(sprintf(
|
|
'Transfer billing: %d renewed, %d entered grace, %d deleted, %d recipient reminders, %d owner grace reminders.',
|
|
$result['renewed'],
|
|
$result['graced'],
|
|
$result['deleted'],
|
|
$recipientEmails,
|
|
$ownerEmails,
|
|
));
|
|
|
|
return self::SUCCESS;
|
|
}
|
|
}
|