-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
997 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
allOf: | ||
- $ref: "#/components/schemas/DailyQuestionDelKey" | ||
- type: object | ||
required: | ||
- attributes | ||
properties: | ||
attributes: | ||
type: object | ||
required: | ||
- title | ||
properties: | ||
title: | ||
type: string | ||
description: Question title | ||
example: Georgian capital |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
type: object | ||
required: | ||
- id | ||
- type | ||
properties: | ||
id: | ||
type: string | ||
description: Question id | ||
type: | ||
type: string | ||
enum: [ daily_question_del ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
allOf: | ||
- $ref: "#/components/schemas/DailyQuestionDetailsKey" | ||
- type: object | ||
required: | ||
- attributes | ||
properties: | ||
attributes: | ||
type: object | ||
required: | ||
- title | ||
- reward | ||
- options | ||
- correct_answer | ||
- time_for_answer | ||
- starts_at | ||
- created_at | ||
- num_correct_answers | ||
- num_incorrect_answers | ||
- num_all_participants | ||
properties: | ||
title: | ||
type: string | ||
description: Question title | ||
example: Georgian capital | ||
reward: | ||
type: integer | ||
format: int | ||
description: reward for a correct answer | ||
options: | ||
type: array | ||
description: Answer options. Minimum 2, maximum 6 | ||
items: | ||
$ref: "#/components/schemas/DailyQuestionOptions" | ||
example: [ | ||
{ | ||
"id": 0, | ||
"title": "" | ||
}, | ||
{ | ||
"id": 1, | ||
"title": "" | ||
}, | ||
{ | ||
"id": 2, | ||
"title": "" | ||
} | ||
] | ||
correct_answer: | ||
type: integer | ||
format: int64 | ||
description: right answer index | ||
time_for_answer: | ||
type: integer | ||
format: int64 | ||
description: time for answer | ||
starts_at: | ||
type: integer | ||
format: time.Time | ||
description: start date when this question is available, hours and minutes are always 0 | ||
example: "2024-08-26T00:00:00Z" | ||
created_at: | ||
type: integer | ||
format: time.Time | ||
description: start date when this question was create | ||
num_correct_answers: | ||
type: integer | ||
format: int64 | ||
description: number of correct answers | ||
num_incorrect_answers: | ||
type: integer | ||
format: int64 | ||
description: number of incorrect answers | ||
num_all_participants: | ||
type: integer | ||
format: int64 | ||
description: | | ||
users who received the question, those who answered and | ||
those who did not answer in the time given to them |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
type: object | ||
required: | ||
- id | ||
- type | ||
properties: | ||
id: | ||
type: string | ||
description: Question id | ||
type: | ||
type: string | ||
enum: [ daily_question_details ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
allOf: | ||
- $ref: "#/components/schemas/DailyQuestionEditKey" | ||
- type: object | ||
required: | ||
- attributes | ||
properties: | ||
attributes: | ||
type: object | ||
required: | ||
- title | ||
- reward | ||
- options | ||
- correct_answer | ||
- time_for_answer | ||
- starts_at | ||
properties: | ||
title: | ||
type: string | ||
description: Question title | ||
example: Georgian capital | ||
reward: | ||
type: integer | ||
format: int | ||
description: reward for a correct answer | ||
options: | ||
type: array | ||
description: Answer options. Minimum 2, maximum 6 | ||
items: | ||
$ref: "#/components/schemas/DailyQuestionOptions" | ||
example: [ | ||
{ | ||
"id": 0, | ||
"title": "" | ||
}, | ||
{ | ||
"id": 1, | ||
"title": "" | ||
}, | ||
{ | ||
"id": 2, | ||
"title": "" | ||
} | ||
] | ||
correct_answer: | ||
type: integer | ||
format: int64 | ||
description: right answer index | ||
time_for_answer: | ||
type: integer | ||
format: int64 | ||
description: time for answer | ||
starts_at: | ||
type: integer | ||
format: time.Time | ||
description: start date when this question is available, hours and minutes are always 0 | ||
example: "2024-08-23" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
type: object | ||
required: | ||
- id | ||
- type | ||
properties: | ||
id: | ||
type: string | ||
description: Question id | ||
type: | ||
type: string | ||
enum: [ daily_question_edit ] |
39 changes: 39 additions & 0 deletions
39
docs/spec/paths/integrations@geo-points-svc@v1@public@[email protected]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
post: | ||
tags: | ||
- Daily Questions | ||
summary: Create daily question | ||
description: | | ||
Create Daily Question user must be superuser | ||
operationId: createDailyQuestion | ||
security: | ||
- BearerAuth: [] | ||
responses: | ||
200: | ||
description: Success | ||
content: | ||
application/vnd.api+json: | ||
schema: | ||
type: object | ||
required: | ||
- data | ||
properties: | ||
data: | ||
$ref: '#/components/schemas/DailyQuestionDetails' | ||
400: | ||
$ref: '#/components/responses/invalidParameter' | ||
401: | ||
$ref: '#/components/responses/invalidAuth' | ||
403: | ||
description: Correct answer option outside the range of answer options | ||
content: | ||
application/vnd.api+json: | ||
schema: | ||
$ref: '#/components/schemas/Errors' | ||
409: | ||
description: On this day, the daily question already exists | ||
content: | ||
application/vnd.api+json: | ||
schema: | ||
$ref: '#/components/schemas/Errors' | ||
500: | ||
$ref: '#/components/responses/internalError' |
31 changes: 31 additions & 0 deletions
31
docs/spec/paths/integrations@geo-points-svc@v1@public@daily_questions@delete@{ID}.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
delete: | ||
tags: | ||
- Daily Questions | ||
summary: Delete daily question | ||
description: | | ||
Delete Daily Question user must be superuser | ||
operationId: deleteDailyQuestion | ||
security: | ||
- BearerAuth: [] | ||
responses: | ||
200: | ||
description: Success | ||
content: | ||
application/vnd.api+json: | ||
schema: | ||
type: object | ||
required: | ||
- data | ||
properties: | ||
data: | ||
$ref: '#/components/schemas/DailyQuestionDel' | ||
400: | ||
$ref: '#/components/responses/invalidParameter' | ||
404: | ||
description: Question with ID not found | ||
content: | ||
application/vnd.api+json: | ||
schema: | ||
$ref: '#/components/schemas/Errors' | ||
500: | ||
$ref: '#/components/responses/internalError' |
37 changes: 37 additions & 0 deletions
37
docs/spec/paths/integrations@geo-points-svc@v1@public@daily_questions@edit@{ID}.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
patch: | ||
tags: | ||
- Daily Questions | ||
summary: Edit daily question | ||
description: | | ||
Edit Daily Question user must be superuser | ||
operationId: editDailyQuestion | ||
security: | ||
- BearerAuth: [] | ||
responses: | ||
200: | ||
description: Success | ||
content: | ||
application/vnd.api+json: | ||
schema: | ||
type: object | ||
required: | ||
- data | ||
properties: | ||
data: | ||
$ref: '#/components/schemas/DailyQuestionEdit' | ||
400: | ||
$ref: '#/components/responses/invalidParameter' | ||
409: | ||
description: On this day, the daily question already exists | ||
content: | ||
application/vnd.api+json: | ||
schema: | ||
$ref: '#/components/schemas/Errors' | ||
403: | ||
description: Correct answer option outside the range of answer options | ||
content: | ||
application/vnd.api+json: | ||
schema: | ||
$ref: '#/components/schemas/Errors' | ||
500: | ||
$ref: '#/components/responses/internalError' |
25 changes: 25 additions & 0 deletions
25
...c/paths/integrations@geo-points-svc@v1@public@daily_questions@filter_start_at@{date}.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
get: | ||
tags: | ||
- Daily Questions | ||
summary: Filter Daily Question by start | ||
description: | | ||
Filtering of daily questions by their activation time | ||
operationId: filterStartAtDailyQuestion | ||
security: | ||
- BearerAuth: [] | ||
responses: | ||
200: | ||
description: Success | ||
content: | ||
application/vnd.api+json: | ||
schema: | ||
type: object | ||
required: | ||
- data | ||
properties: | ||
data: | ||
type: array | ||
items: | ||
$ref: '#/components/schemas/DailyQuestionDetails' | ||
500: | ||
$ref: '#/components/responses/internalError' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.