wip: modernized edit flow, fix insurance tier calculation

This commit is contained in:
Björn Fromme
2026-03-16 11:59:10 +01:00
parent 28831a3b06
commit 5c0814ef9b
31 changed files with 272 additions and 536 deletions
@@ -6,8 +6,7 @@ namespace App\Tests\Form\Service\Condition;
use App\BusProNet\Model\Booking;
use App\BusProNet\Model\Travel;
use App\Form\Model\BookingCreateDto;
use App\Form\Model\BookingEditDto;
use App\Form\Model\BookingDto;
use App\Form\Service\Condition\InsuranceMutabilityCondition;
use Carbon\Carbon;
use PHPUnit\Framework\TestCase;
@@ -35,7 +34,7 @@ class InsuranceMutabilityConditionTest extends TestCase
$travel = new Travel();
$travel->dateFrom = new \DateTimeImmutable('+10 days');
$bookingDto = new BookingCreateDto($travel, 123);
$bookingDto = new BookingDto($travel, 123);
$result = $this->condition->evaluate($bookingDto, 0, []);
@@ -154,7 +153,7 @@ class InsuranceMutabilityConditionTest extends TestCase
$this->assertStringContainsString('3', $result);
}
private function createEditDto(\DateTimeImmutable $travelDate, \DateTimeImmutable $bookingDate): BookingEditDto
private function createEditDto(\DateTimeImmutable $travelDate, \DateTimeImmutable $bookingDate): BookingDto
{
$booking = new Booking();
$booking->bookingDate = $bookingDate;
@@ -162,6 +161,9 @@ class InsuranceMutabilityConditionTest extends TestCase
$travel = new Travel();
$travel->dateFrom = $travelDate;
return new BookingEditDto($booking, $travel);
$bookingDto = new BookingDto($travel, 1);
$bookingDto->booking = $booking;
return $bookingDto;
}
}