Refactor bracket validation logic to support draft state
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user