Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion admin-new/src/api/registrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface Tournament {
rankMax: number;
maxUsers: number;
description: string;
club: {
court: {
id: string;
name: string;
address: string;
Expand Down
4 changes: 2 additions & 2 deletions admin-new/src/shared/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export interface Club {
export interface Court {
id: string
name: string
address: string
Expand All @@ -10,7 +10,7 @@ export interface Tournament {
start_time: string
end_time?: string
price: number
club_id: string
court_id: string
tournament_type: string
rank_min: number
rank_max: number
Expand Down
145 changes: 129 additions & 16 deletions server-go/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ const docTemplate = `{
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.Club"
"$ref": "#/definitions/domain.Court"
}
}
},
Expand Down Expand Up @@ -269,15 +269,15 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.CreateClub"
"$ref": "#/definitions/domain.CreateCourt"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/domain.Club"
"$ref": "#/definitions/domain.Court"
}
},
"400": {
Expand Down Expand Up @@ -308,6 +308,62 @@ const docTemplate = `{
}
},
"/admin/courts/{id}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get court by ID. Available for any admin.",
"produces": [
"application/json"
],
"tags": [
"admin-courts"
],
"summary": "Get court (Admin)",
"parameters": [
{
"type": "string",
"description": "Court ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/domain.Court"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/domain.ErrorResponse"
}
}
}
},
"delete": {
"security": [
{
Expand Down Expand Up @@ -401,15 +457,15 @@ const docTemplate = `{
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.PatchClub"
"$ref": "#/definitions/domain.PatchCourt"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/domain.Club"
"$ref": "#/definitions/domain.Court"
}
},
"400": {
Expand Down Expand Up @@ -1399,6 +1455,64 @@ const docTemplate = `{
}
}
},
"/courts": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Returns a list of all courts. Only available for authenticated Telegram admins.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"courts"
],
"summary": "Get all courts",
"responses": {
"200": {
"description": "List of courts",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.Court"
}
}
},
"401": {
"description": "User not authorized",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"403": {
"description": "Admin rights required",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"500": {
"description": "Internal server error",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
},
"/images/upload/avatar": {
"post": {
"security": [
Expand Down Expand Up @@ -2877,7 +2991,7 @@ const docTemplate = `{
}
}
},
"domain.Club": {
"domain.Court": {
"type": "object",
"properties": {
"address": {
Expand Down Expand Up @@ -2924,7 +3038,7 @@ const docTemplate = `{
}
}
},
"domain.CreateClub": {
"domain.CreateCourt": {
"type": "object",
"required": [
"address",
Expand Down Expand Up @@ -2959,18 +3073,17 @@ const docTemplate = `{
"domain.CreateTournament": {
"type": "object",
"required": [
"clubId",
"courtId",
"maxUsers",
"name",
"organizatorId",
"price",
"rankMax",
"rankMin",
"startTime",
"tournamentType"
],
"properties": {
"clubId": {
"courtId": {
"type": "string"
},
"description": {
Expand Down Expand Up @@ -3135,7 +3248,7 @@ const docTemplate = `{
}
}
},
"domain.PatchClub": {
"domain.PatchCourt": {
"type": "object",
"properties": {
"address": {
Expand Down Expand Up @@ -3166,7 +3279,7 @@ const docTemplate = `{
"domain.PatchTournament": {
"type": "object",
"properties": {
"clubId": {
"courtId": {
"type": "string"
},
"description": {
Expand Down Expand Up @@ -3398,8 +3511,8 @@ const docTemplate = `{
"domain.Tournament": {
"type": "object",
"properties": {
"club": {
"$ref": "#/definitions/domain.Club"
"court": {
"$ref": "#/definitions/domain.Court"
},
"description": {
"type": "string"
Expand Down Expand Up @@ -3445,8 +3558,8 @@ const docTemplate = `{
"domain.TournamentForRegistration": {
"type": "object",
"properties": {
"club": {
"$ref": "#/definitions/domain.Club"
"court": {
"$ref": "#/definitions/domain.Court"
},
"description": {
"type": "string"
Expand Down
Loading