feat: groups price calculator admin crud, booking/offer flow and api
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enum\Groups;
|
||||
|
||||
enum AdditionalServiceType: string
|
||||
{
|
||||
case Flat = 'flat';
|
||||
case PerPerson = 'per_person';
|
||||
case PerNight = 'per_night';
|
||||
case PerPersonPerNight = 'per_person_per_night';
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return 'enum.additional_service.'.$this->value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enum\Groups;
|
||||
|
||||
enum PriceType: string
|
||||
{
|
||||
case OVERRIDE = 'override';
|
||||
case DISCOUNT = 'discount';
|
||||
|
||||
public function priority(): int
|
||||
{
|
||||
return match($this) {
|
||||
self::OVERRIDE => 1,
|
||||
self::DISCOUNT => 2,
|
||||
};
|
||||
}
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match($this) {
|
||||
self::OVERRIDE => 'Override',
|
||||
self::DISCOUNT => 'Rabatt',
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enum\Groups;
|
||||
|
||||
enum Season: string
|
||||
{
|
||||
case ADV_SECONDARY = 'adv_secondary';
|
||||
case SECONDARY = 'secondary';
|
||||
case PEAK = 'peak';
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return 'enum.season.'.$this->value.'.label';
|
||||
}
|
||||
|
||||
public function token(): string
|
||||
{
|
||||
return 'enum.season.'.$this->value.'.token';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user