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
@@ -12,7 +12,9 @@ use RuntimeException;
class ReimbursementBatchService
{
public function __construct(private ReimbursementLookupService $lookupService) {}
public function __construct(private ReimbursementLookupService $lookupService)
{
}
public function createBatch(?string $title, int $userId, string $schoolYear, string $semester): array
{
@@ -29,7 +31,7 @@ class ReimbursementBatchService
'yearly_batch_number' => $sequence,
]);
$label = trim((string) $batch->title) !== '' ? (string) $batch->title : ('Batch #'.$sequence);
$label = trim((string) $batch->title) !== '' ? (string) $batch->title : ('Batch #' . $sequence);
if (trim((string) $batch->title) === '') {
$batch->title = $label;
$batch->save();
@@ -45,7 +47,7 @@ class ReimbursementBatchService
public function lockBatch(int $batchId, int $userId, string $schoolYear, string $semester): void
{
$batch = ReimbursementBatch::query()->find($batchId);
if (! $batch || strtolower((string) $batch->status) !== ReimbursementBatch::STATUS_OPEN) {
if (!$batch || strtolower((string) $batch->status) !== ReimbursementBatch::STATUS_OPEN) {
throw new RuntimeException('Batch not found or already closed.');
}
@@ -58,7 +60,7 @@ class ReimbursementBatchService
$adminIds = array_values(array_unique($adminRows->pluck('admin_id')->map(fn ($id) => (int) $id)->all()));
$requiredAdmins = array_values(array_filter($adminIds, static fn ($adminId) => $adminId > 0));
if (! empty($requiredAdmins)) {
if (!empty($requiredAdmins)) {
$uploadedAdminIds = ReimbursementBatchAdminFile::query()
->where('batch_id', $batchId)
->whereIn('admin_id', $requiredAdmins)
@@ -69,7 +71,7 @@ class ReimbursementBatchService
->all();
foreach ($requiredAdmins as $adminId) {
if (! in_array($adminId, $uploadedAdminIds, true)) {
if (!in_array($adminId, $uploadedAdminIds, true)) {
throw new RuntimeException('All admin sections must have a check file before submitting the batch.');
}
}
@@ -92,7 +94,7 @@ class ReimbursementBatchService
$reimbId = $item->batch_reimb_id ?: ($item->expense_reimb_id ?: $this->lookupService->findReimbursementIdForExpense($expenseId));
if (! $reimbId) {
if (!$reimbId) {
$payload = [
'expense_id' => $expenseId,
'amount' => (float) ($item->amount ?? 0),
@@ -120,7 +122,7 @@ class ReimbursementBatchService
]);
Expense::query()->where('id', $expenseId)->update(['reimbursement_id' => $reimbId]);
if (! empty($item->batch_item_id)) {
if (!empty($item->batch_item_id)) {
ReimbursementBatchItem::query()->where('id', (int) $item->batch_item_id)->update([
'reimbursement_id' => $reimbId,
]);