42 lines
956 B
PHP
42 lines
956 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\BusProNet\Service\StatusRule;
|
|
|
|
use App\BusProNet\Service\Contract\BookingStatusRuleInterface;
|
|
use App\Form\Model\BookingDto;
|
|
|
|
/**
|
|
* Status rule for travels containing selection 1473.
|
|
*
|
|
* Forces Option status when the travel contains the CRM selection
|
|
* "NICHT-automatisch bestätigen".
|
|
*/
|
|
class Selection1473StatusRule implements BookingStatusRuleInterface
|
|
{
|
|
private const STATUS = 'O';
|
|
private const PRIORITY = 200;
|
|
private const SELECTION_ID = 1473;
|
|
|
|
public function evaluate(BookingDto $bookingDto): bool
|
|
{
|
|
return $bookingDto->travel->hasSelectionId(self::SELECTION_ID);
|
|
}
|
|
|
|
public function getStatus(): string
|
|
{
|
|
return self::STATUS;
|
|
}
|
|
|
|
public function getPriority(): int
|
|
{
|
|
return self::PRIORITY;
|
|
}
|
|
|
|
public function getDescription(): string
|
|
{
|
|
return 'Assigns Option status when selection 1473 is present';
|
|
}
|
|
}
|