feat(organisation): add dashboard-stats endpoint

GET /organisations/{organisation}/dashboard-stats returns members,
events (with status breakdown + active count), persons, the first five
members sorted by join date, and the five most recent activity log
entries. Business logic lives in OrganisationDashboardService; access
follows OrganisationPolicy@view.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-17 10:27:37 +02:00
parent 036fb3002f
commit 671e0c9889
5 changed files with 341 additions and 0 deletions

View File

@@ -168,6 +168,7 @@ Route::middleware(['auth:sanctum', 'impersonation'])->group(function () {
// Organisations
Route::apiResource('organisations', OrganisationController::class)
->only(['index', 'show', 'store', 'update']);
Route::get('organisations/{organisation}/dashboard-stats', [OrganisationController::class, 'dashboardStats']);
// Events (nested under organisations)
Route::apiResource('organisations.events', EventController::class)