feat: centralize create/edit flow contexts, extract edit submit service

This commit is contained in:
Björn Fromme
2026-04-12 10:17:04 +02:00
parent f903f17ebd
commit 69705052b3
28 changed files with 1342 additions and 423 deletions
+28
View File
@@ -0,0 +1,28 @@
<?php
declare(strict_types=1);
namespace App\Form\Model;
use App\BusProNet\Model\Room;
/**
* Bundles the data needed to render the booking create flow.
*/
class BookingCreateContext
{
/**
* @param array{by_pax: array<int, Room>, by_room: array<int, Room>} $groupedRooms
* @param array<int, ParticipantCardDataDto>|null $cardsData
* @param array<int, float>|null $participantPrices
*/
public function __construct(
public readonly BookingDto $bookingDto,
public readonly BookingSummaryDto $summaryData,
public readonly array $groupedRooms,
public readonly ?array $cardsData = null,
public readonly bool $isSubmitted = false,
public readonly ?array $participantPrices = null,
) {
}
}
+29
View File
@@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace App\Form\Model;
use App\BusProNet\Model\BaseData;
use App\BusProNet\Model\Booking;
/**
* Bundles the data needed to render the booking edit flow.
*/
class BookingEditContext
{
/**
* @param array<int, ParticipantCardDataDto>|null $cardsData
*/
public function __construct(
public readonly BookingDto $bookingDto,
public readonly ?Booking $bookingData,
public readonly ?BaseData $mutableData,
public readonly BookingSummaryDto $summaryData,
public readonly ?array $cardsData = null,
public readonly bool $isDirty = false,
public readonly bool $isSubmitted = false,
public readonly bool $hasValidationErrors = false,
) {
}
}
@@ -1,22 +0,0 @@
<?php
declare(strict_types=1);
namespace App\Form\Model;
use App\BusProNet\Model\BaseData;
use App\BusProNet\Model\Booking;
/**
* Bundles the data needed to render an edit-participant page.
*/
class BookingEditParticipantContext
{
public function __construct(
public readonly BookingDto $bookingDto,
public readonly Booking $bookingData,
public readonly ?BaseData $mutableData,
public readonly BookingSummaryDto $summaryData,
) {
}
}