Assignment#130
Open
DarshanVijaykumar wants to merge 13 commits into
Open
Conversation
Add hostId to Room and RoomSnapshot models. createRoom sets hostId to the creator's participant id. toRoomSnapshot exposes hostId. Add startRoom() service with host-only and minimum-player guards. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Tighten playerName validation on both schemas to trim + min(1). Add startRoomSchema. Add frontend guards in CreateRoomPage and JoinRoomPage that block submission when name or code is empty/whitespace-only. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Poll GET /rooms/:code every 2s; stop polling on unmount. Navigate to /game when status becomes active. Show host badge next to the host participant. Fix API base URL default (remove /bug suffix). Add startRoom to api and startGame to RoomStore. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add POST /rooms/:code/start endpoint. Returns 403 if caller is not the host and 409 if fewer than 2 participants are present. Transitions room status to active on success. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add unit tests for startRoom: success path, not-host rejection (403), insufficient players (409), and room-not-found (404). Also verify createRoom sets hostId to the creator's participant id. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Contributor