Refactor bracket validation logic to support draft state
Some checks failed
CI / backend (push) Has been cancelled
CI / frontend (push) Has been cancelled
CI / compose (push) Has been cancelled

This commit updates the bracket validation process by introducing a new `ValidateDraft` method, allowing for incomplete edits in the draft state. The existing `Validate` method has been modified to enforce complete validation only upon confirmation. Additionally, new tests have been added to ensure that incomplete drafts are accepted until confirmation, while still rejecting invalid references. Documentation has been updated to reflect these changes in the API and architecture.
This commit is contained in:
2026-07-19 13:43:25 +03:00
parent 6b189bfce4
commit a311b7761d
6 changed files with 53 additions and 7 deletions

View File

@@ -256,6 +256,7 @@ paths:
put:
tags: [Tournaments]
operationId: updateBracketDraft
description: Saves a structurally valid work-in-progress graph; slots and final layout may remain incomplete until confirmation.
parameters: [{ $ref: "#/components/parameters/EventId" }]
requestBody:
required: true
@@ -283,6 +284,7 @@ paths:
post:
tags: [Tournaments]
operationId: confirmBracketDraft
description: Validates the complete graph, including filled slots and exactly one final match, then marks it confirmed.
parameters: [{ $ref: "#/components/parameters/EventId" }]
requestBody: { required: true, content: { application/json: { schema: { $ref: "#/components/schemas/VersionCommand" } } } }
responses: