fix: give chatbot pickups per-leg surcharges including the return leg

This commit is contained in:
fromme committed 2026-10-09 08:38:57 +02:00
1 parent ac5ca7b18b
commit 3cb1548f2f
8 files changed
+58 -7

No files matched your search

@@ -159,6 +159,8 @@ class ProductExportBuilderTest extends TestCase
'city' => 'Stadt 4',
'street' => 'Strasse 4',
'price' => 5.9,
'returnLeg' => false,
'returnPrice' => null,
'datetime' => '2026-12-03T23:30:00',
], $pickups[0]);
self::assertNull($pickups[1]['price'], 'an absent price is null');
@@ -167,6 +169,15 @@ class ProductExportBuilderTest extends TestCase
self::assertNull($pickups[2]['code']);
}
public function testJoinsEachPickupWithItsReturnLegVerbatim(): void
{
$pickups = $this->rowFor('900-222931')['pickups'];
self::assertSame([false, true, true, false], array_column($pickups, 'returnLeg'));
self::assertSame(3.0, $pickups[1]['returnPrice']);
self::assertNull($pickups[2]['returnPrice'], 'listed on the return leg without a price');
}
public function testPickupTimesInTheSpringForwardGapAreNotShifted(): void
{
// DPWUSMP280327 in the 30.09.2026 13:11 export. Berlin skips 02:00-02:59 that night.