add notifications logic and add support of both JWT and Sanctum

This commit is contained in:
root
2026-03-11 01:20:31 -04:00
parent f6be51576c
commit 182036cc41
141 changed files with 8685 additions and 648 deletions
@@ -0,0 +1,33 @@
<?php
namespace Tests\Unit\Services\Notifications;
use App\Services\Notifications\NotificationDeletedService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
use Tests\TestCase;
class NotificationDeletedServiceTest extends TestCase
{
use RefreshDatabase;
public function test_list_returns_deleted_notifications(): void
{
DB::table('notifications')->insert([
'id' => 1,
'title' => 'Deleted',
'message' => 'Message',
'target_group' => 'parent',
'delivery_channels' => json_encode(['in_app']),
'deleted_at' => now(),
'created_at' => now(),
'updated_at' => now(),
]);
$service = new NotificationDeletedService();
$result = $service->list();
$this->assertCount(1, $result['notifications']);
$this->assertSame(1, $result['notifications'][0]['id']);
}
}