add controllers, servoices

This commit is contained in:
root
2026-03-09 02:52:13 -04:00
parent c8de5f7edc
commit d76c871cb7
501 changed files with 34439 additions and 21843 deletions
@@ -0,0 +1,40 @@
<?php
namespace Tests\Unit\Services\Payments;
use App\Services\Payments\PaymentNotificationDispatchService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
use Tests\TestCase;
class PaymentNotificationDispatchServiceTest extends TestCase
{
use RefreshDatabase;
public function test_notify_user_creates_notification_records(): void
{
DB::table('configuration')->insert([
['id' => 2001, 'config_key' => 'school_year', 'config_value' => '2025-2026'],
['id' => 2002, 'config_key' => 'semester', 'config_value' => 'Fall'],
]);
$service = new PaymentNotificationDispatchService();
$service->notifyUser(10, 'Payment Reminder', 'Reminder body', ['in_app']);
$this->assertDatabaseHas('notifications', [
'title' => 'Payment Reminder',
'message' => 'Reminder body',
'target_group' => 'user',
'status' => 'sent',
'school_year' => '2025-2026',
'semester' => 'Fall',
]);
$this->assertDatabaseHas('user_notifications', [
'user_id' => 10,
'delivered' => 1,
'school_year' => '2025-2026',
'semester' => 'Fall',
]);
}
}