Implemented additional event information

This commit is contained in:
2026-08-12 15:54:00 +02:00
parent 9581176a0c
commit e95de52768
16 changed files with 327 additions and 22 deletions
@@ -27,7 +27,7 @@ class SetParticipationOptionsCommand
* Geltungsbereichs eindeutig, damit Antworten robust referenzieren können.
*
* @param array<int, array<string, mixed>> $questions
* @return array<int, array{key: string, label: string, options: array<int, array{value: string, label: string}>}>
* @return array<int, array{key: string, title: string, label: string, options: array<int, array{value: string, label: string}>}>
*/
private function normalize(array $questions): array
{
@@ -35,21 +35,25 @@ class SetParticipationOptionsCommand
$usedKeys = [];
foreach ($questions as $question) {
$label = trim((string)($question['label'] ?? ''));
if ($label === '') {
// Titel ist Pflicht (Überschrift/Feldbeschriftung); die Frage ist optionaler Erklärtext.
$title = trim((string)($question['title'] ?? ''));
if ($title === '') {
continue;
}
$label = trim((string)($question['label'] ?? ''));
$options = $this->normalizeOptions($question['options'] ?? []);
if ($options === []) {
continue;
}
$key = $this->uniqueSlug((string)($question['key'] ?? ''), $label, $usedKeys);
$key = $this->uniqueSlug((string)($question['key'] ?? ''), $title, $usedKeys);
$usedKeys[] = $key;
$normalized[] = [
'key' => $key,
'title' => $title,
'label' => $label,
'options' => $options,
];