Add attendee count helpers and enhance Meetup API responses

-  Introduce `attendeesCount` and `mightAttendeesCount` methods in `MeetupEvent` model for cleaner attendee calculations.
- 🛠️ Refactor API responses to use attendee count helpers in `Meetup` and `MeetupEventController`.
- 🧪 Update tests to validate JSON structure with attendee-related fields (`id`, `attendees`, `might_attendees`).
This commit is contained in:
HolgerHatGarKeineNode
2026-06-15 22:45:28 +02:00
parent 0a1d177fc4
commit c3028b8260
4 changed files with 23 additions and 5 deletions
+3 -1
View File
@@ -80,7 +80,9 @@ it('returns meetup events as JSON on GET /api/meetup-events', function () {
$response = $this->getJson('/api/meetup-events');
$response->assertSuccessful();
$response->assertSuccessful()
// id + Zähler werden für das RSVP im mobilen Slide-In gebraucht.
->assertJsonStructure([['id', 'start', 'attendees', 'might_attendees', 'meetup.name']]);
expect($response->json())->toBeArray()->not->toBeEmpty();
});