Basic implementation of payment methods

This commit is contained in:
2026-07-28 15:50:58 +02:00
parent afc91545a9
commit 6c9281516e
39 changed files with 749 additions and 24 deletions
@@ -11,6 +11,12 @@ class UpdateEventCommand {
public function execute() : UpdateEventResponse {
$response = new UpdateEventResponse();
if (count($this->request->paymentMethods) === 0) {
$response->success = false;
$response->message = 'Mindestens eine Zahlungsmöglichkeit muss ausgewählt sein.';
return $response;
}
$this->request->event->name = $this->request->eventName;
$this->request->event->location = $this->request->eventLocation;
$this->request->event->postal_code = $this->request->postalCode;
@@ -26,6 +32,7 @@ class UpdateEventCommand {
$this->request->event->resetAllowedEatingHabits();
$this->request->event->resetContributingLocalGroups();
$this->request->event->resetPaymentMethods();
foreach($this->request->eatingHabits as $eatingHabit) {
$this->request->event->eatingHabits()->attach($eatingHabit);
@@ -35,6 +42,10 @@ class UpdateEventCommand {
$this->request->event->localGroups()->attach($contributingLocalGroup);
}
foreach($this->request->paymentMethods as $paymentMethod) {
$this->request->event->paymentMethods()->attach($paymentMethod);
}
$this->request->event->save();
$response->success = true;