diff --git a/app/Domains/Event/Actions/SetParticipationFees/SetParticipationFeesCommand.php b/app/Domains/Event/Actions/SetParticipationFees/SetParticipationFeesCommand.php
index 18974c6..062e5ea 100644
--- a/app/Domains/Event/Actions/SetParticipationFees/SetParticipationFeesCommand.php
+++ b/app/Domains/Event/Actions/SetParticipationFees/SetParticipationFeesCommand.php
@@ -12,6 +12,9 @@ class SetParticipationFeesCommand {
public function execute() : SetParticipationFeesResponse {
$response = new SetParticipationFeesResponse();
+ $this->request->event->sibling_reduction = $this->request->siblingReduction;
+ $this->request->event->save();
+
$this->cleanBefore();
$this->request->event->participationFee1()->associate(EventParticipationFee::create([
diff --git a/app/Domains/Event/Actions/SetParticipationFees/SetParticipationFeesRequest.php b/app/Domains/Event/Actions/SetParticipationFees/SetParticipationFeesRequest.php
index 28f2ec4..0df1171 100644
--- a/app/Domains/Event/Actions/SetParticipationFees/SetParticipationFeesRequest.php
+++ b/app/Domains/Event/Actions/SetParticipationFees/SetParticipationFeesRequest.php
@@ -12,13 +12,16 @@ class SetParticipationFeesRequest {
public ?array $participationFeeThird;
public ?array $participationFeeFourth;
+ public bool $siblingReduction;
- public function __construct(Event $event, array $participationFeeFirst) {
+
+ public function __construct(Event $event, array $participationFeeFirst, bool $siblingReduction) {
$this->event = $event;
$this->participationFeeFirst = $participationFeeFirst;
$this->participationFeeSecond = null;
$this->participationFeeThird = null;
$this->participationFeeFourth = null;
+ $this->siblingReduction = $siblingReduction;
}
}
diff --git a/app/Domains/Event/Controllers/DetailsController.php b/app/Domains/Event/Controllers/DetailsController.php
index fbfac37..b0d7ebc 100644
--- a/app/Domains/Event/Controllers/DetailsController.php
+++ b/app/Domains/Event/Controllers/DetailsController.php
@@ -87,7 +87,8 @@ class DetailsController extends CommonController {
'amount_solidarity' => null !== $request->input('pft_1_amount_solidarity') ? Amount::fromString($request->input('pft_1_amount_solidarity')) : null
];
- $participationFeeRequest = new SetParticipationFeesRequest($event, $participationFeeFirst);
+ $siblingReduction = $request->input('sibling_reduction') ?? false;
+ $participationFeeRequest = new SetParticipationFeesRequest($event, $participationFeeFirst, $siblingReduction);
if ($request->input('pft_2_active')) {
$participationFeeRequest->participationFeeSecond = [
diff --git a/app/Domains/Event/Controllers/SignupController.php b/app/Domains/Event/Controllers/SignupController.php
index c6999eb..67cc0b6 100644
--- a/app/Domains/Event/Controllers/SignupController.php
+++ b/app/Domains/Event/Controllers/SignupController.php
@@ -70,6 +70,8 @@ class SignupController extends CommonController {
$event = $this->events->getById($eventId, false);
$eventResource = $event->toResource();
$registrationData = $request->input('registration_data');
+ $siblingReduction = $registrationData['sibling'] === 'true';
+
$arrival = \DateTime::createFromFormat('Y-m-d', $registrationData['arrival']);
$departure = \DateTime::createFromFormat('Y-m-d', $registrationData['departure']);
@@ -81,16 +83,17 @@ class SignupController extends CommonController {
$registrationData['nachname'],
$registrationData['email_1'],
DateTime::createFromFormat('Y-m-d', $registrationData['geburtsdatum']));
-/*
+
if ($doubleCheckEventRegistrationProvider->isRegistered()) {
return response()->json(['status' => 'exists']);
- }*/
+ }
$amount = $eventResource->calculateAmount(
$registrationData['participationType'],
$registrationData['beitrag'],
$arrival,
- $departure
+ $departure,
+ $siblingReduction
);
$signupRequest = new SignUpRequest(
@@ -164,12 +167,15 @@ class SignupController extends CommonController {
public function calculateAmount(int $eventId, Request $request, bool $forDisplay = true) : JsonResponse | float {
$event = $this->events->getById($eventId, false)->toResource();
+ $siblingReduction = $request->input('sibling') === 'true';
+
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'))
+ \DateTime::createFromFormat('Y-m-d', $request->input('departure')),
+ $siblingReduction
)->toString()
]);
}
diff --git a/app/Domains/Event/Views/Partials/ParticipationFees.vue b/app/Domains/Event/Views/Partials/ParticipationFees.vue
index 53e687c..7e1f1da 100644
--- a/app/Domains/Event/Views/Partials/ParticipationFees.vue
+++ b/app/Domains/Event/Views/Partials/ParticipationFees.vue
@@ -38,9 +38,12 @@
"pft_4_description": props.event.participationFee_4.description,
'maxAmount': props.event.maxAmount,
+ 'sibling_reduction': props.event.siblingReduction,
})
+ console.log(formData)
+
function validateInput() {
var noErrors = true;
@@ -103,6 +106,7 @@
pft_4_description: formData.pft_4_description,
maxAmount: formData.maxAmount,
+ sibling_reduction: formData.sibling_reduction,
}
})
@@ -277,7 +281,14 @@
-
+
+
+ 50% Preisnachlass für Geschwisterkinder gewähren
+
+
+
+
+
diff --git a/app/Domains/Event/Views/Partials/SignUpForm/composables/useSignupForm.js b/app/Domains/Event/Views/Partials/SignUpForm/composables/useSignupForm.js
index 40c4905..e5b50a1 100644
--- a/app/Domains/Event/Views/Partials/SignUpForm/composables/useSignupForm.js
+++ b/app/Domains/Event/Views/Partials/SignUpForm/composables/useSignupForm.js
@@ -30,6 +30,7 @@ console.log(participantData)
telefon_2: '',
email_2: '',
badeerlaubnis: '-1',
+ sibling: '-1',
first_aid: '-1',
participant_group: '',
beitrag: 'regular',
@@ -66,6 +67,7 @@ console.log(participantData)
addons: selectedAddons,
participationType: formData.participationType,
beitrag: formData.beitrag,
+ sibling: formData.sibling,
})
summaryAmount.value = res.data.amount
} finally {
diff --git a/app/Domains/Event/Views/Partials/SignUpForm/steps/StepContactPerson.vue b/app/Domains/Event/Views/Partials/SignUpForm/steps/StepContactPerson.vue
index dd8c8b8..5b6367c 100644
--- a/app/Domains/Event/Views/Partials/SignUpForm/steps/StepContactPerson.vue
+++ b/app/Domains/Event/Views/Partials/SignUpForm/steps/StepContactPerson.vue
@@ -27,6 +27,11 @@ const next = () => {
hasError = true
}
+ if (props.event.siblingReduction && props.formData.sibling === '-1') {
+ errors.sibling = 'Bitte eine Entscheidung treffen.'
+ }
+
+
if (!props.formData.telefon_2) {
errors.telefon_2 = 'Bitte eine Telefonnummer angeben.'
hasError = true
@@ -110,6 +115,20 @@ const next = () => {
+
+ Ist bereits ein vollzahlendes Geschwisterkind für die Veranstaltung angemeldet:*
+
+
+ Bitte wählen
+ Ja
+ Nein
+
+
+ Ist bereits ein vollzahlendes Geschwisterkind angemeldet, reduziert sich der Teilnahmebeitrag um 50%. Der Preisnachlass wird am Ende der Anmeldung automatisch abgezogen.
+
+
+
+
diff --git a/app/Domains/Event/Views/Partials/SignUpForm/steps/StepRegistrationMode.vue b/app/Domains/Event/Views/Partials/SignUpForm/steps/StepRegistrationMode.vue
index b640e44..a57ce47 100644
--- a/app/Domains/Event/Views/Partials/SignUpForm/steps/StepRegistrationMode.vue
+++ b/app/Domains/Event/Views/Partials/SignUpForm/steps/StepRegistrationMode.vue
@@ -20,6 +20,7 @@ const nextStep = () => {
const hasAddons = (props.event.addons?.length ?? 0) > 0
emit('next', hasAddons ? 6 : 7)
}
+console.log(props.formData, props.event)
@@ -113,6 +114,9 @@ const nextStep = () => {
+
+ Der Preisnachlass in Höhe von 50% wird am Ende des Anmeldeprozesses berechnet.
+
← Zurück
diff --git a/app/Models/Event.php b/app/Models/Event.php
index 8a6e6a2..9e9421a 100644
--- a/app/Models/Event.php
+++ b/app/Models/Event.php
@@ -37,6 +37,7 @@ use Illuminate\Http\Resources\Json\JsonResource;
* @property string $registration_link
* @property boolean $pay_per_day
* @property boolean $pay_direct
+ * @property boolean $sibling_reduction
* @property boolean $send_weekly_report
* @property int $participation_fee_1
* @property int $participation_fee_2
@@ -73,6 +74,7 @@ class Event extends InstancedModel
'registration_link',
'pay_per_day',
'pay_direct',
+ 'sibling_reduction',
'send_weekly_report',
'participation_fee_1',
'participation_fee_2',
@@ -104,6 +106,8 @@ class Event extends InstancedModel
'support_per_person' => AmountCast::class,
'support_flat' => AmountCast::class,
'total_max_amount' => AmountCast::class,
+
+ 'sibling_reduction' => 'boolean',
];
public function tenant(): BelongsTo
diff --git a/app/Resources/EventResource.php b/app/Resources/EventResource.php
index 89e7f12..81519a0 100644
--- a/app/Resources/EventResource.php
+++ b/app/Resources/EventResource.php
@@ -74,6 +74,7 @@ class EventResource extends JsonResource{
$returnArray['nameShort'] = substr($returnArray['nameShort'], 8, 13) . '...';
}
+ $returnArray['siblingReduction'] = $this->event->sibling_reduction ?? true;
$returnArray['costUnit'] = new CostUnitResource($this->event->costUnit()->first())->toArray(true);
$returnArray['solidarityPayment'] = $this->event->participation_fee_type === ParticipationFeeType::PARTICIPATION_FEE_TYPE_SOLIDARITY;
$returnArray['payPerDay'] = $this->event->pay_per_day;
@@ -301,7 +302,8 @@ class EventResource extends JsonResource{
string $participationType,
string $feeType,
DateTime $arrival,
- DateTime $departure
+ DateTime $departure,
+ bool $hasSibling
) : Amount {
$fee = collect([
$this->event->participationFee1,
@@ -324,6 +326,10 @@ class EventResource extends JsonResource{
$basicFee = $basicFee->multiply($days);
}
+ if ($hasSibling && $this->event->sibling_reduction) {
+ $basicFee = $basicFee->multiply(0.5);
+ }
+
return $basicFee;
}
}
diff --git a/database/migrations/2026_02_14_140010_create_events.php b/database/migrations/2026_02_14_140010_create_events.php
index a38b9be..3963b53 100644
--- a/database/migrations/2026_02_14_140010_create_events.php
+++ b/database/migrations/2026_02_14_140010_create_events.php
@@ -59,6 +59,7 @@ return new class extends Migration {
$table->string('registration_link')->nullable();
$table->boolean('pay_per_day');
$table->boolean('pay_direct');
+ $table->boolean('sibling_reduction')->default(false);
$table->boolean('send_weekly_report')->default(true);
$table->foreignId('participation_fee_1')->nullable()->constrained('event_participation_fees', 'id')->nullOnDelete()->cascadeOnUpdate();
$table->foreignId('participation_fee_2')->nullable()->constrained('event_participation_fees', 'id')->nullOnDelete()->cascadeOnUpdate();