Create POST /api/matches #64

Closed
opened 2025-12-14 02:30:11 +00:00 by KZix · 0 comments
Owner

Descrição: Endpoint para criar uma nova sala de Match. AC:

Validar inputs: type (3 ou 9) e stake (inteiro > 0) são obrigatórios.

Validar Regra de Negócio: Impedir criação se o user já estiver num jogo Pending ou Playing.

Criar registo na BD com status = 'Pending'.

Preencher player2_user_id, winner_user_id e loser_user_id com o ID do criador (Placeholders para evitar erro SQL).

Inicializar player1_marks e player2_marks a 0.

Descrição: Endpoint para criar uma nova sala de Match. AC: Validar inputs: type (3 ou 9) e stake (inteiro > 0) são obrigatórios. Validar Regra de Negócio: Impedir criação se o user já estiver num jogo Pending ou Playing. Criar registo na BD com status = 'Pending'. Preencher player2_user_id, winner_user_id e loser_user_id com o ID do criador (Placeholders para evitar erro SQL). Inicializar player1_marks e player2_marks a 0.
KZix added the apigameplay labels 2025-12-14 02:30:11 +00:00
KZix self-assigned this 2025-12-14 02:30:11 +00:00
KZix added this to the Bisca - API project 2025-12-14 02:30:11 +00:00
KZix moved this to In Progress in Bisca - API on 2025-12-14 02:33:12 +00:00
KZix moved this to Done in Bisca - API on 2025-12-18 20:41:36 +00:00
KZix closed this issue 2025-12-18 21:05:10 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SyntaxSquad/DADProject#64