add refund and event logic

This commit is contained in:
root
2026-03-10 23:12:49 -04:00
parent ba1206e314
commit f6be51576c
67 changed files with 4808 additions and 1000 deletions
@@ -0,0 +1,49 @@
<?php
namespace Tests\Unit\Services\Refunds;
use App\Services\Refunds\RefundQueryService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
use Tests\TestCase;
class RefundQueryServiceTest extends TestCase
{
use RefreshDatabase;
public function test_list_filters_by_status(): void
{
DB::table('refunds')->insert([
[
'id' => 1,
'parent_id' => 10,
'school_year' => '2025-2026',
'semester' => 'Fall',
'refund_amount' => 10,
'refund_paid_amount' => 0,
'status' => 'Pending',
'request' => 'overpayment',
'created_at' => now(),
'updated_at' => now(),
],
[
'id' => 2,
'parent_id' => 11,
'school_year' => '2025-2026',
'semester' => 'Fall',
'refund_amount' => 20,
'refund_paid_amount' => 0,
'status' => 'Approved',
'request' => 'overpayment',
'created_at' => now(),
'updated_at' => now(),
],
]);
$service = new RefundQueryService();
$result = $service->list(['status' => 'Approved', 'per_page' => 10, 'page' => 1]);
$this->assertSame(1, $result['pagination']['total']);
$this->assertSame('Approved', $result['refunds']->items()[0]->status);
}
}