Add next_event to Lecturer API responses and tests

-  Extend `withDetails` flag in Lecturer API to include `next_event` (date of the next course event or null).
- 🧪 Update feature tests to assert presence and validity of `next_event` in responses.
This commit is contained in:
HolgerHatGarKeineNode
2026-06-16 23:37:15 +02:00
parent ffcee850ca
commit a051188907
2 changed files with 7 additions and 5 deletions
@@ -93,8 +93,9 @@ it('returns all lecturers with details on GET /api/lecturers?withDetails', funct
$first = collect($response->json())->firstWhere('id', $lecturers->first()->id);
expect($first)
->toHaveKeys(['id', 'name', 'subtitle', 'image', 'future_events_count'])
->and($first['future_events_count'])->toBe(2);
->toHaveKeys(['id', 'name', 'subtitle', 'image', 'future_events_count', 'next_event'])
->and($first['future_events_count'])->toBe(2)
->and($first['next_event'])->not->toBeNull();
});
it('shows a lecturer profile with courses on GET /api/lecturers/{lecturer}', function () {