fix gitlab tests

This commit is contained in:
root
2026-06-09 02:32:58 -04:00
parent 20a0b6c4e5
commit 6def9993da
1489 changed files with 10449 additions and 11356 deletions
@@ -14,12 +14,14 @@ use DateTimeZone;
class PaymentTestNotificationService
{
public function __construct(private EmailService $emailService) {}
public function __construct(private EmailService $emailService)
{
}
public function send(string $email, string $type = 'no_payment'): array
{
$email = trim($email);
if ($email === '' || ! filter_var($email, FILTER_VALIDATE_EMAIL)) {
if ($email === '' || !filter_var($email, FILTER_VALIDATE_EMAIL)) {
return ['ok' => false, 'message' => 'Invalid email address.'];
}
@@ -51,11 +53,11 @@ class PaymentTestNotificationService
$ccEmail = $this->findSecondaryGuardianEmail($parentId, $email);
$parentName = $user ? trim(($user->firstname ?? '').' '.($user->lastname ?? '')) : '';
$parentName = $user ? trim(($user->firstname ?? '') . ' ' . ($user->lastname ?? '')) : '';
$monthYear = $now->format('F Y');
$subject = sprintf('Monthly Tuition Reminder — %s', $schoolYear);
$greeting = $parentName !== '' ? "Dear {$parentName}," : 'Dear Parent,';
$balanceFmt = '$'.number_format($totalBalance, 2);
$balanceFmt = '$' . number_format($totalBalance, 2);
$intro = ($type === 'no_payment')
? "We noticed there are outstanding tuition charges for {$schoolYear} but no payment has been recorded yet."
: "This is your monthly installment reminder for {$schoolYear}.";
@@ -77,11 +79,11 @@ class PaymentTestNotificationService
</div>
HTML;
$bodyHtml .= '<ul>'
."<li><strong>Remaining installments:</strong> {$installmentInfo['remaining_installments']}</li>"
."<li><strong>Suggested installment this month:</strong> {$installmentInfo['installment_due_fmt']}</li>"
."<li><strong>Maximum installments available:</strong> {$installmentInfo['max_installments']}</li>"
.'</ul>';
$bodyHtml .= "<ul>"
. "<li><strong>Remaining installments:</strong> {$installmentInfo['remaining_installments']}</li>"
. "<li><strong>Suggested installment this month:</strong> {$installmentInfo['installment_due_fmt']}</li>"
. "<li><strong>Maximum installments available:</strong> {$installmentInfo['max_installments']}</li>"
. "</ul>";
$body = MailHtml::document('Monthly Tuition Reminder', $bodyHtml);
@@ -166,7 +168,7 @@ class PaymentTestNotificationService
'remaining_installments' => $remainingInstallments,
'max_installments' => $maxInstallments,
'installment_due' => round($installmentDue, 2),
'installment_due_fmt' => '$'.number_format($installmentDue, 2),
'installment_due_fmt' => '$' . number_format($installmentDue, 2),
];
}
@@ -177,7 +179,7 @@ class PaymentTestNotificationService
}
$row = FamilyGuardian::query()->where('user_id', $parentId)->first();
if (! $row || empty($row->family_id)) {
if (!$row || empty($row->family_id)) {
return null;
}