feat: refactoring and cleanup
This commit is contained in:
1 parent
f4691ec67e
commit
696800aafd
41 files changed
+2591
-2233
No files matched your search
@@ -86,4 +86,28 @@ class RoomAssignmentService
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Assigns rooms to participants if any participants need room assignment.
|
||||
*
|
||||
* Checks if any participants have null room assignments, and if so,
|
||||
* triggers the auto-assignment process. This is a convenience method
|
||||
* that combines the check and assignment into a single call.
|
||||
*
|
||||
* @param BookingDto $dto The booking DTO to update
|
||||
*
|
||||
* @return bool True if assignment was performed, false if not needed
|
||||
*/
|
||||
public function assignRoomsIfNeeded(BookingDto $dto): bool
|
||||
{
|
||||
foreach ($dto->participants as $participant) {
|
||||
if (null === $participant->assignedRoomId) {
|
||||
$this->assignParticipantsToRooms($dto);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user