mirror of
https://github.com/ericasch6/scrum-poker-internal.git
synced 2026-10-13 17:52:09 +00:00
Implement instant websocket room updates
This commit is contained in:
@@ -11,6 +11,10 @@ use Illuminate\Validation\ValidationException;
|
||||
|
||||
class RoundService
|
||||
{
|
||||
public function __construct(
|
||||
private readonly RoomRealtimeStateService $realtimeState,
|
||||
) {}
|
||||
|
||||
public function reset(Room $room): void
|
||||
{
|
||||
$stateVersion = DB::transaction(function () use ($room): int {
|
||||
@@ -38,6 +42,7 @@ class RoundService
|
||||
$room->id,
|
||||
$stateVersion,
|
||||
RoomStateChange::VotesReset,
|
||||
$this->realtimeState->for($room),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -69,6 +74,7 @@ class RoundService
|
||||
$room->id,
|
||||
$stateVersion,
|
||||
RoomStateChange::CardsRevealed,
|
||||
$this->realtimeState->for($room),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -101,6 +107,7 @@ class RoundService
|
||||
$room->id,
|
||||
$stateVersion,
|
||||
RoomStateChange::NextRound,
|
||||
$this->realtimeState->for($room),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user