Generalize per-vehicle-option booking rules to Front Seat too

Front Seat previously had a hardcoded max-per-booking check with no enable
toggle; now every Vehicle Option (front_seat/back_seat/whole_vehicle) gets
the same config-driven pair — an on/off toggle and a max passenger_count —
surfaced via new BOOKING_*_ENABLED/BOOKING_*_MAX_PER_BOOKING env vars,
editable from ManageAppSettings, and exposed on route pricing as
max_per_booking.
This commit is contained in:
Nyan Lin Paing
2026-08-30 15:45:27 +07:00
parent 914b7f97f3
commit bebcab88fa
11 changed files with 175 additions and 97 deletions
+10 -16
View File
@@ -4,30 +4,24 @@ return [
/*
|--------------------------------------------------------------------------
| Vehicle Option Toggles
| Vehicle Option Rules
|--------------------------------------------------------------------------
|
| Blunt on/off switches for Vehicle Options that have no real inventory
| tracking in v1 (see domain.md §2). Front Seat has no toggle it is
| always selectable, only capped per-booking by the max below.
| Every Vehicle Option gets the same two blunt, config-driven rules no
| real inventory tracking in v1 (see domain.md §2): an on/off switch for
| whether it can be selected at all right now, and a max passenger_count
| a single booking may request for it.
|
*/
'front_seat_enabled' => env('BOOKING_FRONT_SEAT_ENABLED', true),
'front_seat_max_per_booking' => env('BOOKING_FRONT_SEAT_MAX_PER_BOOKING', 1),
'back_seat_enabled' => env('BOOKING_BACK_SEAT_ENABLED', true),
'back_seat_max_per_booking' => env('BOOKING_BACK_SEAT_MAX_PER_BOOKING', 3),
'whole_vehicle_enabled' => env('BOOKING_WHOLE_VEHICLE_ENABLED', true),
/*
|--------------------------------------------------------------------------
| Front Seat Limit
|--------------------------------------------------------------------------
|
| The only inventory rule enforced in v1: max Front Seats a single
| booking may request.
|
*/
'front_seat_max_per_booking' => env('BOOKING_FRONT_SEAT_MAX_PER_BOOKING', 1),
'whole_vehicle_max_per_booking' => env('BOOKING_WHOLE_VEHICLE_MAX_PER_BOOKING', 4),
// comma-separated list of admin emails to notify on booking events
'admin_emails' => explode(',', env('BOOKING_ADMIN_EMAILS', 'admin@example.com')),