mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2026-06-17 16:40:31 +00:00
0a1d177fc4
- 🏷️ Introduce `RsvpStatus` enum for managing attendance states (`attending`, `maybe`, `none`). - ✏️ Add `MeetupEventController` methods for RSVP actions (`rsvpStatus`, `rsvp`) and payload handling. - ✨ Implement RSVP helpers in `MeetupEvent` model for user-specific attendance management. - 🌐 Register RSVP routes for showing and updating attendance in the API. - 🧪 Add feature tests for RSVP actions, covering validation, idempotency, and correct list handling.
27 lines
572 B
PHP
27 lines
572 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Api;
|
|
|
|
use App\Enums\RsvpStatus;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Validation\Rule;
|
|
|
|
class RsvpMeetupEventRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
// Jeder authentifizierte Nutzer darf für einen Termin zu-/absagen.
|
|
return $this->user() !== null;
|
|
}
|
|
|
|
/**
|
|
* @return array<string, array<int, mixed>>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'status' => ['required', Rule::enum(RsvpStatus::class)],
|
|
];
|
|
}
|
|
}
|