diff --git a/docs/PROJECT_OVERVIEW.md b/docs/PROJECT_OVERVIEW.md index c6e67df..0ab8510 100644 --- a/docs/PROJECT_OVERVIEW.md +++ b/docs/PROJECT_OVERVIEW.md @@ -8,7 +8,11 @@ 1. **Step 1**: Room selection and dates (`Create\Step1Controller`) 2. **Step 2**: Participant details with card-based UI (`Create\Step2Controller`) 3. **Step 3**: Payment method selection (`Create\Step3Controller`) -4. **Step 4**: Final confirmation and submission to BPN API (`Create\Step4Controller`) +4. **Step 4**: Final confirmation with comprehensive pricing breakdown and submission to BPN API (`Create\Step4Controller`) + - Displays complete pricing breakdown by category (rooms, services grouped by type) + - Shows per-participant total pricing in card headers + - Displays individual service prices inline with each booked service + - Three-level pricing transparency: aggregate, participant, and service-level 5. **Edit Flow**: Similar card-based UI for existing bookings (`Edit\IndexController`) ### Card-Based UI Pattern (Production) @@ -46,7 +50,12 @@ ### Service Layer (`src/Service/`) - `BookingService` - Core booking workflow -- `BookingPriceCalculatorService` - Real-time pricing +- `BookingPriceCalculatorService` - Comprehensive pricing calculations + - `getPricingBreakdown()` - Complete pricing breakdown with rooms and services grouped by type + - `calculateAllParticipantIndividualPrices()` - Per-participant total pricing + - `calculateIndividualParticipantPrice()` - Single participant total (room + all services) + - `calculateServicePricing()` - Service aggregation with grouping by subtype + - Powers sidebar summary and Step 4 confirmation pricing display - `BookingFingerprintService` - Dirty state detection for edit mode - `TravelDataService` - API integration and caching - `ParticipantCardDataService` - Card display data @@ -285,7 +294,12 @@ Edit mode session requires proper cleanup to prevent dirty state persistence: - `Step1Controller.php` - Room selection and dates - `Step2Controller.php` - Participant details with card-based UI - `Step3Controller.php` - Payment method selection -- `Step4Controller.php` - Final confirmation and API submission +- `Step4Controller.php` - Final confirmation with comprehensive pricing display and API submission + - Integrates `BookingPriceCalculatorService` for complete pricing breakdown + - Calculates per-participant individual prices via `calculateAllParticipantIndividualPrices()` + - Template displays three-level pricing: aggregate breakdown, per-participant totals, and inline service prices + - All service prices shown in blue (text-blue-700) with German formatting + - Zero prices hidden per project standards - `SuccessController.php` - Success page after booking completion **Edit Namespace** (`src/Controller/Booking/Edit/`): @@ -312,7 +326,12 @@ Edit mode session requires proper cleanup to prevent dirty state persistence: - `templates/booking/create/step_1.html.twig` - Room selection - `templates/booking/create/step_2.html.twig` - Participant cards - `templates/booking/create/step_3.html.twig` - Payment method -- `templates/booking/create/step_4.html.twig` - Confirmation +- `templates/booking/create/step_4.html.twig` - Final confirmation with comprehensive pricing display + - **Aggregate pricing breakdown**: Rooms and services grouped by type with totals + - **Per-participant cards**: Individual total price in header, all personal details and service selections + - **Inline service pricing**: Each service shows price in blue (€X,XX format) next to label + - **Payment summary**: Selected payment method and bank details (if debit) + - **Confirmation checkbox**: Final acceptance before API submission - `templates/booking/create/success.html.twig` - Success page - `templates/booking/create/error.html.twig` - Error page diff --git a/src/Controller/Booking/Create/Step4Controller.php b/src/Controller/Booking/Create/Step4Controller.php index 04bbecb..678ac50 100644 --- a/src/Controller/Booking/Create/Step4Controller.php +++ b/src/Controller/Booking/Create/Step4Controller.php @@ -11,6 +11,7 @@ use App\Controller\Booking\Traits\BookingExceptionHandlerTrait; use App\Form\BookingCreateStep4Type; use App\Form\Model\BookingDto; use App\Htmx\HxTrait; +use App\Service\BookingPriceCalculatorService; use App\Service\BookingService; use Psr\Log\LoggerInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; @@ -30,6 +31,7 @@ class Step4Controller extends AbstractController public function __construct( private readonly BookingService $bookingService, + private readonly BookingPriceCalculatorService $priceCalculator, private readonly ApiClient $apiClient, private readonly LoggerInterface $logger, ) { @@ -118,6 +120,7 @@ class Step4Controller extends AbstractController 'bookingCreateDto' => $bookingCreateDto, 'form' => $form->createView(), ...$this->getSummaryVariables($bookingCreateDto), + 'participantPrices' => $this->priceCalculator->calculateAllParticipantIndividualPrices($bookingCreateDto), ]); } } diff --git a/templates/booking/create/step_4.html.twig b/templates/booking/create/step_4.html.twig index 4bdaa4e..4069e8f 100644 --- a/templates/booking/create/step_4.html.twig +++ b/templates/booking/create/step_4.html.twig @@ -25,18 +25,74 @@ - {# Rooms Summary #} -