refactor: derive the bus escort from the travel date
This commit is contained in:
1 parent
2fc9806c69
commit
0e2021e96d
9 files changed
+59
-50
No files matched your search
@@ -62,9 +62,6 @@ class StaffingRule implements BlameableEntityInterface, TimestampableEntityInter
|
||||
#[ORM\Column]
|
||||
private bool $guiding = false;
|
||||
|
||||
#[ORM\Column]
|
||||
private bool $busEscort = false;
|
||||
|
||||
/** Previewed either way; only enabled rows generate. */
|
||||
#[ORM\Column]
|
||||
private bool $enabled = false;
|
||||
@@ -102,14 +99,6 @@ class StaffingRule implements BlameableEntityInterface, TimestampableEntityInter
|
||||
->addViolation()
|
||||
;
|
||||
}
|
||||
|
||||
if (true === $this->busEscort && 0 === (int) $this->guides) {
|
||||
$context
|
||||
->buildViolation('Busbegleitung braucht mindestens eine Reiseleitung')
|
||||
->atPath('busEscort')
|
||||
->addViolation()
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
public function getSkiLevelCount(): int
|
||||
@@ -200,18 +189,6 @@ class StaffingRule implements BlameableEntityInterface, TimestampableEntityInter
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isBusEscort(): bool
|
||||
{
|
||||
return $this->busEscort;
|
||||
}
|
||||
|
||||
public function setBusEscort(bool $busEscort): static
|
||||
{
|
||||
$this->busEscort = $busEscort;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isEnabled(): bool
|
||||
{
|
||||
return $this->enabled;
|
||||
|
||||
@@ -40,10 +40,6 @@ class StaffingRuleType extends AbstractType
|
||||
'label' => 'Guiding',
|
||||
'required' => false,
|
||||
])
|
||||
->add('busEscort', CheckboxType::class, [
|
||||
'label' => 'Busbegleitung',
|
||||
'required' => false,
|
||||
])
|
||||
->add('enabled', CheckboxType::class, [
|
||||
'label' => 'aktiv',
|
||||
'help' => 'Nur aktive Zeilen legen Einsätze an; die Vorschau zeigt alle',
|
||||
|
||||
@@ -18,8 +18,10 @@ use App\Service\Common\PickupOptions;
|
||||
* - with split, a Reiseleitung takes over each level through the combined profile, one place
|
||||
* per level, and the plain Reiseleitung keeps the remaining places;
|
||||
* - Guiding is the guiding fee on every guide-type assignment, not an assignment of its own;
|
||||
* - Busbegleitung pre-selects the first boarding point on exactly one assignment, the first
|
||||
* guide-type one - the plain Reiseleitung where there is one.
|
||||
* - a date with bus travel (boarding points) gets its first boarding point pre-selected as
|
||||
* Busbegleitung on exactly one assignment, the first guide-type one - the plain Reiseleitung
|
||||
* where there is one. Taken from the date, not the matrix: bus travel varies between the
|
||||
* dates of one product.
|
||||
*/
|
||||
final class AssignmentPlanner
|
||||
{
|
||||
@@ -61,7 +63,7 @@ final class AssignmentPlanner
|
||||
}
|
||||
}
|
||||
|
||||
$pickup = true === $rule->isBusEscort() ? $this->firstPickup($destination) : null;
|
||||
$pickup = $this->firstPickup($destination);
|
||||
$planned = [];
|
||||
|
||||
foreach ($roles as [$role, $places]) {
|
||||
|
||||
Reference in new issue
Block a user