fix: put the guiding fee on one guide place only

This commit is contained in:
fromme committed 2026-10-16 09:56:04 +02:00
1 parent f0ad5374e9
commit c7e0ad67e6
4 files changed
+53 -21

No files matched your search

@@ -47,18 +47,23 @@ class AssignmentGenerateCommandTest extends KernelTestCase
$assignments = $this->assignments();
$this->assertCount(2, $assignments);
$this->assertCount(3, $assignments);
[$guide, $course] = $assignments;
[$guide, $secondGuide, $course] = $assignments;
$this->assertSame($destination->getId(), $guide->getDestination()->getId());
$this->assertSame('Reiseleitung', $guide->getJobProfile()->getName());
$this->assertSame(2, $guide->getAvailableDispositions());
$this->assertSame(1, $guide->getAvailableDispositions());
$this->assertSame(5, $guide->getPickup());
$this->assertSame(['Skigebietsguiding (pro Einheit)'], $guide->getFees()->map(static fn ($fee) => $fee->getName())->toArray());
$this->assertSame(Assignment::STATUS_DRAFT, $guide->getStatus());
$this->assertSame('system', $guide->getCreatedBy());
$this->assertSame('Reiseleitung', $secondGuide->getJobProfile()->getName());
$this->assertSame(1, $secondGuide->getAvailableDispositions());
$this->assertSame(0, $secondGuide->getPickup());
$this->assertCount(0, $secondGuide->getFees());
$this->assertSame('Kursleitung Ski Anfänger:innen', $course->getJobProfile()->getName());
$this->assertSame(0, $course->getPickup());
}
@@ -79,7 +84,7 @@ class AssignmentGenerateCommandTest extends KernelTestCase
$this->tester->execute([]);
$this->assertStringContainsString('davon 1 schon mit Einsätzen', $this->tester->getDisplay());
$this->assertCount(2, $this->assignments());
$this->assertCount(3, $this->assignments());
}
public function testADryRunWritesNothing(): void
@@ -90,7 +95,7 @@ class AssignmentGenerateCommandTest extends KernelTestCase
$this->assertSame(Command::SUCCESS, $this->tester->execute(['--dry-run' => true]));
$this->assertStringContainsString('2× Reiseleitung (Busbegleitung)', $this->tester->getDisplay());
$this->assertStringContainsString('1× Reiseleitung (Busbegleitung)', $this->tester->getDisplay());
$this->assertCount(0, $this->assignments());
}