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,38 @@
<?php
namespace Tests\Unit\Services\Refunds;
use App\Services\Refunds\RefundDecisionService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
use Tests\TestCase;
class RefundDecisionServiceTest extends TestCase
{
use RefreshDatabase;
public function test_approve_updates_refund_status(): void
{
DB::table('refunds')->insert([
'id' => 1,
'parent_id' => 10,
'school_year' => '2025-2026',
'semester' => 'Fall',
'refund_amount' => 50,
'refund_paid_amount' => 0,
'status' => 'Pending',
'request' => 'overpayment',
'created_at' => now(),
'updated_at' => now(),
]);
$service = new RefundDecisionService();
$result = $service->approve(1, 2);
$this->assertTrue($result['ok']);
$this->assertDatabaseHas('refunds', [
'id' => 1,
'status' => 'Approved',
]);
}
}