mirror of
https://github.com/ericasch6/scrum-poker-internal.git
synced 2026-10-13 15:52:09 +00:00
feat: some fixes to the ui, imlemented user and guest user, ans used the dahboard
This commit is contained in:
@@ -30,6 +30,8 @@ class RoundController extends Controller
|
||||
->lockForUpdate()
|
||||
->findOrFail($room->id);
|
||||
|
||||
$this->ensureRoomIsOpen($lockedRoom);
|
||||
|
||||
Vote::query()
|
||||
->where('room_id', $lockedRoom->id)
|
||||
->where('round', $lockedRoom->current_round)
|
||||
@@ -37,6 +39,7 @@ class RoundController extends Controller
|
||||
|
||||
$lockedRoom->update([
|
||||
'revealed_at' => null,
|
||||
'last_activity_at' => now(),
|
||||
'state_version' => $lockedRoom->state_version + 1,
|
||||
]);
|
||||
});
|
||||
@@ -62,6 +65,8 @@ class RoundController extends Controller
|
||||
->lockForUpdate()
|
||||
->findOrFail($room->id);
|
||||
|
||||
$this->ensureRoomIsOpen($lockedRoom);
|
||||
|
||||
if ($lockedRoom->revealed_at !== null) {
|
||||
throw ValidationException::withMessages([
|
||||
'room' => 'Die Karten sind bereits aufgedeckt.',
|
||||
@@ -70,6 +75,7 @@ class RoundController extends Controller
|
||||
|
||||
$lockedRoom->update([
|
||||
'revealed_at' => now(),
|
||||
'last_activity_at' => now(),
|
||||
'state_version' => $lockedRoom->state_version + 1,
|
||||
]);
|
||||
});
|
||||
@@ -95,6 +101,8 @@ class RoundController extends Controller
|
||||
->lockForUpdate()
|
||||
->findOrFail($room->id);
|
||||
|
||||
$this->ensureRoomIsOpen($lockedRoom);
|
||||
|
||||
if ($lockedRoom->revealed_at === null) {
|
||||
throw ValidationException::withMessages([
|
||||
'room' => 'Die aktuelle Runde muss zuerst aufgedeckt werden.',
|
||||
@@ -104,10 +112,20 @@ class RoundController extends Controller
|
||||
$lockedRoom->update([
|
||||
'current_round' => $lockedRoom->current_round + 1,
|
||||
'revealed_at' => null,
|
||||
'last_activity_at' => now(),
|
||||
'state_version' => $lockedRoom->state_version + 1,
|
||||
]);
|
||||
});
|
||||
|
||||
return back();
|
||||
}
|
||||
|
||||
private function ensureRoomIsOpen(Room $room): void
|
||||
{
|
||||
if ($room->isClosed()) {
|
||||
throw ValidationException::withMessages([
|
||||
'room' => 'Dieser Raum ist geschlossen.',
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user