Skip to content

Commit

Permalink
Merge pull request #30 from Questspace-v2/wp/QUESTSPACE-7/0
Browse files Browse the repository at this point in the history
QUESTSPACE-7: Add option to accept teams manually
  • Loading branch information
BasedDepartment1 authored Oct 13, 2024
2 parents 8897685 + 608c77b commit 7d736c3
Show file tree
Hide file tree
Showing 51 changed files with 1,305 additions and 266 deletions.
1 change: 1 addition & 0 deletions src/cmd/questspace/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ func InitApp(ctx context.Context, application *app.App) error {
r.H().Use(jwt.AuthMiddlewareStrict(jwtParser)).POST("/teams/all/:id/captain", transport.WrapCtxErr(teamsHandler.HandleChangeLeader))
r.H().Use(jwt.AuthMiddlewareStrict(jwtParser)).POST("/teams/all/:id/leave", transport.WrapCtxErr(teamsHandler.HandleLeave))
r.H().Use(jwt.AuthMiddlewareStrict(jwtParser)).DELETE("/teams/all/:id/:user_id", transport.WrapCtxErr(teamsHandler.HandleRemoveUser))
r.H().Use(jwt.AuthMiddlewareStrict(jwtParser)).POST("/quest/:id/teams/:team_id/accept", transport.WrapCtxErr(teamsHandler.HandleAcceptTeam))

taskGroupHandler := taskgroups.NewHandler(clientFactory, &taskMediaValidator)
r.H().Use(jwt.AuthMiddlewareStrict(jwtParser)).PATCH("/quest/:id/task-groups/bulk", transport.WrapCtxErr(taskGroupHandler.HandleBulkUpdate))
Expand Down
138 changes: 134 additions & 4 deletions src/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -873,10 +873,7 @@ const docTemplate = `{
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/storage.Team"
}
"$ref": "#/definitions/teams.ManyTeamsResponse"
}
},
"400": {
Expand Down Expand Up @@ -931,6 +928,49 @@ const docTemplate = `{
}
}
},
"/quest/{quest_id}/teams/{team_id}/accept": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"tags": [
"Teams"
],
"summary": "Accept team",
"parameters": [
{
"type": "string",
"description": "Quest id",
"name": "quest_id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Team id",
"name": "team_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/teams.ManyTeamsResponse"
}
},
"404": {
"description": "Not Found"
},
"406": {
"description": "Not Acceptable"
}
}
}
},
"/teams/all/{team_id}": {
"get": {
"tags": [
Expand Down Expand Up @@ -1885,6 +1925,9 @@ const docTemplate = `{
"max_team_cap": {
"type": "integer"
},
"max_teams_amount": {
"type": "integer"
},
"media_link": {
"type": "string"
},
Expand All @@ -1895,6 +1938,17 @@ const docTemplate = `{
"type": "string",
"example": "2024-04-14T12:00:00+05:00"
},
"registration_type": {
"enum": [
"AUTO",
"VERIFY"
],
"allOf": [
{
"$ref": "#/definitions/storage.RegistrationType"
}
]
},
"start_time": {
"type": "string",
"example": "2024-04-14T14:00:00+05:00"
Expand Down Expand Up @@ -2025,6 +2079,9 @@ const docTemplate = `{
"max_team_cap": {
"type": "integer"
},
"max_teams_amount": {
"type": "integer"
},
"media_link": {
"type": "string"
},
Expand All @@ -2035,6 +2092,17 @@ const docTemplate = `{
"type": "string",
"example": "2024-04-14T12:00:00+05:00"
},
"registration_type": {
"enum": [
"AUTO",
"VERIFY"
],
"allOf": [
{
"$ref": "#/definitions/storage.RegistrationType"
}
]
},
"start_time": {
"type": "string",
"example": "2024-04-14T14:00:00+05:00"
Expand Down Expand Up @@ -2063,6 +2131,32 @@ const docTemplate = `{
"StatusFinished"
]
},
"storage.RegistrationStatus": {
"type": "string",
"enum": [
"",
"ON_CONSIDERATION",
"ACCEPTED"
],
"x-enum-varnames": [
"RegistrationStatusUnspecified",
"RegistrationStatusOnConsideration",
"RegistrationStatusAccepted"
]
},
"storage.RegistrationType": {
"type": "string",
"enum": [
"",
"AUTO",
"VERIFY"
],
"x-enum-varnames": [
"RegistrationUnspecified",
"RegistrationAuto",
"RegistrationVerify"
]
},
"storage.Task": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -2219,6 +2313,17 @@ const docTemplate = `{
"name": {
"type": "string"
},
"registration_status": {
"enum": [
"ON_CONSIDERATION",
"ACCEPTED"
],
"allOf": [
{
"$ref": "#/definitions/storage.RegistrationStatus"
}
]
},
"score": {
"type": "integer"
}
Expand All @@ -2245,6 +2350,9 @@ const docTemplate = `{
"max_team_cap": {
"type": "integer"
},
"max_teams_amount": {
"type": "integer"
},
"media_link": {
"type": "string"
},
Expand All @@ -2254,6 +2362,17 @@ const docTemplate = `{
"registration_deadline": {
"type": "string"
},
"registration_type": {
"enum": [
"AUTO",
"VERIFY"
],
"allOf": [
{
"$ref": "#/definitions/storage.RegistrationType"
}
]
},
"start_time": {
"type": "string"
}
Expand Down Expand Up @@ -2386,6 +2505,17 @@ const docTemplate = `{
}
}
},
"teams.ManyTeamsResponse": {
"type": "object",
"properties": {
"teams": {
"type": "array",
"items": {
"$ref": "#/definitions/storage.Team"
}
}
}
},
"teams.UpdateRequest": {
"type": "object",
"properties": {
Expand Down
Loading

0 comments on commit 7d736c3

Please sign in to comment.