wip: booking process, refactoring

This commit is contained in:
Björn Fromme
2025-07-16 19:37:17 +02:00
parent 47faa6b08e
commit eecea0abd1
43 changed files with 2269 additions and 366 deletions
+11 -3
View File
@@ -28,8 +28,9 @@ class TravelParser extends AbstractParser
* Extracts all travel-related data from the XML node including dates,
* pricing, services, rooms, pickups, and guide information.
*
* @param Crawler $node The XML node containing travel data
* @param Crawler $node The XML node containing travel data
* @param int|null $hotelId Optional hotel ID for specific hotel data
*
* @return Travel The parsed travel object
*/
public function parse(Crawler $node, ?int $hotelId = null): Travel
@@ -67,6 +68,7 @@ class TravelParser extends AbstractParser
* the XML structure. Each group contains multiple selection options.
*
* @param Crawler $node The XML node containing selection group data
*
* @return array<int, CrmSelectionGroup> Array of selection groups indexed by ID
*/
public function getSelectionGroups(Crawler $node): array
@@ -104,6 +106,7 @@ class TravelParser extends AbstractParser
* from the XML structure with pricing and availability information.
*
* @param Crawler $node The XML node containing additional service data
*
* @return array<int, Service> Array of additional services indexed by ID
*/
public function getAdditionalServices(Crawler $node): array
@@ -139,6 +142,7 @@ class TravelParser extends AbstractParser
* with scheduling, pricing, and direction information.
*
* @param Crawler $node The XML node containing transportation service data
*
* @return array<int, Service> Array of transportation services indexed by ID
*/
public function getTransportationServices(Crawler $node): array
@@ -177,6 +181,7 @@ class TravelParser extends AbstractParser
* and extracts name and phone contact details.
*
* @param Crawler $travelNode The XML node containing travel data
*
* @return Guide|null The guide object or null if no guide found
*/
public function getGuide(Crawler $travelNode): ?Guide
@@ -204,8 +209,9 @@ class TravelParser extends AbstractParser
* Date and time parsing is only performed for outbound journeys when
* a default date is provided.
*
* @param Crawler $node The XML node containing pickup data
* @param Crawler $node The XML node containing pickup data
* @param \DateTimeImmutable|null $defaultDate Default date for time parsing (outbound only)
*
* @return array<int, Pickup> Array of pickup locations indexed by ID
*/
public function getPickups(Crawler $node, ?\DateTimeImmutable $defaultDate = null): array
@@ -237,8 +243,9 @@ class TravelParser extends AbstractParser
* Retrieves the hotel node either by specific hotel ID or returns
* the first hotel node if no ID is specified.
*
* @param Crawler $node The XML node containing hotel data
* @param Crawler $node The XML node containing hotel data
* @param int|null $hotelId Optional hotel ID to filter by
*
* @return Crawler The hotel XML node
*/
public function getHotelNode(Crawler $node, ?int $hotelId): Crawler
@@ -260,6 +267,7 @@ class TravelParser extends AbstractParser
* and board options from the hotel XML structure.
*
* @param Crawler $node The XML node containing room data
*
* @return array<int, Room> Array of rooms indexed by room ID
*/
public function getRooms(Crawler $node): array