diff --git a/app/Domains/Event/Actions/CertificateOfConductionCheck/CertificateOfConductionCheckCommand.php b/app/Domains/Event/Actions/CertificateOfConductionCheck/CertificateOfConductionCheckCommand.php new file mode 100644 index 0000000..56b9158 --- /dev/null +++ b/app/Domains/Event/Actions/CertificateOfConductionCheck/CertificateOfConductionCheckCommand.php @@ -0,0 +1,54 @@ +request->participant->localGroup()->first()->name); + + $apiResponse = Http::acceptJson() + ->asJson() + ->withoutVerifying() + ->post(env('COC_CHECK_URL'), [ + 'firstName' => trim($this->request->participant->firstname), + 'lastName' => $this->request->participant->lastname, + 'nickname' => $this->request->participant->nickname, + 'address' => trim($this->request->participant->address_1 . ' ' . $this->request->participant->address_2), + 'zip' => $this->request->participant->zip, + 'city' => $this->request->participant->city, + 'birthday' => $this->request->participant->birthday->format('Y-m-d'), + 'email' => $this->request->participant->email_1, + 'localGroup' => $localGroup, + 'checkForDate' => $this->request->participant->departure_date->format('Y-m-d'), + ]); + + if (! $apiResponse->successful()) { + return $response; + } + + $responseParsed = $apiResponse->json(); + + if (($responseParsed['status'] ?? null) !== '200/ok') { + return $response; + } + + $response->status = match ($responseParsed['efzStatus']) { + 'NOT_REQUIRED' => EfzStatus::EFZ_STATUS_NOT_REQUIRED, + 'CHECKED_VALID' => EfzStatus::EFZ_STATUS_CHECKED_VALID, + 'CHECKED_INVALID' => EfzStatus::EFZ_STATUS_CHECKED_INVALID, + default => EfzStatus::EFZ_STATUS_NOT_CHECKED + }; + + return $response; + } +} diff --git a/app/Domains/Event/Actions/CertificateOfConductionCheck/CertificateOfConductionCheckRequest.php b/app/Domains/Event/Actions/CertificateOfConductionCheck/CertificateOfConductionCheckRequest.php new file mode 100644 index 0000000..d09eba7 --- /dev/null +++ b/app/Domains/Event/Actions/CertificateOfConductionCheck/CertificateOfConductionCheckRequest.php @@ -0,0 +1,12 @@ +status = EfzStatus::EFZ_STATUS_NOT_CHECKED; + } +} diff --git a/app/Domains/Event/Actions/SetParticipationFees/SetParticipationFeesCommand.php b/app/Domains/Event/Actions/SetParticipationFees/SetParticipationFeesCommand.php index 9d08700..18974c6 100644 --- a/app/Domains/Event/Actions/SetParticipationFees/SetParticipationFeesCommand.php +++ b/app/Domains/Event/Actions/SetParticipationFees/SetParticipationFeesCommand.php @@ -10,7 +10,7 @@ class SetParticipationFeesCommand { $this->request = $request; } - public function excetute() : SetParticipationFeesResponse { + public function execute() : SetParticipationFeesResponse { $response = new SetParticipationFeesResponse(); $this->cleanBefore(); @@ -19,7 +19,9 @@ class SetParticipationFeesCommand { 'type' => $this->request->participationFeeFirst['type'], 'name' => $this->request->participationFeeFirst['name'], 'description' => $this->request->participationFeeFirst['description'], - 'amount' => $this->request->participationFeeFirst['amount']->getAmount() + 'amount_standard' => $this->request->participationFeeFirst['amount_standard']->getAmount(), + 'amount_reduced' => null !== $this->request->participationFeeFirst['amount_reduced'] ? $this->request->participationFeeFirst['amount_reduced']->getAmount() : null, + 'amount_solidarity' => null !== $this->request->participationFeeFirst['amount_solidarity'] ? $this->request->participationFeeFirst['amount_solidarity']->getAmount() : null, ]))->save(); if ($this->request->participationFeeSecond !== null) { @@ -28,7 +30,9 @@ class SetParticipationFeesCommand { 'type' => $this->request->participationFeeSecond['type'], 'name' => $this->request->participationFeeSecond['name'], 'description' => $this->request->participationFeeSecond['description'], - 'amount' => $this->request->participationFeeSecond['amount']->getAmount() + 'amount_standard' => $this->request->participationFeeSecond['amount_standard']->getAmount(), + 'amount_reduced' => null !== $this->request->participationFeeSecond['amount_reduced'] ? $this->request->participationFeeSecond['amount_reduced']->getAmount() : null, + 'amount_solidarity' => null !== $this->request->participationFeeSecond['amount_solidarity'] ? $this->request->participationFeeSecond['amount_solidarity']->getAmount() : null, ]))->save(); } @@ -38,7 +42,9 @@ class SetParticipationFeesCommand { 'type' => $this->request->participationFeeThird['type'], 'name' => $this->request->participationFeeThird['name'], 'description' => $this->request->participationFeeThird['description'], - 'amount' => $this->request->participationFeeThird['amount']->getAmount() + 'amount_standard' => $this->request->participationFeeThird['amount_standard']->getAmount(), + 'amount_reduced' => null !== $this->request->participationFeeThird['amount_reduced'] ? $this->request->participationFeeThird['amount_reduced']->getAmount() : null, + 'amount_solidarity' => null !== $this->request->participationFeeThird['amount_solidarity'] ? $this->request->participationFeeThird['amount_solidarity']->getAmount() : null, ]))->save(); } @@ -48,7 +54,9 @@ class SetParticipationFeesCommand { 'type' => $this->request->participationFeeFourth['type'], 'name' => $this->request->participationFeeFourth['name'], 'description' => $this->request->participationFeeFourth['description'], - 'amount' => $this->request->participationFeeFourth['amount']->getAmount() + 'amount_standard' => $this->request->participationFeeFourth['amount_standard']->getAmount(), + 'amount_reduced' => null !== $this->request->participationFeeFourth['amount_reduced'] ? $this->request->participationFeeFourth['amount_reduced']->getAmount() : null, + 'amount_solidarity' => null !== $this->request->participationFeeFourth['amount_solidarity'] ? $this->request->participationFeeFourth['amount_solidarity']->getAmount() : null, ]))->save(); } diff --git a/app/Domains/Event/Actions/SignUp/SignUpCommand.php b/app/Domains/Event/Actions/SignUp/SignUpCommand.php new file mode 100644 index 0000000..7fafb53 --- /dev/null +++ b/app/Domains/Event/Actions/SignUp/SignUpCommand.php @@ -0,0 +1,65 @@ +request->birthday); + + $response->participant = $this->request->event->participants()->create( + [ + 'tenant' => $this->request->event->tenant, + 'user_id' => $this->request->user_id, + 'identifier' => Str::random(10), + 'firstname' => $this->request->firstname, + 'lastname' => $this->request->lastname, + 'nickname' => $this->request->nickname, + 'participation_type' => $this->request->participationType, + 'local_group' => $this->request->localGroup->slug, + 'birthday' => $this->request->birthday, + 'address_1' => $this->request->address_1, + 'address_2' => $this->request->address_2, + 'postcode' => $this->request->postcode, + 'city' => $this->request->city, + 'email_1' => $this->request->email_1, + 'email_2' => $this->request->email_2, + 'phone_1' => $this->request->phone_1, + 'phone_2' => $this->request->phone_2, + 'contact_person' => $this->request->contact_person, + 'allergies' => $this->request->allergies, + 'intolerances' => $this->request->intolerances, + 'medications' => $this->request->medications, + 'tetanus_vaccination' => $this->request->tetanus_vaccination, + 'eating_habit' => $this->request->eating_habit, + 'swimming_permission' => $participantAge->isfullAged() ? 'SWIMMING_PERMISSION_ALLOWED' : $this->request->swimming_permission, + 'first_aid_permission' => $participantAge->isfullAged() ? 'FIRST_AID_PERMISSION_ALLOWED' : $this->request->first_aid_permission, + 'foto_socialmedia' => $this->request->foto_socialmedia, + 'foto_print' => $this->request->foto_print, + 'foto_webseite' => $this->request->foto_webseite, + 'foto_partner' => $this->request->foto_partner, + 'foto_intern' => $this->request->foto_intern, + 'arrival_date' => $this->request->arrival, + 'departure_date' => $this->request->departure, + 'arrival_eating' => $this->request->arrival_eating, + 'departure_eating' => $this->request->departure_eating, + 'notes' => $this->request->notes, + 'amount' => $this->request->amount, + 'payment_purpose' => $this->request->event->name . ' - Beitrag ' . $this->request->firstname . ' ' . $this->request->lastname, + 'efz_status' => $participantAge->isfullAged() ? EfzStatus::EFZ_STATUS_NOT_CHECKED : EfzStatus::EFZ_STATUS_NOT_REQUIRED, + ] + ); + + $response->success = true; + return $response; + } + +} diff --git a/app/Domains/Event/Actions/SignUp/SignUpRequest.php b/app/Domains/Event/Actions/SignUp/SignUpRequest.php new file mode 100644 index 0000000..c078cc4 --- /dev/null +++ b/app/Domains/Event/Actions/SignUp/SignUpRequest.php @@ -0,0 +1,50 @@ +success = false; + $this->participant = null; + } + +} diff --git a/app/Domains/Event/Actions/UpdateEvent/UpdateEventCommand.php b/app/Domains/Event/Actions/UpdateEvent/UpdateEventCommand.php index e3b9aa6..1acebf3 100644 --- a/app/Domains/Event/Actions/UpdateEvent/UpdateEventCommand.php +++ b/app/Domains/Event/Actions/UpdateEvent/UpdateEventCommand.php @@ -20,6 +20,8 @@ class UpdateEventCommand { $this->request->event->alcoholics_age = $this->request->alcoholicsAge; $this->request->event->support_per_person = $this->request->supportPerPerson; $this->request->event->support_flat = $this->request->flatSupport; + $this->request->event->send_weekly_report = $this->request->sendWeeklyReports; + $this->request->event->registration_allowed = $this->request->registrationAllowed; $this->request->event->save(); $this->request->event->resetAllowedEatingHabits(); diff --git a/app/Domains/Event/Controllers/AvailableEventsController.php b/app/Domains/Event/Controllers/AvailableEventsController.php new file mode 100644 index 0000000..fc05b24 --- /dev/null +++ b/app/Domains/Event/Controllers/AvailableEventsController.php @@ -0,0 +1,22 @@ +events->getAvailable(false) as $event) { + $events[] = $event->toResource()->toArray($request); + }; + + + $inertiaProvider = new InertiaProvider('Event/ListAvailable', ['events' => $events]); + return $inertiaProvider->render(); + } +} diff --git a/app/Domains/Event/Controllers/CreateController.php b/app/Domains/Event/Controllers/CreateController.php index 5ca3f76..332c716 100644 --- a/app/Domains/Event/Controllers/CreateController.php +++ b/app/Domains/Event/Controllers/CreateController.php @@ -87,7 +87,7 @@ class CreateController extends CommonController { if ($wasSuccessful) { return response()->json([ 'status' => 'success', - 'event' => new EventResource($costUnitUpdateRequest->event)->toArray() + 'event' => new EventResource($costUnitUpdateRequest->event)->toArray($request) ]); } else { return response()->json([ diff --git a/app/Domains/Event/Controllers/DetailsController.php b/app/Domains/Event/Controllers/DetailsController.php index ae98ef1..511fc84 100644 --- a/app/Domains/Event/Controllers/DetailsController.php +++ b/app/Domains/Event/Controllers/DetailsController.php @@ -23,9 +23,9 @@ class DetailsController extends CommonController { return new InertiaProvider('Event/Details', ['event' => $event])->render(); } - public function summary(int $eventId) : JsonResponse { + public function summary(int $eventId, Request $request) : JsonResponse { $event = $this->events->getById($eventId); - return response()->json(['event' => new EventResource($event)->toArray()]); + return response()->json(['event' => $event->toResource()->toArray($request)]); } public function updateCommonSettings(int $eventId, Request $request) : JsonResponse { @@ -78,7 +78,9 @@ class DetailsController extends CommonController { 'type' => ParticipationType::PARTICIPATION_TYPE_PARTICIPANT, 'name' => 'Teilnehmer', 'description' => $request->input('pft_1_description'), - 'amount' => Amount::fromString($request->input('pft_1_amount')) + 'amount_standard' => Amount::fromString($request->input('pft_1_amount_standard')), + 'amount_reduced' => null !== $request->input('pft_1_amount_reduced') ? Amount::fromString($request->input('pft_1_amount_reduced')) : null, + 'amount_solidarity' => null !== $request->input('pft_1_amount_solidarity') ? Amount::fromString($request->input('pft_1_amount_solidarity')) : null ]; $participationFeeRequest = new SetParticipationFeesRequest($event, $participationFeeFirst); @@ -88,7 +90,9 @@ class DetailsController extends CommonController { 'type' => ParticipationType::PARTICIPATION_TYPE_TEAM, 'name' => $event->participation_fee_type === ParticipationFeeType::PARTICIPATION_FEE_TYPE_FIXED ? 'Kernteam' : 'Solidaritätsbeitrag', 'description' => $request->input('pft_2_description'), - 'amount' => Amount::fromString($request->input('pft_2_amount')) + 'amount_standard' => Amount::fromString($request->input('pft_2_amount_standard')), + 'amount_reduced' => null !== $request->input('pft_2_amount_reduced') ? Amount::fromString($request->input('pft_2_amount_reduced')) : null, + 'amount_solidarity' => null !== $request->input('pft_2_amount_solidarity') ? Amount::fromString($request->input('pft_2_amount_solidarity')) : null ]; } @@ -97,7 +101,9 @@ class DetailsController extends CommonController { 'type' => ParticipationType::PARTICIPATION_TYPE_VOLUNTEER, 'name' => $event->participation_fee_type === ParticipationFeeType::PARTICIPATION_FEE_TYPE_FIXED ? 'Unterstützende' : 'Reduzierter Beitrag', 'description' => $event->participation_fee_type !== ParticipationFeeType::PARTICIPATION_FEE_TYPE_SOLIDARITY ? $request->input('pft_3_description') : 'Nach Verfügbarkeit', - 'amount' => Amount::fromString($request->input('pft_3_amount')) + 'amount_standard' => Amount::fromString($request->input('pft_3_amount_standard')), + 'amount_reduced' => null !== $request->input('pft_3_amount_reduced') ? Amount::fromString($request->input('pft_3_amount_reduced')) : null, + 'amount_solidarity' => null !== $request->input('pft_3_amount_solidarity') ? Amount::fromString($request->input('pft_3_amount_solidarity')) : null ]; } @@ -106,12 +112,14 @@ class DetailsController extends CommonController { 'type' => ParticipationType::PARTICIPATION_TYPE_OTHER, 'name' => 'Sonstige', 'description' => $request->input('pft_4_description'), - 'amount' => Amount::fromString($request->input('pft_4_amount')) + 'amount_standard' => Amount::fromString($request->input('pft_4_amount_standard')), + 'amount_reduced' => null !== $request->input('pft_4_amount_reduced') ? Amount::fromString($request->input('pft_4_amount_reduced')) : null, + 'amount_solidarity' => null !== $request->input('pft_4_amount_solidarity') ? Amount::fromString($request->input('pft_4_amount_solidarity')) : null ]; } $participationFeeCommand = new SetParticipationFeesCommand($participationFeeRequest); - $response = $participationFeeCommand->excetute(); + $response = $participationFeeCommand->execute(); return response()->json(['status' => $response->success ? 'success' : 'error']); } diff --git a/app/Domains/Event/Controllers/SignupController.php b/app/Domains/Event/Controllers/SignupController.php new file mode 100644 index 0000000..4134c35 --- /dev/null +++ b/app/Domains/Event/Controllers/SignupController.php @@ -0,0 +1,171 @@ +events->getAvailable(false) as $event) { + $availableEvents[] = $event->toResource()->toArray($request); + }; + + $event = $this->events->getById($eventId, false)?->toResource()->toArray($request); + + $participantData = [ + 'firstname' => '', + 'lastname' => '', + ]; + + if (auth()->check()) { + $user = new UserResource(auth()->user())->toArray($request); + + $participantData = [ + 'id' => $user['id'], + 'firstname' => $user['firstname'], + 'lastname' => $user['lastname'], + 'nickname' => $user['nickname'], + 'email' => $user['email'], + 'phone' => $user['phone'], + 'postcode' => $user['postcode'], + 'city' => $user['city'], + 'address_1' => $user['address_1'], + 'address_2' => $user['address_2'], + 'birthday' => $user['birthday'], + 'localGroup' => $user['localGroup'], + 'allergies' => $user['allergies'], + 'intolerances' => $user['intolerances'], + 'eating_habit' => $user['eating_habits'], + 'medications' => $user['medications'], + 'tetanusVaccination' => $user['tetanus_vaccination'], + ]; + + } + + + $inertiaProvider = new InertiaProvider('Event/Signup', [ + 'event' => $event, + 'availableEvents' => $availableEvents, + 'localGroups' => $event['contributingLocalGroups'], + 'participantData' => $participantData, + ]); + return $inertiaProvider->render(); + } + + public function signUp(int $eventId, Request $request) { + $event = $this->events->getById($eventId, false); + $eventResource = $event->toResource(); + $registrationData = $request->input('registration_data'); + + $arrival = \DateTime::createFromFormat('Y-m-d', $registrationData['arrival']); + $departure = \DateTime::createFromFormat('Y-m-d', $registrationData['departure']); + $tetanusVaccination = $registrationData['tetanusVaccination'] ? \DateTime::createFromFormat('Y-m-d', $registrationData['tetanusVaccination']) : null; + + // Steps: + // 1. Check, if bereits angemeldet + + + // + $amount = $eventResource->calculateAmount( + $registrationData['participationType'], + $registrationData['beitrag'], + $arrival, + $departure + ); + + $signupRequest = new SignUpRequest( + $event,$registrationData['userId'], + $registrationData['vorname'], + $registrationData['nachname'], + $registrationData['pfadiname'], + $registrationData['participationType'], + Tenant::findOrFail($registrationData['localGroup']), + \DateTime::createFromFormat('Y-m-d', $registrationData['geburtsdatum']), + $registrationData['address1'], + $registrationData['address2'], + $registrationData['plz'], + $registrationData['ort'], + $registrationData['email_1'], + $registrationData['telefon_1'], + $registrationData['email_2'], + $registrationData['telefon_2'], + $registrationData['ansprechpartner'], + $registrationData['allergien'], + $registrationData['intolerances'], + $registrationData['medikamente'], + $tetanusVaccination, + $registrationData['essgewohnheit'], + $registrationData['badeerlaubnis'], + $registrationData['first_aid'], + $registrationData['foto']['socialmedia'], + $registrationData['foto']['print'], + $registrationData['foto']['webseite'], + $registrationData['foto']['partner'], + $registrationData['foto']['intern'], + $arrival, + $departure, + $registrationData['anreise_essen'], + $registrationData['abreise_essen'], + $registrationData['anmerkungen'], + $amount + ); + + $signupCommand = new SignUpCommand($signupRequest); + $signupResponse = $signupCommand->execute(); + + // 4. Addons registrieren + + + $certificateOfConductionCheckRequest = new CertificateOfConductionCheckRequest($signupResponse->participant); + $certificateOfConductionCheckCommand = new CertificateOfConductionCheckCommand($certificateOfConductionCheckRequest); + $certificateOfConductionCheckResponse = $certificateOfConductionCheckCommand->execute(); + + $signupResponse->participant->efz_status = $certificateOfConductionCheckResponse->status; + $signupResponse->participant->save(); + + // 6. E-Mail senden & Bestätigung senden + + + + return response()->json( + [ + 'participant' => $signupResponse->participant->toResource()->toArray($request), + 'status' => 'success', + ] + ); + + + + + + dd($eventId, $registrationData, $amount); + } + + public function calculateAmount(int $eventId, Request $request, bool $forDisplay = true) : JsonResponse | float { + $event = $this->events->getById($eventId, false)->toResource(); + + return response()->json(['amount' => + $event->calculateAmount( + $request->input('participationType'), + $request->input('beitrag'), + \DateTime::createFromFormat('Y-m-d', $request->input('arrival')), + \DateTime::createFromFormat('Y-m-d', $request->input('departure')) + )->toString() + ]); + } +} diff --git a/app/Domains/Event/Routes/api.php b/app/Domains/Event/Routes/api.php index 5f80811..11f777b 100644 --- a/app/Domains/Event/Routes/api.php +++ b/app/Domains/Event/Routes/api.php @@ -2,6 +2,7 @@ use App\Domains\Event\Controllers\CreateController; use App\Domains\Event\Controllers\DetailsController; +use App\Domains\Event\Controllers\SignupController; use App\Middleware\IdentifyTenant; use Illuminate\Support\Facades\Route; @@ -9,6 +10,9 @@ Route::prefix('api/v1') ->group(function () { Route::middleware(IdentifyTenant::class)->group(function () { Route::prefix('event')->group(function () { + Route::post('{eventId}/calculate-amount', [SignupController::class, 'calculateAmount']); + Route::post('{eventId}/signup', [SignupController::class, 'signUp']); + Route::middleware(['auth'])->group(function () { Route::post('/create', [CreateController::class, 'doCreate']); diff --git a/app/Domains/Event/Routes/web.php b/app/Domains/Event/Routes/web.php index 04ef415..047797d 100644 --- a/app/Domains/Event/Routes/web.php +++ b/app/Domains/Event/Routes/web.php @@ -1,12 +1,19 @@ group(function () { Route::prefix('event')->group(function () { + Route::get('/available-events', AvailableEventsController::class); + + + Route::get('/{eventId}/signup', SignupController::class); + Route::middleware(['auth'])->group(function () { Route::get('/new', CreateController::class); Route::get('/details/{eventId}', DetailsController::class); diff --git a/app/Domains/Event/Views/Partials/AvailableEvents.vue b/app/Domains/Event/Views/Partials/AvailableEvents.vue new file mode 100644 index 0000000..5ffac72 --- /dev/null +++ b/app/Domains/Event/Views/Partials/AvailableEvents.vue @@ -0,0 +1,102 @@ + + + + + diff --git a/app/Domains/Event/Views/Partials/ParticipationFees.vue b/app/Domains/Event/Views/Partials/ParticipationFees.vue index 7ad2f3b..5cdb518 100644 --- a/app/Domains/Event/Views/Partials/ParticipationFees.vue +++ b/app/Domains/Event/Views/Partials/ParticipationFees.vue @@ -16,19 +16,27 @@ const errors = reactive({}) const formData = reactive({ "pft_1_active": true, - "pft_1_amount": props.event.participationFee_1.amount, + "pft_1_amount_standard": props.event.participationFee_1.amount_standard_edit, + "pft_1_amount_reduced": props.event.participationFee_1.amount_reduced_edit, + "pft_1_amount_solidarity": props.event.participationFee_1.amount_solidarity_edit, "pft_1_description": props.event.participationFee_1.description, "pft_2_active": props.event.participationFee_2.active, - "pft_2_amount": props.event.participationFee_2.amount, + "pft_2_amount_standard": props.event.participationFee_2.amount_standard_edit, + "pft_2_amount_reduced": props.event.participationFee_2.amount_reduced_edit, + "pft_2_amount_solidarity": props.event.participationFee_2.amount_solidarity_edit, "pft_2_description": props.event.participationFee_2.description, "pft_3_active": props.event.participationFee_3.active, - "pft_3_amount": props.event.participationFee_3.amount, + "pft_3_amount_standard": props.event.participationFee_3.amount_standard_edit, + "pft_3_amount_reduced": props.event.participationFee_3.amount_reduced_edit, + "pft_3_amount_solidarity": props.event.participationFee_3.amount_solidarity_edit, "pft_3_description": props.event.participationFee_3.description, "pft_4_active": props.event.participationFee_4.active, - "pft_4_amount": props.event.participationFee_4.amount, + "pft_4_amount_standard": props.event.participationFee_4.amount_standard_edit, + "pft_4_amount_reduced": props.event.participationFee_4.amount_reduced_edit, + "pft_4_amount_solidarity": props.event.participationFee_4.amount_solidarity_edit, "pft_4_description": props.event.participationFee_4.description, 'maxAmount': props.event.maxAmount, @@ -38,17 +46,17 @@ function validateInput() { var noErrors = true; - if (formData.pft_1_description === '' && !props.event.solidarityPayment) { + if (formData.pft_1_description === '') { errors.pft_1_description = 'Eine Beschreibung für diese Gruppe ist erforderlich'; noErrors = false; } - if (formData.pft_2_description === '' && formData.pft_2_active && !props.event.solidarityPayment) { + if (formData.pft_2_description === '' && formData.pft_2_active) { errors.pft_2_description = 'Eine Beschreibung für diese Gruppe ist erforderlich'; noErrors = false; } - if (formData.pft_3_description === '' && formData.pft_3_active && !props.event.solidarityPayment) { + if (formData.pft_3_description === '' && formData.pft_3_active) { errors.pft_3_description = 'Eine Beschreibung für diese Gruppe ist erforderlich'; noErrors = false; } @@ -73,19 +81,27 @@ body: { event_id: props.event.id, pft_1_active: formData.pft_1_active, - pft_1_amount: formData.pft_1_amount, + pft_1_amount_standard: formData.pft_1_amount_standard, + pft_1_amount_reduced: formData.pft_1_amount_reduced, + pft_1_amount_solidarity: formData.pft_1_amount_solidarity, pft_1_description: formData.pft_1_description, pft_2_active: formData.pft_2_active, - pft_2_amount: formData.pft_2_amount, + pft_2_amount_standard: formData.pft_2_amount_standard, + pft_2_amount_reduced: formData.pft_2_amount_reduced, + pft_2_amount_solidarity: formData.pft_2_amount_solidarity, pft_2_description: formData.pft_2_description, pft_3_active: formData.pft_3_active, - pft_3_amount: formData.pft_3_amount, + pft_3_amount_standard: formData.pft_3_amount_standard, + pft_3_amount_reduced: formData.pft_3_amount_reduced, + pft_3_amount_solidarity: formData.pft_3_amount_solidarity, pft_3_description: formData.pft_3_description, pft_4_active: formData.pft_4_active, - pft_4_amount: formData.pft_4_amount, + pft_4_amount_standard: formData.pft_4_amount_standard, + pft_4_amount_reduced: formData.pft_4_amount_reduced, + pft_4_amount_solidarity: formData.pft_4_amount_solidarity, pft_4_description: formData.pft_4_description, maxAmount: formData.maxAmount, @@ -114,29 +130,41 @@