add test batches

This commit is contained in:
root
2026-06-08 23:45:55 -04:00
parent c792b8be05
commit 8d4d610b82
1480 changed files with 22587 additions and 10762 deletions
+7 -6
View File
@@ -14,7 +14,8 @@ class RefundPolicyService
public function __construct(
private FeeRefundDetailService $refundDetails,
private RefundInvoiceAdjustmentService $invoiceAdjustments
) {}
) {
}
public function processWithdrawalRefund(
int $parentId,
@@ -38,7 +39,7 @@ class RefundPolicyService
->orderByDesc('created_at')
->first();
if (! $invoice) {
if (!$invoice) {
return ['ok' => false, 'error' => 'No invoice found for refund processing.'];
}
@@ -115,14 +116,14 @@ class RefundPolicyService
$refundAmount = (float) ($details['refund_amount'] ?? 0.0);
$debitAmount = (float) ($details['debit_amount'] ?? 0.0);
$eligible = ! empty($details['eligible']);
$eligible = !empty($details['eligible']);
$status = $refundAmount > 0 ? Refund::STATUS_PENDING : Refund::STATUS_REJECTED;
$reason = null;
if ($refundAmount <= 0) {
if (! $eligible) {
if (!$eligible) {
$reason = 'No refund due to late withdrawal.';
} elseif (! empty($details['full_discount'])) {
} elseif (!empty($details['full_discount'])) {
$reason = 'No refund due to full discount.';
} elseif ($debitAmount > 0) {
$reason = 'No refund due; book fee balance remains.';
@@ -188,7 +189,7 @@ class RefundPolicyService
'updated_by' => $actorId,
]);
if (! $created) {
if (!$created) {
return ['ok' => false, 'error' => 'Failed to create refund record.'];
}