feat: refactored accommodation booking status model
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enum\Groups;
|
||||
|
||||
/**
|
||||
* How a booking record came about — deliberately orthogonal to the status, which
|
||||
* carries the lifecycle. The origin is set once when the record is created and
|
||||
* never changes afterwards, so an accepted offer stays recognisable as one without
|
||||
* the origin ever contradicting the status it has reached.
|
||||
*/
|
||||
enum AccommodationBookingOrigin: string
|
||||
{
|
||||
case Offer = 'offer';
|
||||
case Direct = 'direct';
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::Offer => 'Angebot',
|
||||
self::Direct => 'Direktbuchung',
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user