feat: streamlined booking number property

This commit is contained in:
Björn Fromme committed 2026-01-10 12:12:54 +01:00
1 parent 6fca40963d
commit d95d0a8930
7 files changed
+71 -23

No files matched your search

+6 -6
View File
@@ -16,15 +16,15 @@ namespace App\BusProNet\Model;
class BookingResponse
{
/**
* @param string $status Booking status (möglich|erfolgt)
* @param string|null $transactionNumber Transaction number (vorgang)
* @param array<int, PriceItem> $priceItems Individual price items from response
* @param float|null $totalPrice Total price (gesamtpreis)
* @param PaymentTerms|null $paymentTerms Payment terms (anzahlung/restzahlung)
* @param string $status Booking status (möglich|erfolgt)
* @param int|null $bookingNumber Booking number (BPN XML: vorgang)
* @param array<int, PriceItem> $priceItems Individual price items from response
* @param float|null $totalPrice Total price (gesamtpreis)
* @param PaymentTerms|null $paymentTerms Payment terms (anzahlung/restzahlung)
*/
public function __construct(
public readonly string $status,
public readonly ?string $transactionNumber = null,
public readonly ?int $bookingNumber = null,
public readonly array $priceItems = [],
public readonly ?float $totalPrice = null,
public readonly ?PaymentTerms $paymentTerms = null,
@@ -33,7 +33,7 @@ class BookingResponseParser extends AbstractParser
public function parse(Crawler $node): BookingResponse
{
$status = $node->filterXPath('//buchung')->text();
$transactionNumber = $this->getStringOrNullValue($node->filterXPath('//vorgang'));
$bookingNumber = $this->getIntOrNullValue($node->filterXPath('//vorgang'));
$totalPrice = $this->getFloatOrNullValue($node->filterXPath('//gesamtpreis'));
$message = $this->getStringOrNullValue($node->filterXPath('//hinweis'));
@@ -42,7 +42,7 @@ class BookingResponseParser extends AbstractParser
return new BookingResponse(
status: $status,
transactionNumber: $transactionNumber,
bookingNumber: $bookingNumber,
priceItems: $priceItems,
totalPrice: $totalPrice,
paymentTerms: $paymentTerms,