From aafede834fc07af1875bfba195ee48b19db9d4ba Mon Sep 17 00:00:00 2001 From: Anton Pomorzin Date: Wed, 28 May 2025 16:07:12 +0500 Subject: [PATCH] =?UTF-8?q?feat:=20api=20v2=20=D1=86=D0=B5=D0=BB=D0=B5?= =?UTF-8?q?=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- v2/swagger.yaml | 643 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 643 insertions(+) diff --git a/v2/swagger.yaml b/v2/swagger.yaml index 704de62..43a778f 100644 --- a/v2/swagger.yaml +++ b/v2/swagger.yaml @@ -4906,6 +4906,447 @@ paths: description: Unauthorized request. 403: description: Unauthorized request. + + /goal/my: + get: + tags: + - goal + summary: Список целей пользователя + parameters: + - $ref: '#/components/parameters/title' + - $ref: '#/components/parameters/goalIntervalTypeId' + - $ref: '#/components/parameters/goalStatusId' + - $ref: '#/components/parameters/goalDate' + - $ref: '#/components/parameters/goalMonth' + - $ref: '#/components/parameters/goalQuarter' + - $ref: '#/components/parameters/goalYear' + - $ref: '#/components/parameters/noRemoved' + - $ref: '#/components/parameters/noDraft' + - $ref: '#/components/parameters/goalParentId' + responses: + $ref: '#/components/responses/GoalActionResponse' + + /goal/supervise: + get: + tags: + - goal + summary: Курируемые цели пользователя + parameters: + - $ref: '#/components/parameters/title' + - $ref: '#/components/parameters/goalStatusId' + - $ref: '#/components/parameters/goalIntervalTypeId' + - $ref: '#/components/parameters/goalDate' + - $ref: '#/components/parameters/goalMonth' + - $ref: '#/components/parameters/goalQuarter' + - $ref: '#/components/parameters/goalYear' + - $ref: '#/components/parameters/goalYear' + - $ref: '#/components/parameters/noRemoved' + - $ref: '#/components/parameters/noDraft' + - $ref: '#/components/parameters/goalParentId' + responses: + $ref: '#/components/responses/GoalActionResponse' + + /goal/archive: + get: + tags: + - goal + summary: Архив целей пользователя + parameters: + - $ref: '#/components/parameters/title' + - $ref: '#/components/parameters/goalStatusId' + - $ref: '#/components/parameters/goalDate' + - $ref: '#/components/parameters/goalMonth' + - $ref: '#/components/parameters/goalQuarter' + - $ref: '#/components/parameters/goalYear' + - $ref: '#/components/parameters/noRemoved' + - $ref: '#/components/parameters/noDraft' + - $ref: '#/components/parameters/goalParentId' + - $ref: '#/components/parameters/goalIntervalTypeId' + responses: + $ref: '#/components/responses/GoalActionResponse' + + /goal/view: + get: + tags: + - goal + summary: Просмотр цели + parameters: + - name: id + in: query + schema: + type: string + responses: + 200: + description: Список целей + content: + application/json: + schema: + type: object + properties: + data: + type: object + allOf: + - $ref: '#/components/schemas/GoalItem' + - type: object + properties: + content: + type: string + goalLog: + type: object + _links: + $ref: '#/components/schemas/_links' + _meta: + $ref: '#/components/schemas/_meta' + 400: + description: Bad Request. + 401: + description: Unauthorized. + 403: + description: Unauthorized. + 404: + description: Not found. + 500: + description: Server Error. + + /goal/edit: + post: + tags: + - goal + summary: Создание/редактирование цели + operationId: /goal/edit + parameters: + - name: id + in: query + description: Goal ID. + schema: + type: string + required: false + example: edee4e11-dab5-4aac-93ac-43c379aab6b2 + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/GoalItem' + responses: + 200: + description: Goal object. + content: + application/json: + schema: + $ref: '#/components/schemas/GoalItem' + 400: + description: Bad Request. + 401: + description: Unauthorized. + 403: + description: Unauthorized. + 404: + description: Feedback not found. + 500: + description: Server Error. + + /goal/submit: + post: + tags: + - goal + summary: Отправить цели на согласование + operationId: /goal/submit + description: Можно передавать массив целей, обязательным полем является только id. Остальные поля, если указаны, будут использованы для обновления целей перед отправкой на согласование. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/GoalItem' + responses: + $ref: '#/components/responses/GoalActionResponse' + + /goal/approve: + post: + tags: + - goal + summary: Одобрить цели + description: Можно передавать массив целей, обязательным полем является только id. Остальные поля, если указаны, будут использованы для обновления целей перед одобрением цели куратором. + operationId: /goal/approve + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/GoalItem' + responses: + $ref: '#/components/responses/GoalActionResponse' + + /goal/reject: + post: + tags: + - goal + summary: Отклонить цели + description: Можно передавать массив целей, обязательным полем является только id. Остальные поля, если указаны, будут использованы для обновления целей перед отклонением цели. + operationId: /goal/reject + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/GoalItem' + responses: + $ref: '#/components/responses/GoalActionResponse' + + /goal/finish: + post: + tags: + - goal + summary: Завершить цели + description: Можно передавать массив целей, обязательным полем является только id. Остальные поля, если указаны, будут использованы для обновления целей перед завершением. + operationId: /goal/finish + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/GoalItem' + responses: + $ref: '#/components/responses/GoalActionResponse' + + /goal/remove: + post: + tags: + - goal + summary: Удалить цели + operationId: /goal/remove + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + id: + type: array + items: + type: string + format: uuid + responses: + $ref: '#/components/responses/GoalActionResponse' + + /goal/bind: + post: + tags: + - goal + summary: Привязать цели + operationId: /goal/bind + parameters: + - name: id + in: query + description: ID родительской цели + schema: + type: string + required: false + example: edee4e11-dab5-4aac-93ac-43c379aab6b2 + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + id: + type: array + items: + type: string + format: uuid + description: Цели которые необходимо привязать + responses: + $ref: '#/components/responses/GoalActionResponse' + + /goal/unbind: + post: + tags: + - goal + summary: Отвязать цели + description: Необходимо передавать id дочерних целей + operationId: /goal/unbind + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + id: + type: array + items: + type: string + format: uuid + responses: + $ref: '#/components/responses/GoalActionResponse' + + /goal-report/users: + post: + tags: + - goalReport + summary: Отчет по сотрудникам + operationId: goalReportUsers + requestBody: + content: + application/json: + schema: + type: object + properties: + department_id: + description: ID отделов (может быть несколько) + type: array + items: + type: string + goal_interval_type_id: + $ref: '#/components/parameters/goalIntervalTypeId' + period_goal_date: + type: array + items: + type: string + format: date + minItems: 2 + maxItems: 2 + description: Массив из двух дат, начала и конца периода + searchInAllSubDepartments: + type: integer + enum: [0, 1] + description: Поиск по всем вложенным отделам + user_id: + type: array + items: + type: string + format: uuid + description: Сотрудник, можно список через запятую + type: + type: string + enum: [result, rating] + description: Переод отчета + period: + type: string + enum: [month, quarter, half_year, year] + description: Переод отчета + responses: + 200: + description: Успешный ответ с отчётом по сотрудникам + content: + application/json: + schema: + type: object + properties: + params: + type: object + description: Параметры отчета + properties: + years: + type: array + items: + type: integer + description: Список лет, по которым строится отчет + period: + type: string + description: Периодичность отчета (например, "month") + periods: + type: object + description: Сопоставление номера периода с названием (локализованным) + additionalProperties: + type: string + data: + type: array + description: Список сотрудников с отчетными данными + items: + type: object + properties: + user: + type: object + description: Информация о сотруднике + properties: + id: + type: string + format: uuid + description: Идентификатор сотрудника + name: + type: string + description: Полное имя сотрудника + faceUrl: + type: string + years: + type: object + description: Данные по годам + additionalProperties: + type: object + properties: + periods: + type: object + description: Отчетные данные по периодам внутри года + additionalProperties: + type: object + properties: + scaled: + type: string + scaledString: + type: string + count: + type: integer + description: Количество целей + _meta: + $ref: '#/components/schemas/_meta' + 422: + description: Bad Request + 403: + description: Unauthorized + 500: + description: Server Error + + /goal-report/tree: + get: + tags: + - goalReport + summary: Отчет по целям "Дерево целей" + operationId: goalReportTree + parameters: + - $ref: '#/components/parameters/goalStatusId' + - $ref: '#/components/parameters/goalIntervalTypeId' + - $ref: '#/components/parameters/goalYear' + - $ref: '#/components/parameters/goalMonth' + - $ref: '#/components/parameters/goalQuarter' + - $ref: '#/components/parameters/title' + - name: user_id + in: query + schema: + type: string + example: 9f7063d1-959e-4c32-b186-313576375739 + description: ID сотрудников "Чья цель", можно перечислять через запятую + - name: supervisor_id + in: query + schema: + type: string + example: 9f7063d1-959e-4c32-b186-313576375739 + description: ID сотрудников "Куратор", можно перечислять через запятую + responses: + $ref: '#/components/responses/GoalActionResponse' components: securitySchemes: @@ -8929,6 +9370,71 @@ components: - 1 - 2 - 3 + + GoalItem: + type: object + properties: + id: + type: string + format: uuid + created_at: + type: string + format: date-time + title: + type: string + description: Заголовок цели + weight: + type: number + description: "Вес" + goal_interval_type_id: + $ref: '#/components/parameters/goalIntervalTypeId' + goal_status_id: + $ref: '#/components/parameters/goalStatusId' + goal_result_type_id: + type: number + description: > + Тип результата: + * `1` - Да/нет + * `2` - Процент + * `3` - Число" + goal_date: + $ref: '#/components/parameters/goalDate' + result_scaled: + type: number + format: double + description: Процент результата от целевого значения + result_max: + type: number + description: Целевое число + result_units: + type: string + description: Единицы измерения + sort_index: + type: number + description: Сортировка + parent_id: + type: string + format: uuid + description: Цель, в которую вложена + user_id: + type: string + format: uuid + description: Чья цель + supervisor_id: + type: string + format: uuid + description: Куратор + participants: + type: array + items: + type: string + description: Участники + result: + type: number + description: Результат цели + rating: + type: string + description: Рейтинг цели parameters: boardDateTypeParam: @@ -8986,6 +9492,143 @@ components: description: UUID списка пользователей schema: type: string + title: + name: title + in: query + schema: + type: string + description: Поиск по названию + goalIntervalTypeId: + name: goal_interval_type_id + in: query + schema: + type: number + description: > + Тип интервала дедлайна + * `1` - На день + * `2` - На неделю + * `3` - На месяц + * `4` - На квартал + * `5` - На полугодие + * `6` - На год + goalStatusId: + name: goal_status_id + in: query + schema: + type: number + description: > + Статус цели, можно перечислять через запятую + * `1` - Черновик + * `2` - Согласование + * `3` - В процессе + * `4` - Согласование результата + * `5` - Завершена + * `6` - Согласование удаления + * `7` - Удалена + goalDate: + name: goal_date + in: query + schema: + type: string + description: Дата завершения цели + goalMonth: + name: goal_month + in: query + schema: + type: string + description: Месяц завершения цели + goalQuarter: + name: goal_quarter + in: query + schema: + type: integer + enum: [1, 2, 3, 4] + description: Квартал завершения цели + goalYear: + name: goal_year + in: query + schema: + type: integer + description: Год завершения цели + goalParentId: + name: parent_id + in: query + schema: + type: string + description: Родительский элемент + noRemoved: + name: no_removed + in: query + schema: + type: string + description: Без удаленных + noDraft: + name: no_draft + in: query + schema: + type: string + description: Без черновиков + + responses: + GoalIndexResponse: + 200: + description: Список целей + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + type: array + items: + $ref: '#/components/schemas/GoalItem' + _links: + $ref: '#/components/schemas/_links' + _meta: + $ref: '#/components/schemas/_meta' + 400: + description: Bad Request. + 403: + description: Unauthorized. + 404: + description: Not found. + 500: + description: Server Error. + + GoalActionResponse: + 200: + description: Goal object + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + deleted: + type: array + items: + $ref: '#/components/schemas/GoalItem' + description: Цели которые были удалены + updated: + type: array + items: + $ref: '#/components/schemas/GoalItem' + description: Цели которые были обновлены + skipped: + type: array + items: + $ref: '#/components/schemas/GoalItem' + description: Цели которые не были обработаны + 422: + description: Bad Request + 403: + description: Unauthorized + 500: + description: Server Error + security: - SessionAuth: [ ] - ApiKeyAuth: [ ] \ No newline at end of file