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
+9 -3
View File
@@ -10,6 +10,7 @@ use App\Exception\NoRoomsAvailableException;
use App\Form\Model\BookingDto;
use App\Form\Model\ParticipantDto;
use App\Form\Model\RoomSelectionDto;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
@@ -27,6 +28,8 @@ class BookingService
private readonly TravelDataService $travelDataService,
private readonly BookingPriceCalculatorService $priceCalculator,
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.
*
* 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
* 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
*
* @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
{
@@ -544,7 +550,7 @@ class BookingService
return 'A';
}
return 'F';
return $this->defaultBookingStatus;
}
/**