diff --git a/CLAUDE.md b/CLAUDE.md index 5db148a..fcafba8 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -36,6 +36,12 @@ UI-Bezeichnungen. `/admin/settings`. Gelesen über `ParticipantGroupType::label()/pluralLabel()/labels()`. Texte ohne Artikel formulieren („Bitte bei „{label}" eine Auswahl treffen."), weil der Artikel vom Wort abhängt. +## eFZ-Prüfung pro Veranstaltung + +`events.coc_check_required` (Default `true`, Checkbox in `CommonSettings.vue`, Resource-Feld `cocCheckRequired`). Ist +sie aus, liefert `CertificateOfConductionCheckCommand` ohne API-Aufruf `not_required`, und `SignUpCommand` belegt +`efz_status` mit `not_required` vor. Wirkt nur auf neue Anmeldungen, bestehende Status bleiben. + ## Umsatzsteuer / Steuerinformationen Rechtlich korrekter Begriff ist **Umsatzsteuer (USt)**, nicht MwSt. Ziel: tagesbasierte Anmelde-Rechnungen („Teilnahme diff --git a/app/Domains/Event/Actions/CertificateOfConductionCheck/CertificateOfConductionCheckCommand.php b/app/Domains/Event/Actions/CertificateOfConductionCheck/CertificateOfConductionCheckCommand.php index 1824432..aad8a37 100644 --- a/app/Domains/Event/Actions/CertificateOfConductionCheck/CertificateOfConductionCheckCommand.php +++ b/app/Domains/Event/Actions/CertificateOfConductionCheck/CertificateOfConductionCheckCommand.php @@ -12,6 +12,12 @@ class CertificateOfConductionCheckCommand { public function execute() : CertificateOfConductionCheckResponse { $response = new CertificateOfConductionCheckResponse(); + // Verlangt die Veranstaltung kein eFZ, entfällt die Prüfung -- ohne Aufruf der Prüf-API. + if (!$this->request->participant->event()->first()?->coc_check_required) { + $response->status = EfzStatus::EFZ_STATUS_NOT_REQUIRED; + return $response; + } + // Der Stamm ist optional (die Kurzanmeldung erhebt ihn nicht, in der Verwaltung kann er entfernt werden). $localGroup = str_replace('Stamm ', '', $this->request->participant->localGroup()->first()?->name ?? ''); diff --git a/app/Domains/Event/Actions/SignUp/SignUpCommand.php b/app/Domains/Event/Actions/SignUp/SignUpCommand.php index f933bfb..e764bca 100644 --- a/app/Domains/Event/Actions/SignUp/SignUpCommand.php +++ b/app/Domains/Event/Actions/SignUp/SignUpCommand.php @@ -95,7 +95,9 @@ class SignUpCommand { 'payment_purpose' => $this->request->event->name . ' - Beitrag ' . $this->request->firstname . ' ' . $this->request->lastname, 'payment_method' => $this->request->paymentMethod, 'payment_options' => $paymentOptions, - 'efz_status' => $participantAge->isfullAged() ? EfzStatus::EFZ_STATUS_NOT_CHECKED : EfzStatus::EFZ_STATUS_NOT_REQUIRED, + 'efz_status' => $participantAge->isfullAged() && $this->request->event->coc_check_required + ? EfzStatus::EFZ_STATUS_NOT_CHECKED + : EfzStatus::EFZ_STATUS_NOT_REQUIRED, ] ); diff --git a/app/Domains/Event/Actions/UpdateEvent/UpdateEventCommand.php b/app/Domains/Event/Actions/UpdateEvent/UpdateEventCommand.php index 1e216a3..b361ec4 100644 --- a/app/Domains/Event/Actions/UpdateEvent/UpdateEventCommand.php +++ b/app/Domains/Event/Actions/UpdateEvent/UpdateEventCommand.php @@ -28,6 +28,7 @@ class UpdateEventCommand { $this->request->event->registration_allowed = $this->request->registrationAllowed; $this->request->event->short_registration = $this->request->shortRegistration; $this->request->event->swimming_permission_required = $this->request->swimmingPermissionRequired; + $this->request->event->coc_check_required = $this->request->cocCheckRequired; // Umstellen zwischen Local und Parent Group nur ohne Anmeldungen -- sonst stünden in einer Veranstaltung // beide Arten von Antworten nebeneinander. diff --git a/app/Domains/Event/Actions/UpdateEvent/UpdateEventRequest.php b/app/Domains/Event/Actions/UpdateEvent/UpdateEventRequest.php index 5c9ad36..3e4ab74 100644 --- a/app/Domains/Event/Actions/UpdateEvent/UpdateEventRequest.php +++ b/app/Domains/Event/Actions/UpdateEvent/UpdateEventRequest.php @@ -22,6 +22,7 @@ class UpdateEventRequest { public bool $registrationAllowed; public bool $shortRegistration; public bool $swimmingPermissionRequired; + public bool $cocCheckRequired; public Amount $flatSupport; public Amount $supportPerPerson; public array $contributingLocalGroups; @@ -29,9 +30,10 @@ class UpdateEventRequest { /** Wonach bei der Anmeldung gefragt wird; null = unverändert. Greift nur, solange es keine Anmeldungen gibt. */ public ?ParticipantGroupType $participantGroupType; - public function __construct(Event $event, string $eventName, string $eventLocation, string $postalCode, string $email, DateTime $earlyBirdEnd, DateTime $registrationFinalEnd, int $alcoholicsAge, bool $sendWeeklyReports, bool $registrationAllowed, Amount $flatSupport, Amount $supportPerPerson, array $contributingLocalGroups, array $eatingHabits, bool $shortRegistration = false, bool $swimmingPermissionRequired = true, ?string $street = null, ?string $houseNumber = null, ?ParticipantGroupType $participantGroupType = null) + public function __construct(Event $event, string $eventName, string $eventLocation, string $postalCode, string $email, DateTime $earlyBirdEnd, DateTime $registrationFinalEnd, int $alcoholicsAge, bool $sendWeeklyReports, bool $registrationAllowed, Amount $flatSupport, Amount $supportPerPerson, array $contributingLocalGroups, array $eatingHabits, bool $shortRegistration = false, bool $swimmingPermissionRequired = true, ?string $street = null, ?string $houseNumber = null, ?ParticipantGroupType $participantGroupType = null, bool $cocCheckRequired = true) { $this->participantGroupType = $participantGroupType; + $this->cocCheckRequired = $cocCheckRequired; $this->event = $event; $this->eventName = $eventName; $this->eventLocation = $eventLocation; diff --git a/app/Domains/Event/Controllers/DetailsController.php b/app/Domains/Event/Controllers/DetailsController.php index 0db288a..97f3cde 100644 --- a/app/Domains/Event/Controllers/DetailsController.php +++ b/app/Domains/Event/Controllers/DetailsController.php @@ -70,6 +70,7 @@ class DetailsController extends CommonController { $request->input('street'), $request->input('houseNumber'), ParticipantGroupType::tryFrom((string) $request->input('participantGroupType')), + (bool)$request->input('cocCheckRequired', true), ); $eventUpdateCommand = new UpdateEventCommand($eventUpdateRequest); diff --git a/app/Domains/Event/Views/Partials/CommonSettings.vue b/app/Domains/Event/Views/Partials/CommonSettings.vue index 568ec84..0ffcf86 100644 --- a/app/Domains/Event/Views/Partials/CommonSettings.vue +++ b/app/Domains/Event/Views/Partials/CommonSettings.vue @@ -44,6 +44,7 @@ const emit = defineEmits(['close']) registrationAllowed: props.event.registrationAllowed, shortRegistration: props.event.shortRegistration, swimmingPermissionRequired: props.event.swimmingPermissionRequired, + cocCheckRequired: props.event.cocCheckRequired, flatSupport: props.event.flatSupportEdit, supportPerson: props.event.supportPersonIndex, participantGroupType: props.event.participantGroupType ?? 'local_group', @@ -78,6 +79,7 @@ const emit = defineEmits(['close']) registrationAllowed: formData.registrationAllowed, shortRegistration: formData.shortRegistration, swimmingPermissionRequired: formData.swimmingPermissionRequired, + cocCheckRequired: formData.cocCheckRequired, flatSupport: formData.flatSupport, supportPerson: formData.supportPerson, contributingLocalGroups: contributingLocalGroups.value, @@ -234,6 +236,16 @@ const emit = defineEmits(['close']) + +