feat: offer non-travelling applicant choice only on selected travels
This commit is contained in:
1 parent
5b75938c73
commit
b958d1a371
9 files changed
+320
-26
No files matched your search
@@ -193,6 +193,26 @@ class BookingDto
|
||||
return $this->participants[$index] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ends a split: the applicant takes the participant[0] slot back and travels again.
|
||||
*
|
||||
* The traveller who held the slot is dropped; only the room assignment carries over,
|
||||
* the mirror image of what the split left behind.
|
||||
*/
|
||||
public function restoreTravellingApplicant(): void
|
||||
{
|
||||
$restored = $this->applicant;
|
||||
|
||||
if (null !== $restored) {
|
||||
$restored->index = 0;
|
||||
$restored->assignedRoomId = ($this->participants[0] ?? null)?->assignedRoomId;
|
||||
$this->participants[0] = $restored;
|
||||
}
|
||||
|
||||
$this->applicant = null;
|
||||
$this->applicantTravels = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether participant[0] is also the applicant.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user