feat: add the house manager questionnaire per travel and compact the questionnaire layout
This commit is contained in:
1 parent
d760ed3cdf
commit
bfef08b519
50 files changed
+2763
-180
No files matched your search
@@ -59,10 +59,10 @@ class QuestionnaireCatalogTest extends TestCase
|
||||
$this->assertFalse($catalog->get(QuestionnaireCatalog::TEAMER_FEEDBACK)->perBusLeg);
|
||||
}
|
||||
|
||||
public function testTheTwoQuestionnairesAreTheCurrentKeys(): void
|
||||
public function testTheThreeQuestionnairesAreTheCurrentKeys(): void
|
||||
{
|
||||
$this->assertSame(
|
||||
[QuestionnaireCatalog::BUS_FEEDBACK, QuestionnaireCatalog::TEAMER_FEEDBACK],
|
||||
[QuestionnaireCatalog::BUS_FEEDBACK, QuestionnaireCatalog::HOUSE_MANAGER_FEEDBACK, QuestionnaireCatalog::TEAMER_FEEDBACK],
|
||||
new QuestionnaireCatalog(self::SHIPPED_DIR)->keys(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -7,8 +7,10 @@ namespace App\Tests\Config;
|
||||
use App\Config\QuestionnaireCatalog;
|
||||
use App\Entity\Application;
|
||||
use App\Entity\Assignment;
|
||||
use App\Entity\Destination;
|
||||
use App\Entity\Disposition;
|
||||
use App\Entity\Teamer;
|
||||
use App\Service\Questionnaire\DestinationContext;
|
||||
use App\Service\Questionnaire\DispositionContext;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
@@ -74,6 +76,43 @@ class QuestionnaireCompletenessTest extends TestCase
|
||||
'Das ging gar nicht / ist besonders hervorzuheben:' => ['question:bus_remarks'],
|
||||
];
|
||||
|
||||
/**
|
||||
* The house manager briefing of 2026-11-11, question by question, follow-ups included. The
|
||||
* per-teamer details of guidings and courses are one bespoke question each. "team" is the
|
||||
* list of the travel's teamers linking into the rating form, which is not part of the answers.
|
||||
*/
|
||||
private const array HOUSE_MANAGER_FEEDBACK = [
|
||||
'Gruppe(n) im Haus?' => ['question:groups_in_house'],
|
||||
'Busanreise?' => ['question:bus_arrival'],
|
||||
'Unpünktlich?' => ['question:bus_late'],
|
||||
'Wann kam der Bus?' => ['question:bus_arrival_time'],
|
||||
'Gab es No-Shows?' => ['question:no_shows'],
|
||||
'Wurden Leistungen nicht bezogen?' => ['question:unused_services'],
|
||||
'Bitte trage hier den Vorfall des Kunden mit VG Nummer ein' => ['question:unused_services_details'],
|
||||
'Gab es Guidings?' => ['question:guidings'],
|
||||
'Wer hat das Guiding gegeben? / Welches Guiding wurde gegeben? / Anzahl Guidings? / Teilnehmendenanzahl pro Guiding?' => ['question:guiding_teamers', 'context:teamers'],
|
||||
'Gab es Kurse?' => ['question:courses'],
|
||||
'Welche Art von Kurs? / Tageszahl × Stundenzahl / Wann hat der Kurs stattgefunden?' => ['question:course_teamers', 'context:teamers'],
|
||||
'Gab es Besonderheiten/Abweichungen vom Beispiel-Programm?' => ['question:programme_deviations'],
|
||||
'Bitte beschreibe was genau' => ['question:programme_deviations_details'],
|
||||
'Welches Programm hat stattgefunden? (mit Teilnehmendenanzahl, Sonstiges)' => ['question:programme'],
|
||||
'Gab es besondere Vorkommnisse?' => ['question:incidents'],
|
||||
'(Freitext zu den Vorkommnissen)' => ['question:incidents_details'],
|
||||
'Feedback zur Gruppe' => ['question:group_feedback'],
|
||||
'Bewerte dein Wochenteam' => ['team'],
|
||||
];
|
||||
|
||||
public function testEveryHouseManagerFeedbackQuestionIsAskedOrDerived(): void
|
||||
{
|
||||
$destination = (new Destination())->setDateFrom(new \DateTimeImmutable('2027-03-27'))->setDateTo(new \DateTimeImmutable('2027-04-03'));
|
||||
|
||||
$this->assertComplete(
|
||||
QuestionnaireCatalog::HOUSE_MANAGER_FEEDBACK,
|
||||
self::HOUSE_MANAGER_FEEDBACK,
|
||||
array_keys(DestinationContext::build($destination, [])),
|
||||
);
|
||||
}
|
||||
|
||||
public function testEveryTeamerFeedbackQuestionIsAskedOrDerived(): void
|
||||
{
|
||||
$this->assertComplete(QuestionnaireCatalog::TEAMER_FEEDBACK, self::TEAMER_FEEDBACK);
|
||||
@@ -112,11 +151,12 @@ class QuestionnaireCompletenessTest extends TestCase
|
||||
|
||||
/**
|
||||
* @param array<string, list<string>> $googleQuestions
|
||||
* @param list<string>|null $contextFields what the subject snapshots; a disposition's by default
|
||||
*/
|
||||
private function assertComplete(string $questionnaire, array $googleQuestions): void
|
||||
private function assertComplete(string $questionnaire, array $googleQuestions, ?array $contextFields = null): void
|
||||
{
|
||||
$definition = new QuestionnaireCatalog(__DIR__.'/../../config/questionnaires')->get($questionnaire);
|
||||
$contextFields = array_keys(DispositionContext::build(new Disposition(new Application(new Assignment(), new Teamer()))));
|
||||
$contextFields ??= array_keys(DispositionContext::build(new Disposition(new Application(new Assignment(), new Teamer()))));
|
||||
$mapped = [];
|
||||
|
||||
foreach ($googleQuestions as $label => $targets) {
|
||||
@@ -125,6 +165,9 @@ class QuestionnaireCompletenessTest extends TestCase
|
||||
|
||||
if ('legs' === $kind) {
|
||||
$this->assertTrue($definition->perBusLeg, sprintf('"%s" is not asked as the legs escorted', $label));
|
||||
} elseif ('team' === $kind) {
|
||||
// rendered by the house manager's page, not a question
|
||||
$this->assertSame(QuestionnaireCatalog::HOUSE_MANAGER_FEEDBACK, $questionnaire);
|
||||
} elseif ('question' === $kind) {
|
||||
$this->assertNotNull($definition->getQuestion($key), sprintf('"%s" is not asked as "%s"', $label, $key));
|
||||
$mapped[] = $key;
|
||||
|
||||
Reference in new issue
Block a user