feat: proper determination of agency initiated bookings

For booking that are agency initiated (groups) different rules apply
concerning mutability and requirement of personal data and whether the
first participant is the applicant or not. This commit adds logic to
evaluate the agency id assigned to the booking data to decide.
This commit is contained in:
Björn Fromme
2026-03-16 12:02:27 +01:00
parent f55ed3dc4c
commit e222f448bb
20 changed files with 201 additions and 137 deletions
+5 -1
View File
@@ -7,6 +7,7 @@ namespace App\Tests\Service;
use App\BusProNet\Constants;
use App\BusProNet\Model\Service;
use App\BusProNet\Model\Travel;
use App\BusProNet\XmlLoader\AgencyLoader;
use App\Form\Model\BookingDto;
use App\Form\Model\ParticipantDto;
use App\Service\BookingPriceCalculatorService;
@@ -25,11 +26,14 @@ class BookingServiceBabyTest extends TestCase
$travelDataService = $this->createMock(TravelDataService::class);
$priceCalculator = $this->createMock(BookingPriceCalculatorService::class);
$this->participantEligibilityService = $this->createMock(ParticipantEligibilityService::class);
$agencyLoader = $this->createMock(AgencyLoader::class);
$this->bookingService = new BookingService(
$travelDataService,
$priceCalculator,
$this->participantEligibilityService
$this->participantEligibilityService,
$agencyLoader,
'F' // default booking status
);
}
+5 -1
View File
@@ -7,6 +7,7 @@ namespace App\Tests\Service;
use App\BusProNet\Constants;
use App\BusProNet\Model\Room;
use App\BusProNet\Model\Travel;
use App\BusProNet\XmlLoader\AgencyLoader;
use App\Exception\NoRoomsAvailableException;
use App\Service\BookingPriceCalculatorService;
use App\Service\BookingService;
@@ -27,11 +28,14 @@ class BookingServiceStatusTest extends TestCase
$this->travelDataService = $this->createMock(TravelDataService::class);
$priceCalculator = $this->createMock(BookingPriceCalculatorService::class);
$participantEligibility = $this->createMock(ParticipantEligibilityService::class);
$agencyLoader = $this->createMock(AgencyLoader::class);
$this->bookingService = new BookingService(
$this->travelDataService,
$priceCalculator,
$participantEligibility
$participantEligibility,
$agencyLoader,
'F' // default booking status
);
}