Files
ladill-transfer/app/Console/Commands/ProcessTransferBillingCommand.php
T
isaaccladandCursor c53191a41b
Deploy Ladill Transfer / deploy (push) Successful in 1m0s
Notify transfer owners when files enter grace period.
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>
2026-06-08 12:44:38 +00:00

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;
}
}