This commit is contained in:
ruslan
2023-01-26 18:04:12 +02:00
parent b5a55de5d6
commit 1019b466e0
+114
View File
@@ -831,6 +831,120 @@ paths:
500:
description: Server Error
/feedback/add:
post:
tags:
- feedback
operationId: actionAdd
summary: Creates a feedback about a department or user.
consumes:
- application/json
produces:
- application/json
parameters:
- name: userId
description: User ID from which the feedback will be created.
in: body
required: false
schema:
type: string
example: cd1a4391-9fa7-4ae3-80c1-f9b46ad1838d
- name: type
description: Entity type.
in: body
required: true
schema:
type: string
enum: [ department, user ]
example: department
- name: id
description: Entity id.
in: body
required: true
schema:
type: string
example: cd1a4391-9fa7-4ae3-80c1-f9b46ad1838d
- name: score
description: Feedback score.
in: body
required: true
schema:
type: number
minimum: 1
maximum: 5
example: 5
- name: text
description: Feedback text.
in: body
required: true
schema:
type: string
example: Example text.
- name: isAnonymous
description: Anonymous feedback.
in: body
required: false
schema:
type: boolean
example: true
responses:
200:
description: Returns the success status and data of the generated feedback.
schema:
type: object
properties:
success:
type: boolean
feedback:
type: object
properties:
id:
description: Feedback model ID.
type: string
example: 77a14e58-7de2-4f50-bd1c-d2904f2a7b79
user_id:
description: User model ID.
type: string
example: null
department_id:
description: Department model ID.
type: string
example: f1e2972e-4655-4f93-bb54-733df3ddbc83
score:
description: Feedback score.
type: number
example: 5
text:
description: Feedback text.
type: string
example: Example text.
is_anonymous:
description: Anonymous feedback.
type: boolean
example: false
user_name:
description: The user name to which the feedback was left.
type: string
example: ""
department_name:
description: The department name to which the feedback was left.
type: string
example: "Fast food department"
created_user_name:
description: The user name of the person who left the feedback.
type: string
example: "Colonel Sanders"
400:
description: Bad Request. Returns a message with the error details.
401:
description: Unathorized request.
403:
description: Forbidden.
404:
description: Not found. Returns a message with the error details.
500:
description: Server Error.
definitions:
accountSecret: