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,39 @@
<?php
namespace Tests\Unit\Services\Events;
use App\Services\Events\EventStudentChargeService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
use Tests\TestCase;
class EventStudentChargeServiceTest extends TestCase
{
use RefreshDatabase;
public function test_list_students_with_charges(): void
{
DB::table('students')->insert([
'id' => 1,
'parent_id' => 10,
'firstname' => 'Kid',
'lastname' => 'One',
]);
DB::table('event_charges')->insert([
'id' => 1,
'event_id' => 1,
'parent_id' => 10,
'student_id' => 1,
'participation' => 'yes',
'charged' => 10,
'school_year' => '2025-2026',
'semester' => 'Fall',
]);
$service = new EventStudentChargeService();
$rows = $service->listStudentsWithCharges(10, '2025-2026', 'Fall');
$this->assertTrue($rows[0]['charged']);
}
}