From 2b46f0e082fedf3f9ef0b1ef50685b2adc8c121e Mon Sep 17 00:00:00 2001 From: kish1n Date: Thu, 29 Aug 2024 09:19:22 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@=20543a0?= =?UTF-8?q?360d731f7c100305e53afaaa65a22557efc=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- openapi.json | 575 +++++++++++++++++++++++++++++++++++++++++++++++++++ openapi.yaml | 376 +++++++++++++++++++++++++++++++++ 2 files changed, 951 insertions(+) diff --git a/openapi.json b/openapi.json index 70fe1f9..3246e54 100644 --- a/openapi.json +++ b/openapi.json @@ -771,6 +771,239 @@ } } }, + "/integrations/geo-points-svc/v1/public/daily_questions/admin": { + "post": { + "tags": [ + "Daily Questions" + ], + "summary": "Create daily question", + "description": "Create Daily Question user must be superuser\n", + "operationId": "createDailyQuestion", + "security": [ + { + "BearerAuth": [] + } + ], + "requestBody": { + "content": { + "application/vnd.api+json": { + "schema": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/DailyQuestionCreate" + } + } + } + } + } + }, + "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" + }, + "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" + } + } + }, + "get": { + "tags": [ + "Daily Questions" + ], + "summary": "Filter Daily Question by start", + "description": "Filtering of daily questions by their activation time\n", + "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" + } + } + } + }, + "/integrations/geo-points-svc/v1/public/daily_questions/admin/{question_id}": { + "delete": { + "tags": [ + "Daily Questions" + ], + "summary": "Delete daily question", + "description": "Delete Daily Question user must be superuser\n", + "operationId": "deleteDailyQuestion", + "security": [ + { + "BearerAuth": [] + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/vnd.api+json": { + "schema": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/DailyQuestionDetails" + } + } + } + } + } + }, + "204": { + "description": "No content" + }, + "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" + } + } + }, + "patch": { + "tags": [ + "Daily Questions" + ], + "summary": "Edit daily question", + "description": "Edit Daily Question user must be superuser\n", + "operationId": "editDailyQuestion", + "security": [ + { + "BearerAuth": [] + } + ], + "requestBody": { + "content": { + "application/vnd.api+json": { + "schema": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/DailyQuestionEdit" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/vnd.api+json": { + "schema": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/DailyQuestionDetails" + } + } + } + } + } + }, + "204": { + "description": "No content" + }, + "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" + } + } + } + }, + "500": { + "$ref": "#/components/responses/internalError" + } + } + } + }, "/integrations/geo-points-svc/v1/public/event_types": { "get": { "tags": [ @@ -1871,6 +2104,348 @@ } ] }, + "DailyQuestionCreate": { + "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": "int64", + "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": "Correct answer ID" + }, + "time_for_answer": { + "type": "integer", + "format": "int64", + "description": "Time for answer" + }, + "starts_at": { + "type": "string", + "description": "Start date when this question is available, hours and minutes are always 0", + "example": "2024-08-23" + } + } + } + } + } + ] + }, + "DailyQuestionCreateKey": { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "id": { + "type": "string", + "description": "Question id" + }, + "type": { + "type": "string", + "enum": [ + "daily_questions" + ] + } + } + }, + "DailyQuestionDel": { + "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" + } + } + } + } + } + ] + }, + "DailyQuestionDelKey": { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "id": { + "type": "string", + "description": "Question id" + }, + "type": { + "type": "string", + "enum": [ + "daily_questions" + ] + } + } + }, + "DailyQuestionDetails": { + "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": "int64", + "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": "Correct answer ID" + }, + "time_for_answer": { + "type": "integer", + "format": "int64", + "description": "Time for answer" + }, + "starts_at": { + "type": "string", + "description": "Start date when this question is available, hours and minutes are always 0", + "example": "2024-08-26T00:00:00Z" + }, + "created_at": { + "type": "string", + "description": "Start date when this question was create", + "example": "2024-08-26T00:00:00Z" + }, + "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\nthose who did not answer in the time given to them\n" + } + } + } + } + } + ] + }, + "DailyQuestionDetailsKey": { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "id": { + "type": "string", + "description": "Question id" + }, + "type": { + "type": "string", + "enum": [ + "daily_questions" + ] + } + } + }, + "DailyQuestionEdit": { + "allOf": [ + { + "$ref": "#/components/schemas/DailyQuestionEditKey" + }, + { + "type": "object", + "required": [ + "attributes" + ], + "properties": { + "attributes": { + "type": "object", + "properties": { + "title": { + "type": "string", + "description": "Question title", + "example": "Georgian capital" + }, + "reward": { + "type": "integer", + "format": "int64", + "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": "Correct answer ID" + }, + "time_for_answer": { + "type": "integer", + "format": "int64", + "description": "Time for answer" + }, + "starts_at": { + "type": "string", + "description": "Start date when this question is available, hours and minutes are always 0", + "example": "2024-08-23" + } + } + } + } + } + ] + }, + "DailyQuestionEditKey": { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "id": { + "type": "string", + "description": "Question id" + }, + "type": { + "type": "string", + "enum": [ + "daily_questions" + ] + } + } + }, "DailyQuestionOptions": { "type": "object", "required": [ diff --git a/openapi.yaml b/openapi.yaml index 57a5dbe..4be3cd4 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -514,6 +514,152 @@ paths: $ref: '#/components/schemas/Errors' '500': $ref: '#/components/responses/internalError' + /integrations/geo-points-svc/v1/public/daily_questions/admin: + post: + tags: + - Daily Questions + summary: Create daily question + description: | + Create Daily Question user must be superuser + operationId: createDailyQuestion + security: + - BearerAuth: [] + requestBody: + content: + application/vnd.api+json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/DailyQuestionCreate' + 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' + '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' + 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' + '/integrations/geo-points-svc/v1/public/daily_questions/admin/{question_id}': + 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/DailyQuestionDetails' + '204': + description: No content + '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' + patch: + tags: + - Daily Questions + summary: Edit daily question + description: | + Edit Daily Question user must be superuser + operationId: editDailyQuestion + security: + - BearerAuth: [] + requestBody: + content: + application/vnd.api+json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/DailyQuestionEdit' + responses: + '200': + description: Success + content: + application/vnd.api+json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/DailyQuestionDetails' + '204': + description: No content + '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' + '500': + $ref: '#/components/responses/internalError' /integrations/geo-points-svc/v1/public/event_types: get: tags: @@ -1256,6 +1402,236 @@ components: type: integer format: int64 description: Selected/correct answer option + DailyQuestionCreate: + 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: int64 + 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: Correct answer ID + time_for_answer: + type: integer + format: int64 + description: Time for answer + starts_at: + type: string + description: 'Start date when this question is available, hours and minutes are always 0' + example: '2024-08-23' + DailyQuestionCreateKey: + type: object + required: + - id + - type + properties: + id: + type: string + description: Question id + type: + type: string + enum: + - daily_questions + DailyQuestionDel: + 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 + DailyQuestionDelKey: + type: object + required: + - id + - type + properties: + id: + type: string + description: Question id + type: + type: string + enum: + - daily_questions + DailyQuestionDetails: + 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: int64 + 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: Correct answer ID + time_for_answer: + type: integer + format: int64 + description: Time for answer + starts_at: + type: string + description: 'Start date when this question is available, hours and minutes are always 0' + example: '2024-08-26T00:00:00Z' + created_at: + type: string + description: Start date when this question was create + example: '2024-08-26T00:00:00Z' + 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 + DailyQuestionDetailsKey: + type: object + required: + - id + - type + properties: + id: + type: string + description: Question id + type: + type: string + enum: + - daily_questions + DailyQuestionEdit: + allOf: + - $ref: '#/components/schemas/DailyQuestionEditKey' + - type: object + required: + - attributes + properties: + attributes: + type: object + properties: + title: + type: string + description: Question title + example: Georgian capital + reward: + type: integer + format: int64 + 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: Correct answer ID + time_for_answer: + type: integer + format: int64 + description: Time for answer + starts_at: + type: string + description: 'Start date when this question is available, hours and minutes are always 0' + example: '2024-08-23' + DailyQuestionEditKey: + type: object + required: + - id + - type + properties: + id: + type: string + description: Question id + type: + type: string + enum: + - daily_questions DailyQuestionOptions: type: object required: