Fix für Short-Signups
This commit is contained in:
@@ -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,
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user