feat: default status of new bookings to option during beta phase

addresses #869bpb7fg
This commit is contained in:
Björn Fromme
2026-03-16 12:02:22 +01:00
parent d7fd273475
commit 5a47ca6053
3 changed files with 16 additions and 3 deletions
+5
View File
@@ -58,6 +58,11 @@ APP_WEBSITE_BASE_URL="https://www.ep-reisen.de/"
APP_TRAVEL_PREFER_REMOTE=false APP_TRAVEL_PREFER_REMOTE=false
APP_TRAVEL_ENABLE_FALLBACK=true APP_TRAVEL_ENABLE_FALLBACK=true
# Booking Configuration
# Status for new bookings: 'F' (Fixed/Final), 'O' (Option - requires agency confirmation)
# Use 'O' during beta phase, switch to 'F' for production
DEFAULT_BOOKING_STATUS=F
API_KEYS= API_KEYS=
XML_EXPORT_PATH="%kernel.project_dir%/var/xmlexport" XML_EXPORT_PATH="%kernel.project_dir%/var/xmlexport"
+2
View File
@@ -7,6 +7,8 @@ parameters:
travel_info_base_url: '%env(APP_TRAVEL_INFO_BASE_URL)%' travel_info_base_url: '%env(APP_TRAVEL_INFO_BASE_URL)%'
terms_and_conditions_url: '%env(APP_TERMS_AND_CONDITIONS_URL)%' terms_and_conditions_url: '%env(APP_TERMS_AND_CONDITIONS_URL)%'
path_to_keys: '%kernel.project_dir%/config/secret' path_to_keys: '%kernel.project_dir%/config/secret'
bpn_debug: '%env(APP_BPN_DEBUG)%'
default_booking_status: '%env(DEFAULT_BOOKING_STATUS)%'
# Body dimensions choices for BodyDimensionsType # Body dimensions choices for BodyDimensionsType
body_dimensions.height_choices: body_dimensions.height_choices:
+9 -3
View File
@@ -10,6 +10,7 @@ use App\Exception\NoRoomsAvailableException;
use App\Form\Model\BookingDto; use App\Form\Model\BookingDto;
use App\Form\Model\ParticipantDto; use App\Form\Model\ParticipantDto;
use App\Form\Model\RoomSelectionDto; use App\Form\Model\RoomSelectionDto;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
@@ -27,6 +28,8 @@ class BookingService
private readonly TravelDataService $travelDataService, private readonly TravelDataService $travelDataService,
private readonly BookingPriceCalculatorService $priceCalculator, private readonly BookingPriceCalculatorService $priceCalculator,
private readonly ParticipantEligibilityService $participantEligibilityService, private readonly ParticipantEligibilityService $participantEligibilityService,
#[Autowire('%default_booking_status%')]
private readonly string $defaultBookingStatus,
) { ) {
} }
@@ -522,13 +525,16 @@ class BookingService
* Determines the initial booking status based on travel configuration. * Determines the initial booking status based on travel configuration.
* *
* This method implements a multi-stage check to determine if a booking * This method implements a multi-stage check to determine if a booking
* should start as inquiry ('A') or final ('F') booking: * should start as inquiry ('A') or use the configured default status:
* 1. Checks if final bookings are allowed via buchungstatusmoeglich attribute from API * 1. Checks if final bookings are allowed via buchungstatusmoeglich attribute from API
* 2. Checks if only inquiry rooms are available (no Frei rooms with available > 0) * 2. Checks if only inquiry rooms are available (no Frei rooms with available > 0)
* *
* The default status is configured via DEFAULT_BOOKING_STATUS env variable.
* Use 'O' (Option) during beta for agency confirmation, 'F' (Final) for production.
*
* @param Travel $travelData The travel data to evaluate * @param Travel $travelData The travel data to evaluate
* *
* @return string 'A' for inquiry booking, 'F' for final booking * @return string 'A' for inquiry booking, or the configured default status
*/ */
private function determineInitialBookingStatus(Travel $travelData): string private function determineInitialBookingStatus(Travel $travelData): string
{ {
@@ -544,7 +550,7 @@ class BookingService
return 'A'; return 'A';
} }
return 'F'; return $this->defaultBookingStatus;
} }
/** /**