Fix für Short-Signups

This commit is contained in:
2026-09-10 22:27:57 +02:00
parent 4e981c140b
commit 328825293a
13 changed files with 242 additions and 57 deletions
@@ -29,12 +29,20 @@ class ShortSignUpCommand {
// Ohne konfigurierte Teilnahmegruppe gäbe es keinen gültigen `participation_type` -- sauber abbrechen,
// statt in einen Fremdschlüssel-Fehler zu laufen.
$participationType = $this->request->event->firstParticipationTypeSlug();
if ($participationType === null) {
$participationFee = $this->request->event->firstParticipationFee();
if ($participationFee === null) {
$response->message = 'Für diese Veranstaltung ist noch keine Teilnahmegruppe hinterlegt.';
return $response;
}
$participationType = $participationFee->type;
// Nur hinterlegte Beitragsstufen sind wählbar -- für jede andere hätte calculateAmount() keinen Betrag.
if (!in_array($this->request->feeType, $participationFee->availableFeeTypes(), true)) {
$response->message = 'Der gewählte Beitrag ist für diese Veranstaltung nicht verfügbar.';
return $response;
}
$participantAge = new Age($this->request->birthday);
// Bei Minderjährigen ist die Kontaktperson Pflicht; der Client prüft das ebenfalls, verlassen wird sich
@@ -63,10 +71,10 @@ class ShortSignUpCommand {
$eventResource = $this->request->event->toResource();
// Zeitraum, Gruppe und Beitragsstufe stehen bei der Kurzanmeldung fest -- es gibt nichts zu wählen.
// Zeitraum und Gruppe stehen bei der Kurzanmeldung fest, wählbar ist nur die Beitragsstufe.
$amount = $eventResource->calculateAmount(
$participationType,
'standard',
$this->request->feeType,
$this->request->event->start_date,
$this->request->event->end_date,
false
@@ -113,7 +121,7 @@ class ShortSignUpCommand {
paymentOptions: $this->request->paymentOptions,
participationOptions: $this->request->participationOptions,
addonItems: [],
feeType: 'standard',
feeType: $this->request->feeType,
siblingReduction: false,
);
@@ -42,6 +42,11 @@ class ShortSignUpRequest {
public array $paymentOptions = [],
/** Antworten auf die Teilnahmeoptionen: [ question_key => value ]. */
public array $participationOptions = [],
/**
* Beitragsstufe (`standard`, `reduced`, `solidarity`). Wählbar nur, wenn die Teilnahmegruppe neben dem
* Standardbeitrag weitere Stufen hinterlegt hat; der Command prüft das.
*/
public string $feeType = 'standard',
) {
}
}