Implement superadmin audit log for mutations
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-01-02 11:57:49 +01:00
parent 8b4950c79d
commit 412ecbe691
82 changed files with 1766 additions and 192 deletions

View File

@@ -5,6 +5,7 @@ namespace Tests\Feature;
use App\Filament\Clusters\DailyOps\Resources\Photos\Pages\ListPhotos;
use App\Models\Event;
use App\Models\Photo;
use App\Models\SuperAdminActionLog;
use App\Models\Tenant;
use App\Models\User;
use Filament\Actions\Testing\TestAction;
@@ -40,6 +41,10 @@ class PhotoModerationQueueTest extends TestCase
$this->assertSame('Looks good.', $photo->moderation_notes);
$this->assertNotNull($photo->moderated_at);
$this->assertSame($user->id, $photo->moderated_by);
$this->assertTrue(SuperAdminActionLog::query()
->where('action', 'photo.approved')
->where('subject_id', $photo->id)
->exists());
}
public function test_superadmin_can_bulk_reject_pending_photos(): void
@@ -74,6 +79,10 @@ class PhotoModerationQueueTest extends TestCase
$this->assertNotNull($photoB->moderated_at);
$this->assertSame($user->id, $photoA->moderated_by);
$this->assertSame($user->id, $photoB->moderated_by);
$this->assertTrue(SuperAdminActionLog::query()
->where('action', 'photo.rejected')
->whereIn('subject_id', [$photoA->id, $photoB->id])
->count() === 2);
}
private function bootSuperAdminPanel(User $user): void