feat: decide the staffing split per ski level
This commit is contained in:
1 parent
7aefe88610
commit
f9d2ff084d
8 files changed
+158
-66
No files matched your search
@@ -37,7 +37,7 @@ class AssignmentPlannerTest extends TestCase
|
||||
|
||||
public function testSplitWithOneLevelKeepsTheRemainingGuides(): void
|
||||
{
|
||||
$planned = $this->plan(self::rule(guides: 2, advanced: true, split: true));
|
||||
$planned = $this->plan(self::rule(guides: 2, advanced: true, splitAdvanced: true));
|
||||
|
||||
$this->assertSame([
|
||||
[StaffingRole::GUIDE, 1, null, []],
|
||||
@@ -48,7 +48,7 @@ class AssignmentPlannerTest extends TestCase
|
||||
public function testSplitWithBothLevelsUsesUpTwoGuides(): void
|
||||
{
|
||||
// decision 3: two single-level combined profiles, never the A+F one
|
||||
$planned = $this->plan(self::rule(guides: 2, beginner: true, advanced: true, split: true));
|
||||
$planned = $this->plan(self::rule(guides: 2, beginner: true, advanced: true, splitBeginner: true, splitAdvanced: true));
|
||||
|
||||
$this->assertSame([
|
||||
[StaffingRole::GUIDE_SKI_BEGINNER, 1, null, [StaffingFee::COURSE]],
|
||||
@@ -56,9 +56,29 @@ class AssignmentPlannerTest extends TestCase
|
||||
], self::summarize($planned));
|
||||
}
|
||||
|
||||
public function testOneGuideTakesOverOneLevelAndTheOtherStaysAKursleitung(): void
|
||||
{
|
||||
$planned = $this->plan(self::rule(guides: 1, beginner: true, advanced: true, splitAdvanced: true, guiding: true), self::busTravel());
|
||||
|
||||
$this->assertSame([
|
||||
[StaffingRole::GUIDE_SKI_ADVANCED, 1, 5, [StaffingFee::GUIDING, StaffingFee::COURSE]],
|
||||
[StaffingRole::SKI_BEGINNER, 1, null, [StaffingFee::COURSE]],
|
||||
], self::summarize($planned));
|
||||
}
|
||||
|
||||
public function testATakeOverOfALevelThatIsOffIsIgnored(): void
|
||||
{
|
||||
$planned = $this->plan(self::rule(guides: 1, advanced: true, splitBeginner: true));
|
||||
|
||||
$this->assertSame([
|
||||
[StaffingRole::GUIDE, 1, null, []],
|
||||
[StaffingRole::SKI_ADVANCED, 1, null, [StaffingFee::COURSE]],
|
||||
], self::summarize($planned));
|
||||
}
|
||||
|
||||
public function testGuidingIsAFeeOnTheFirstGuideTypeAssignmentOnly(): void
|
||||
{
|
||||
$planned = $this->plan(self::rule(guides: 3, beginner: true, advanced: true, split: true, guiding: true));
|
||||
$planned = $this->plan(self::rule(guides: 3, beginner: true, advanced: true, splitBeginner: true, splitAdvanced: true, guiding: true));
|
||||
|
||||
$this->assertSame([
|
||||
[StaffingRole::GUIDE, 1, null, [StaffingFee::GUIDING]],
|
||||
@@ -79,7 +99,7 @@ class AssignmentPlannerTest extends TestCase
|
||||
|
||||
public function testWithoutAPlainReiseleitungTheFirstCombinedOneGuides(): void
|
||||
{
|
||||
$planned = $this->plan(self::rule(guides: 2, beginner: true, advanced: true, split: true, guiding: true));
|
||||
$planned = $this->plan(self::rule(guides: 2, beginner: true, advanced: true, splitBeginner: true, splitAdvanced: true, guiding: true));
|
||||
|
||||
$this->assertSame([
|
||||
[StaffingRole::GUIDE_SKI_BEGINNER, 1, null, [StaffingFee::GUIDING, StaffingFee::COURSE]],
|
||||
@@ -112,7 +132,7 @@ class AssignmentPlannerTest extends TestCase
|
||||
|
||||
public function testTheBusEscortIsSetOnExactlyOneAssignment(): void
|
||||
{
|
||||
$planned = $this->plan(self::rule(guides: 3, beginner: true, split: true), self::busTravel());
|
||||
$planned = $this->plan(self::rule(guides: 3, beginner: true, splitBeginner: true), self::busTravel());
|
||||
|
||||
$this->assertSame([
|
||||
[StaffingRole::GUIDE, 2, 5, []],
|
||||
@@ -122,7 +142,7 @@ class AssignmentPlannerTest extends TestCase
|
||||
|
||||
public function testWithoutAPlainReiseleitungTheFirstCombinedOneEscortsTheBus(): void
|
||||
{
|
||||
$planned = $this->plan(self::rule(guides: 2, beginner: true, advanced: true, split: true), self::busTravel());
|
||||
$planned = $this->plan(self::rule(guides: 2, beginner: true, advanced: true, splitBeginner: true, splitAdvanced: true), self::busTravel());
|
||||
|
||||
$this->assertSame(5, $planned[0]->pickup);
|
||||
$this->assertNull($planned[1]->pickup);
|
||||
@@ -172,7 +192,8 @@ class AssignmentPlannerTest extends TestCase
|
||||
int $guides,
|
||||
bool $beginner = false,
|
||||
bool $advanced = false,
|
||||
bool $split = false,
|
||||
bool $splitBeginner = false,
|
||||
bool $splitAdvanced = false,
|
||||
bool $guiding = false,
|
||||
): StaffingRule {
|
||||
return (new StaffingRule())
|
||||
@@ -180,7 +201,8 @@ class AssignmentPlannerTest extends TestCase
|
||||
->setGuides($guides)
|
||||
->setSkiBeginner($beginner)
|
||||
->setSkiAdvanced($advanced)
|
||||
->setSplit($split)
|
||||
->setSplitBeginner($splitBeginner)
|
||||
->setSplitAdvanced($splitAdvanced)
|
||||
->setGuiding($guiding)
|
||||
;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user