Implement account management features in API, including endpoints for listing accounts and updating account roles. Introduce moderator role with associated permissions, and refactor access control checks to accommodate staff roles. Update database schema to support new role constraints and enhance frontend navigation for staff access.
This commit is contained in:
@@ -110,6 +110,40 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/Player"
|
||||
/api/accounts:
|
||||
get:
|
||||
tags: [Admin]
|
||||
operationId: listAccounts
|
||||
responses:
|
||||
"200":
|
||||
description: Accounts visible to administrators
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items: { $ref: "#/components/schemas/Account" }
|
||||
"403": { $ref: "#/components/responses/Forbidden" }
|
||||
/api/accounts/{accountId}/moderator:
|
||||
patch:
|
||||
tags: [Admin]
|
||||
operationId: setModerator
|
||||
parameters:
|
||||
- name: accountId
|
||||
in: path
|
||||
required: true
|
||||
schema: { type: string }
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [moderator]
|
||||
properties:
|
||||
moderator: { type: boolean }
|
||||
responses:
|
||||
"200": { description: Updated account, content: { application/json: { schema: { $ref: "#/components/schemas/Account" } } } }
|
||||
"403": { $ref: "#/components/responses/Forbidden" }
|
||||
/api/events:
|
||||
get:
|
||||
tags: [Events]
|
||||
@@ -328,6 +362,17 @@ paths:
|
||||
responses:
|
||||
"200": { description: Registration closed, content: { application/json: { schema: { $ref: "#/components/schemas/Event" } } } }
|
||||
"409": { $ref: "#/components/responses/Conflict" }
|
||||
/api/events/{eventId}/workflow/back:
|
||||
post:
|
||||
tags: [Events]
|
||||
operationId: revertEventWorkflowStage
|
||||
parameters: [{ $ref: "#/components/parameters/EventId" }]
|
||||
requestBody:
|
||||
required: true
|
||||
content: { application/json: { schema: { $ref: "#/components/schemas/VersionCommand" } } }
|
||||
responses:
|
||||
"200": { description: Workflow moved back one stage, content: { application/json: { schema: { $ref: "#/components/schemas/Event" } } } }
|
||||
"409": { $ref: "#/components/responses/Conflict" }
|
||||
/api/events/{eventId}/balance/generate:
|
||||
post:
|
||||
tags: [Teams]
|
||||
@@ -383,6 +428,36 @@ paths:
|
||||
responses:
|
||||
"200": { description: Updated roster, content: { application/json: { schema: { $ref: "#/components/schemas/RosterDraft" } } } }
|
||||
"409": { $ref: "#/components/responses/Conflict" }
|
||||
/api/events/{eventId}/roster/move:
|
||||
post:
|
||||
tags: [Teams]
|
||||
operationId: moveRosterPlayer
|
||||
parameters: [{ $ref: "#/components/parameters/EventId" }]
|
||||
requestBody:
|
||||
required: true
|
||||
content: { application/json: { schema: { $ref: "#/components/schemas/RosterMoveCommand" } } }
|
||||
responses:
|
||||
"200": { description: Updated roster, content: { application/json: { schema: { $ref: "#/components/schemas/RosterDraft" } } } }
|
||||
/api/events/{eventId}/roster/place-reserve:
|
||||
post:
|
||||
tags: [Teams]
|
||||
operationId: placeReserveRosterPlayer
|
||||
parameters: [{ $ref: "#/components/parameters/EventId" }]
|
||||
requestBody:
|
||||
required: true
|
||||
content: { application/json: { schema: { $ref: "#/components/schemas/RosterPlaceReserveCommand" } } }
|
||||
responses:
|
||||
"200": { description: Updated roster, content: { application/json: { schema: { $ref: "#/components/schemas/RosterDraft" } } } }
|
||||
/api/events/{eventId}/roster/remove:
|
||||
post:
|
||||
tags: [Teams]
|
||||
operationId: removeRosterPlayer
|
||||
parameters: [{ $ref: "#/components/parameters/EventId" }]
|
||||
requestBody:
|
||||
required: true
|
||||
content: { application/json: { schema: { $ref: "#/components/schemas/RosterRemoveCommand" } } }
|
||||
responses:
|
||||
"200": { description: Updated roster, content: { application/json: { schema: { $ref: "#/components/schemas/RosterDraft" } } } }
|
||||
/api/events/{eventId}/roster/substitute:
|
||||
post:
|
||||
tags: [Teams]
|
||||
@@ -788,7 +863,7 @@ components:
|
||||
format: uri
|
||||
role:
|
||||
type: string
|
||||
enum: [player, admin]
|
||||
enum: [player, moderator, admin]
|
||||
createdAt:
|
||||
type: string
|
||||
format: date-time
|
||||
@@ -1013,6 +1088,30 @@ components:
|
||||
teamBId: { type: string }
|
||||
playerBId: { type: string }
|
||||
expectedVersion: { type: integer }
|
||||
RosterMoveCommand:
|
||||
type: object
|
||||
required: [fromTeamId, playerId, toTeamId, role, expectedVersion]
|
||||
properties:
|
||||
fromTeamId: { type: string }
|
||||
playerId: { type: string }
|
||||
toTeamId: { type: string }
|
||||
role: { type: string, enum: [Tank, Damage, Support] }
|
||||
expectedVersion: { type: integer }
|
||||
RosterPlaceReserveCommand:
|
||||
type: object
|
||||
required: [teamId, reservePlayerId, role, expectedVersion]
|
||||
properties:
|
||||
teamId: { type: string }
|
||||
reservePlayerId: { type: string }
|
||||
role: { type: string, enum: [Tank, Damage, Support] }
|
||||
expectedVersion: { type: integer }
|
||||
RosterRemoveCommand:
|
||||
type: object
|
||||
required: [teamId, playerId, expectedVersion]
|
||||
properties:
|
||||
teamId: { type: string }
|
||||
playerId: { type: string }
|
||||
expectedVersion: { type: integer }
|
||||
RosterSubstitutionCommand:
|
||||
type: object
|
||||
required: [teamId, outgoingPlayerId, reservePlayerId, expectedVersion]
|
||||
|
||||
Reference in New Issue
Block a user