feat: keep questionnaires until submitted, remind teamers daily and take bus feedback per leg

This commit is contained in:
fromme committed 2026-11-10 16:38:51 +01:00
1 parent abf9c1be0b
commit e72616fdbf
37 files changed
+1119 -238

No files matched your search

@@ -19,7 +19,8 @@ use PHPUnit\Framework\TestCase;
*
* The lists below are the Google forms' questions in their order, with what each became:
* "question:<key>" is asked, "context:<field>" is taken from the disposition and snapshotted into
* the response (DispositionContext::build()). Google's "Bitte ankreuzen:" checkbox list was split
* the response (DispositionContext::build()), "legs" is the per-bus-leg choice of rides the
* teamer escorted (App\Form\QuestionnaireType), which became a response per leg. Google's "Bitte ankreuzen:" checkbox list was split
* into five single-choice questions, so it maps to five.
*/
class QuestionnaireCompletenessTest extends TestCase
@@ -48,7 +49,7 @@ class QuestionnaireCompletenessTest extends TestCase
private const array BUS_FEEDBACK = [
'(Datum, ohne Titel)' => ['context:escortPickupDate', 'context:dateTo'],
'Hin- oder Rückfahrt' => ['question:direction'],
'Hin- oder Rückfahrt' => ['legs'],
'Reiseziel:' => ['context:destinationProduct'],
'Bus-Unternehmen:' => ['question:bus_company'],
'Name des Busunternehmens:' => ['question:bus_company_other'],
@@ -120,9 +121,11 @@ class QuestionnaireCompletenessTest extends TestCase
foreach ($googleQuestions as $label => $targets) {
foreach ($targets as $target) {
[$kind, $key] = explode(':', $target);
[$kind, $key] = explode(':', $target) + [1 => null];
if ('question' === $kind) {
if ('legs' === $kind) {
$this->assertTrue($definition->perBusLeg, sprintf('"%s" is not asked as the legs escorted', $label));
} elseif ('question' === $kind) {
$this->assertNotNull($definition->getQuestion($key), sprintf('"%s" is not asked as "%s"', $label, $key));
$mapped[] = $key;
} else {