wip: feedback about booked and assigned rooms

This commit is contained in:
Björn Fromme
2025-07-23 11:39:03 +02:00
parent e8c27cb51b
commit 8746397d83
4 changed files with 126 additions and 46 deletions
+18
View File
@@ -102,4 +102,22 @@ class BookingService
return $participantsCount;
}
/**
* Calculates the number of participants assigned to each room ID.
*
* @return array<int, int> an array where the key is the room ID and the value is the count of assigned participants
*/
public function getRoomAssignmentCounts(BookingCreateDto $bookingCreateDto): array
{
$counts = [];
foreach ($bookingCreateDto->participants as $participant) {
if (null !== $participant->assignedRoomId) {
$counts[$participant->assignedRoomId] = ($counts[$participant->assignedRoomId] ?? 0) + 1;
}
}
return $counts;
}
}