Files
myep/src/Model/RoomSelectionAdjustment.php
T

31 lines
725 B
PHP

<?php
declare(strict_types=1);
namespace App\Model;
/**
* A room selection the current travel data no longer supports in full.
*
* A room that disappeared altogether is the same case with nothing left to book, so it is reported
* as an adjustment down to zero rather than as a second kind of result.
*/
final readonly class RoomSelectionAdjustment
{
public function __construct(
public int $roomId,
public ?string $label,
public int $requestedQuantity,
public int $bookableQuantity,
) {
}
/**
* Whether the room is gone entirely rather than merely reduced.
*/
public function isDropped(): bool
{
return 0 === $this->bookableQuantity;
}
}