fix tests

This commit is contained in:
root
2026-06-11 11:46:12 -04:00
parent c91fa2ce4d
commit 5ead80fdc7
1489 changed files with 11349 additions and 10305 deletions
+9 -9
View File
@@ -16,7 +16,7 @@ class RefundQueryService
$sortDir = strtolower((string) ($filters['sort_dir'] ?? 'desc')) === 'asc' ? 'asc' : 'desc';
$allowedSorts = ['created_at', 'updated_at', 'refund_amount', 'status', 'parent_id', 'invoice_id'];
if (!in_array($sortBy, $allowedSorts, true)) {
if (! in_array($sortBy, $allowedSorts, true)) {
$sortBy = 'created_at';
}
@@ -29,25 +29,25 @@ class RefundQueryService
->leftJoin('users as parents', 'parents.id', '=', 'refunds.parent_id')
->leftJoin('users as approvers', 'approvers.id', '=', 'refunds.approved_by');
if (!empty($filters['status'])) {
if (! empty($filters['status'])) {
$query->where('refunds.status', $filters['status']);
}
if (!empty($filters['request'])) {
if (! empty($filters['request'])) {
$query->where('refunds.request', $filters['request']);
}
if (!empty($filters['parent_id'])) {
if (! empty($filters['parent_id'])) {
$query->where('refunds.parent_id', (int) $filters['parent_id']);
}
if (!empty($filters['invoice_id'])) {
if (! empty($filters['invoice_id'])) {
$query->where('refunds.invoice_id', (int) $filters['invoice_id']);
}
if (!empty($filters['school_year'])) {
if (! empty($filters['school_year'])) {
$query->where('refunds.school_year', (string) $filters['school_year']);
}
if (!empty($filters['semester'])) {
if (! empty($filters['semester'])) {
$query->where('refunds.semester', (string) $filters['semester']);
}
if (!empty($filters['q'])) {
if (! empty($filters['q'])) {
$term = trim((string) $filters['q']);
$query->where(function ($where) use ($term) {
$where->where('refunds.reason', 'like', "%{$term}%")
@@ -57,7 +57,7 @@ class RefundQueryService
});
}
$paginator = $query->orderBy('refunds.' . $sortBy, $sortDir)
$paginator = $query->orderBy('refunds.'.$sortBy, $sortDir)
->paginate($perPage, ['*'], 'page', $page);
return [