fix: pass BusPro room assignments through on edit

This commit is contained in:
fromme committed 2026-11-09 18:00:47 +01:00
1 parent 897a1ac7f9
commit d50995a21c
7 files changed
+163 -45

No files matched your search

@@ -13,13 +13,12 @@ use App\Service\ServiceAvailabilityCalculator;
use PHPUnit\Framework\TestCase;
/**
* Tests that draft restoration never unassigns a room.
* Tests that draft restoration never changes a room assignment.
*
* Edit mode renders the room as static text and never submits assignedRoomId, so a null in
* the draft payload is always an artefact of a snapshot taken before BusPro reported the
* assignment - typically for seats added to a group booking shortly before the draft was
* saved. Replaying such a null would strip the room from the UI and from the outbound
* zuordnung, so the room id uses the same merge strategy as single-select services.
* Edit mode renders the room as static text and never submits assignedRoomId, so the draft
* only holds what BusPro reported when it was saved: a null for seats added to a group booking
* shortly before, or a room the office has since reassigned. The room always comes from the
* booking as loaded; only the free-text remarks are restored.
*/
class BookingEditDraftMergerRoomAssignmentTest extends TestCase
{
@@ -43,7 +42,7 @@ class BookingEditDraftMergerRoomAssignmentTest extends TestCase
$this->assertSame(74, $participant->assignedRoomId);
}
public function testDraftAppliesRoomThatResolvesAgainstTravel(): void
public function testDraftDoesNotMoveParticipantToAnotherRoom(): void
{
$participant = new ParticipantDto();
$participant->mutable = true;
@@ -56,7 +55,7 @@ class BookingEditDraftMergerRoomAssignmentTest extends TestCase
$this->apply($travel, $participant, ['assignedRoomId' => 75]);
$this->assertSame(75, $participant->assignedRoomId);
$this->assertSame(74, $participant->assignedRoomId);
}
public function testDraftSkipsRoomThatIsUnknownToTravel(): void