From f51e9f91ab2f58c30455fc2ea03d96bfd526d233 Mon Sep 17 00:00:00 2001 From: ruslan Date: Mon, 25 Sep 2023 10:01:53 +0300 Subject: [PATCH] APIv2 Idea --- v2/swagger.yaml | 601 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 600 insertions(+), 1 deletion(-) diff --git a/v2/swagger.yaml b/v2/swagger.yaml index f296122..a10c41b 100644 --- a/v2/swagger.yaml +++ b/v2/swagger.yaml @@ -1511,6 +1511,228 @@ paths: 500: description: Server Error. + /idea/settings: + get: + tags: + - idea + summary: Idea module settings. + operationId: /idea/settings + responses: + 200: + description: Idea settings object. + content: + application/json: + schema: + $ref: '#/components/schemas/ideaSettings' + 401: + description: Unauthorized request. + 403: + description: Unauthorized request. + 500: + description: Server Error. + + /idea/statuses: + get: + tags: + - idea + summary: Idea statuses list. + operationId: /idea/statuses + responses: + 200: + description: Idea statuses object. + content: + application/json: + schema: + $ref: '#/components/schemas/ideaStatuses' + 401: + description: Unauthorized request. + 403: + description: Unauthorized request. + 500: + description: Server Error. + + /idea/index: + get: + tags: + - idea + summary: Idea index. + operationId: /idea/index + responses: + 200: + description: Idea objects. + content: + application/json: + schema: + $ref: '#/components/schemas/ideaIndex' + 400: + description: Bad Request. + 401: + description: Unauthorized request. + 403: + description: Unauthorized request. + 404: + description: Feedback not found. + 500: + description: Server Error. + + /idea/view: + get: + tags: + - idea + summary: Idea view. + operationId: /idea/view + parameters: + - name: id + in: query + description: Idea ID. + schema: + type: string + required: false + example: edee4e11-dab5-4aac-93ac-43c379aab6b2 + responses: + 200: + description: Idea detailed object. + content: + application/json: + schema: + $ref: '#/components/schemas/ideaView' + 400: + description: Bad Request. + 401: + description: Unauthorized request. + 403: + description: Unauthorized request. + 404: + description: Feedback not found. + 500: + description: Server Error. + + /idea/edit: + post: + tags: + - idea + summary: Idea edit. + operationId: idea/edit + parameters: + - name: id + in: query + description: Idea ID. + schema: + type: string + required: false + example: edee4e11-dab5-4aac-93ac-43c379aab6b2 + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ideaEdit' + responses: + 200: + description: Idea object. + content: + application/json: + schema: + $ref: '#/components/schemas/ideaIndex' + 400: + description: Bad Request. + 401: + description: Unauthorized request. + 403: + description: Unauthorized request. + 404: + description: Feedback not found. + 500: + description: Server Error. + + /idea/vote: + post: + tags: + - idea + summary: Vote for idea. + operationId: idea/vote + parameters: + - name: id + in: query + description: Idea ID. + schema: + type: string + required: true + example: edee4e11-dab5-4aac-93ac-43c379aab6b2 + responses: + 200: + description: Text + content: + application/json: + schema: + type: object + properties: + success: + description: Success status. + type: boolean + example: true + status: + description: Voting status. + type: boolean + example: true + message: + type: string + example: You voted for the idea! + 400: + description: Bad Request. + 401: + description: Unauthorized request. + 403: + description: Unauthorized request. + 404: + description: Feedback not found. + 500: + description: Server Error. + + /idea/participate: + post: + tags: + - idea + summary: Participate an idea. + operationId: idea/participate + parameters: + - name: id + in: query + description: Idea ID. + schema: + type: string + required: true + example: edee4e11-dab5-4aac-93ac-43c379aab6b2 + responses: + 200: + description: Text + content: + application/json: + schema: + type: object + properties: + success: + description: Success status. + type: boolean + example: true + status: + description: Participation status. + type: boolean + example: true + message: + type: string + example: You are participating in the idea! + 400: + description: Bad Request. + 401: + description: Unauthorized request. + 403: + description: Unauthorized request. + 404: + description: Feedback not found. + 500: + description: Server Error. + components: schemas: arrayOfIds: @@ -3321,4 +3543,381 @@ components: type: string name: description: Moderated user name. - type: string \ No newline at end of file + type: string + + ideaSettings: + description: Список настроек модуля идей. + type: object + properties: + isModuleEnabled: + description: Включить сбор идей и запросов. + type: boolean + example: true + isIdeaVotingEnabled: + description: Включить голосование за идею. + type: boolean + example: true + isIdeaUnvoteEnabled: + description: Разрешить отменять голос за идею. + type: boolean + example: true + isIdeaParticipateEnabled: + description: Разрешить присоединяться к реализации идеи. + type: boolean + example: true + isCancelParticipatingEnabled: + description: Разрешить отменять предложение о помощи в реализации идеи. + type: boolean + example: true + isIdeaCommentsEnabled: + description: Разрешить комментировать идеи. + type: boolean + example: true + + ideaStatuses: + description: > + Список статусов идеи: + * `1` - Модерация (STATUS_MODERATION). + * `2` - Отклонена модератором (STATUS_REJECTED_MODERATOR). + * `3` - Голосование (STATUS_VOTING). + * `4` - Отклонена исполнителем (STATUS_REJECTED_MANAGER). + * `5` - Отложена (STATUS_POSTPONED). + * `6` - В работе (STATUS_REALIZATION). + * `7` - Реализована (STATUS_IMPLEMENTED). + type: array + items: + properties: + id: + description: Идентификатор статуса. + type: integer + example: 1 + name: + description: Имя статуса. + type: string + example: Модерация + + ideaIndex: + type: object + properties: + id: + description: Идентификатор идеи. + type: string + format: uuid + example: a91fe4d9-b486-4e94-9114-18589aad7c7e + created_at: + description: Дата создания идеи. + type: string + format: 'date-time' + example: 2023-09-21 18:25:52 + updated_at: + description: Дата изменения идеи. + type: string + format: 'date-time' + example: 2023-09-21 18:31:56 + title: + description: Заголовок идеи. + type: string + example: Idea example title + description: + description: Описание идеи. + type: string + example: Idea example description + isEditable: + # Тут описать когда доступно + description: Доступность редактирования идеи для текущего пользователя. + type: boolean + example: true + status: + description: Статус идеи. + type: object + properties: + id: + type: integer + example: 1 + name: + type: string + example: Модерация + createdUser: + description: Пользователь подавший идею. + type: object + properties: + id: + description: Идентификатор пользователя. + type: string + format: uuid + example: a91fe4d9-b486-4e94-9114-18589aad7c7e + iconUrl: + description: Ссылка на изображение лица профиля пользователя. + type: string + example: https://hrenot.hrbox.io/file/user-face/e2668a74-d171-4d47-b68f-9eb7e7d4e120/300.jpg + name: + description: Имя пользователя. + type: string + example: Иван Иванов + purpose: + description: Направление идеи. + type: object + properties: + id: + description: Идентификатор направления идеи. + type: string + format: uuid + example: a91fe4d9-b486-4e94-9114-18589aad7c7e + name: + description: Название направления идеи. + type: string + example: Направление 1 + department: + description: Подразделение в которое подана идея. + type: object + properties: + id: + description: Идентификатор подразделения. + type: string + format: uuid + example: a91fe4d9-b486-4e94-9114-18589aad7c7e + name: + description: Название подразделения. + type: string + example: Подразделение 1 + viewsCount: + description: Количество пользователей просмотревших идею. + type: integer + example: 1 + countVoted: + description: Количество пользователей проголосовавших за идею. + type: integer + example: 1 + countParticipate: + description: Количество пользователей предложивших помощь в реализации идеи. + type: integer + example: 1 + isAllowVoting: + description: Возможность проголосовать за идею для текущего пользователя. + type: boolean + example: true + isAllowParticipate: + description: Возможность предложить помощь в реализации идеи для текущего пользователя. + type: boolean + example: true + isCurrentUserVoted: + description: Текущий пользователь проголосовал за идею. + type: boolean + example: false + isCurrentUserParticipate: + description: Текущий пользователь предложил помощь в реализации идеи. + type: boolean + example: false + + ideaView: + type: object + properties: + id: + description: Идентификатор идеи. + type: string + format: uuid + example: a91fe4d9-b486-4e94-9114-18589aad7c7e + created_at: + description: Дата создания идеи. + type: string + format: 'date-time' + example: 2023-09-21 18:25:52 + updated_at: + description: Дата изменения идеи. + type: string + format: 'date-time' + example: 2023-09-21 18:31:56 + title: + description: Заголовок идеи. + type: string + example: Idea example title + description: + description: Описание идеи. + type: string + example: Idea example description + isEditable: + # Тут описать когда доступно + description: Доступность редактирования идеи для текущего пользователя. + type: boolean + example: true + status: + description: Статус идеи. + type: object + properties: + id: + type: integer + example: 1 + name: + type: string + example: Модерация + createdUser: + description: Пользователь подавший идею. + type: object + properties: + id: + description: Идентификатор пользователя. + type: string + format: uuid + example: a91fe4d9-b486-4e94-9114-18589aad7c7e + iconUrl: + description: Ссылка на изображение лица профиля пользователя. + type: string + example: https://hrenot.hrbox.io/file/user-face/e2668a74-d171-4d47-b68f-9eb7e7d4e120/300.jpg + name: + description: Имя пользователя. + type: string + example: Иван Иванов + purpose: + description: Направление идеи. + type: object + properties: + id: + description: Идентификатор направления идеи. + type: string + format: uuid + example: a91fe4d9-b486-4e94-9114-18589aad7c7e + name: + description: Название направления идеи. + type: string + example: Направление 1 + department: + description: Подразделение в которое подана идея. + type: object + properties: + id: + description: Идентификатор подразделения. + type: string + format: uuid + example: a91fe4d9-b486-4e94-9114-18589aad7c7e + name: + description: Название подразделения. + type: string + example: Подразделение 1 + viewsCount: + description: Количество пользователей просмотревших идею. + type: integer + example: 1 + countVoted: + description: Количество пользователей проголосовавших за идею. + type: integer + example: 1 + countParticipate: + description: Количество пользователей предложивших помощь в реализации идеи. + type: integer + example: 1 + usersVoted: + description: Список пользователей проголосовавших за идею. + type: array + items: + properties: + id: + description: Идентификатор пользователя. + type: string + format: uuid + example: a91fe4d9-b486-4e94-9114-18589aad7c7e + iconUrl: + description: Ссылка на изображение лица профиля пользователя. + type: string + example: https://hrenot.hrbox.io/file/user-face/e2668a74-d171-4d47-b68f-9eb7e7d4e120/300.jpg + name: + description: Имя пользователя. + type: string + example: Иван Иванов + usersParticipate: + description: Список пользователей предложивших помощь в реализации идеи. + type: array + items: + properties: + id: + description: Идентификатор пользователя. + type: string + format: uuid + example: a91fe4d9-b486-4e94-9114-18589aad7c7e + iconUrl: + description: Ссылка на изображение лица профиля пользователя. + type: string + example: https://hrenot.hrbox.io/file/user-face/e2668a74-d171-4d47-b68f-9eb7e7d4e120/300.jpg + name: + description: Имя пользователя. + type: string + example: Иван Иванов + isAllowVoting: + description: Возможность проголосовать за идею для текущего пользователя. + type: boolean + example: true + isAllowParticipate: + description: Возможность предложить помощь в реализации идеи для текущего пользователя. + type: boolean + example: true + isCurrentUserVoted: + description: Текущий пользователь проголосовал за идею. + type: boolean + example: false + isCurrentUserParticipate: + description: Текущий пользователь предложил помощь в реализации идеи. + type: boolean + example: false + files: + description: Список файлов прикрепленных к идее. + type: array + items: + type: object + properties: + id: + description: Идентификатор файла. + type: string + format: uuid + example: bf052a5e-eb70-4eb9-b3f1-9ea50d751b0e + url: + description: Адрес размещения файла. + type: string + example: https://hrenot.hrbox.io/file/open/96cf98ed-2762-4f6b-9a5b-3eca76c56477.jpg + file_ype: + description: Тип файла. + type: string + enum: + - image + - video + - document + - archive + - other + - encrypted + example: image + ext: + description: Расширение файла. + type: string + example: jpg + name: + description: Имя файла. + type: string + example: 2023-01-01 01.01.01.jpg + + ideaEdit: + type: object + properties: + title: + description: Заголовок идеи. + type: string + example: Idea example title + description: + description: Описание идеи. + type: string + example: Idea example description + department_id: + description: Идентификатор подразделения. + type: string + format: uuid + example: a91fe4d9-b486-4e94-9114-18589aad7c7e + purpose_id: + description: Идентификатор направления идеи. + type: string + format: uuid + example: bf052a5e-eb70-4eb9-b3f1-9ea50d751b0e + files: + description: Идентификаторы файлов. + type: array + items: + type: string + example: + - '53f2d03c-303a-4a3c-b57f-f7fb62fee538' + - '42862a16-affa-4ba5-86c5-61376f46d695' \ No newline at end of file