| @@ -55,8 +55,15 @@ | ||
| 55 | 55 | */ |
| 56 | 56 | public ?int $max_pax; |
| 57 | 57 | |
| 58 | 58 | /** |
| 59 | + * @var string How a party larger than max_pax is handled when pricing per | |
| 60 | + * group: 'block' (cap at max, default) or 'per_block' (charge | |
| 61 | + * one flat price per block of max_pax people). | |
| 62 | + */ | |
| 63 | + public string $group_overflow = 'block'; | |
| 64 | + | |
| 65 | + /** | |
| 59 | 66 | * @var array|null Icon data (type and value) |
| 60 | 67 | */ |
| 61 | 68 | public ?array $icon; |
| 62 | 69 | |
| @@ -102,8 +109,11 @@ | ||
| 102 | 109 | ? $data['pricing_mode'] |
| 103 | 110 | : 'per_person'; |
| 104 | 111 | $category->min_pax = isset($data['min_pax']) && $data['min_pax'] !== '' ? (int) $data['min_pax'] : null; |
| 105 | 112 | $category->max_pax = isset($data['max_pax']) && $data['max_pax'] !== '' ? (int) $data['max_pax'] : null; |
| 113 | + $category->group_overflow = isset($data['group_overflow']) && in_array($data['group_overflow'], ['block', 'per_block'], true) | |
| 114 | + ? $data['group_overflow'] | |
| 115 | + : 'block'; | |
| 106 | 116 | $category->icon = isset($data['icon']) ? (is_array($data['icon']) ? $data['icon'] : maybe_unserialize($data['icon'])) : null; |
| 107 | 117 | $category->status = $data['status'] ?? 'draft'; |
| 108 | 118 | $category->created_at = $data['created_at'] ?? ''; |
| 109 | 119 | $category->updated_at = $data['updated_at'] ?? ''; |
| @@ -127,8 +137,9 @@ | ||
| 127 | 137 | 'age_max' => $this->age_max, |
| 128 | 138 | 'pricing_mode' => $this->pricing_mode, |
| 129 | 139 | 'min_pax' => $this->min_pax, |
| 130 | 140 | 'max_pax' => $this->max_pax, |
| 141 | + 'group_overflow' => $this->group_overflow, | |
| 131 | 142 | 'icon' => $this->icon, |
| 132 | 143 | 'status' => $this->status, |
| 133 | 144 | 'created_at' => $this->created_at, |
| 134 | 145 | 'updated_at' => $this->updated_at, |