ruspet_portal_back/service/rest_admin_service/docs/swagger.json

3966 lines
148 KiB
JSON
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"swagger": "2.0",
"info": {
"description": "API админ-панели для системы согласований\n\n## Возможности\n- Управление отделами, ролями и пользователями\n- Настройка тем и категорий согласований\n- Управление иерархией согласований\n- Назначение исполнителей и прав\n- Просмотр заявок и шагов согласования\n\n## Аутентификация\nВсе защищённые эндпоинты требуют:\n- `Authorization: Bearer \u003cJWT_TOKEN\u003e` — JWT токен администратора\n- `ApiKey: \u003cHMAC_SIGNATURE\u003e` — HMAC подпись для верификации клиента\n- `X-Timestamp: \u003cUNIX_TIMESTAMP\u003e` — Unix timestamp (не старше 3 минут)\n- `x-device-id: \u003cDEVICE_ID\u003e` — ID устройства",
"title": "RusPet Admin API",
"contact": {},
"version": "0.1"
},
"host": "localhost:8080",
"basePath": "/",
"paths": {
"/api/admin": {
"get": {
"description": "Получение списка администраторов",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "Получение списка администраторов",
"parameters": [
{
"type": "integer",
"description": "Смещение для пагинации",
"name": "offset",
"in": "query"
},
{
"type": "integer",
"description": "Количество записей на странице",
"name": "limit",
"in": "query"
},
{
"type": "boolean",
"description": "Фильтр по активности",
"name": "is_active",
"in": "query"
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.Admin"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"post": {
"description": "Создание администратора",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "Создание администратора",
"parameters": [
{
"description": "Запрос",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.AdminReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/typescore.Admin"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"description": "Удаление администратора",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "Удаление администратора",
"parameters": [
{
"description": "Запрос",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.AdminReq"
}
}
],
"responses": {
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/api/admin/profile": {
"get": {
"description": "Получение профиля пользователя",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"profile"
],
"summary": "Получение профиля пользователя",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/typescore.Admin"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"put": {
"description": "Обновление профиля пользователя",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"profile"
],
"summary": "Обновление профиля пользователя",
"parameters": [
{
"description": "Запрос",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.AdminReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/typescore.Admin"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/api/approval-steps": {
"get": {
"description": "Получение списка шагов согласования с пагинацией и фильтрацией",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"approval-steps"
],
"summary": "Получение списка шагов",
"parameters": [
{
"type": "integer",
"description": "Смещение для пагинации",
"name": "offset",
"in": "query"
},
{
"type": "integer",
"description": "Количество записей на странице",
"name": "limit",
"in": "query"
},
{
"type": "integer",
"description": "Фильтр по заявке",
"name": "approval_id",
"in": "query"
},
{
"type": "integer",
"description": "Фильтр по согласующему",
"name": "approver_id",
"in": "query"
},
{
"type": "string",
"description": "Фильтр по статусу (pending, waiting, approved, rejected, cancelled_any_of)",
"name": "status",
"in": "query"
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.ApiResponseBase"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"put": {
"description": "Обновление данных шага согласования (статус, комментарий)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"approval-steps"
],
"summary": "Обновление шага",
"parameters": [
{
"description": "Данные шага",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.ApprovalStep"
}
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.ApprovalStep"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Шаг не найден",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"post": {
"description": "Создание нового шага согласования для заявки",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"approval-steps"
],
"summary": "Создание шага",
"parameters": [
{
"description": "Данные шага",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.ApprovalStep"
}
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.ApprovalStep"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Заявка или согласующий не найдены",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"description": "Удаление шага согласования (только для заявок в статусе pending)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"approval-steps"
],
"summary": "Удаление шага",
"parameters": [
{
"description": "ID шага для удаления",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.ApprovalStep"
}
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"type": "boolean"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Нельзя удалить шаг завершённой заявки",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Шаг не найден",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/api/approval-steps/by-approval/{approval_id}": {
"get": {
"description": "Получение списка всех шагов согласования для указанной заявки, отсортированных по step_order",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"approval-steps"
],
"summary": "Получение шагов по заявке",
"parameters": [
{
"type": "integer",
"description": "ID заявки",
"name": "approval_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.ApiResponseBase"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Заявка не найдена",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/api/approval-steps/{id}": {
"get": {
"description": "Получение детальной информации о шаге согласования по его ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"approval-steps"
],
"summary": "Получение шага по ID",
"parameters": [
{
"type": "integer",
"description": "ID шага",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.ApprovalStep"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Шаг не найден",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/api/approvals": {
"get": {
"description": "Получение списка заявок с пагинацией и фильтрацией",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"approvals"
],
"summary": "Получение списка заявок",
"parameters": [
{
"type": "integer",
"description": "Смещение для пагинации",
"name": "offset",
"in": "query"
},
{
"type": "integer",
"description": "Количество записей на странице",
"name": "limit",
"in": "query"
},
{
"type": "string",
"description": "Фильтр по статусу (pending, approved, rejected, revoked, revision)",
"name": "status",
"in": "query"
},
{
"type": "integer",
"description": "Фильтр по инициатору",
"name": "initiator_id",
"in": "query"
},
{
"type": "integer",
"description": "Фильтр по теме",
"name": "topic_id",
"in": "query"
},
{
"type": "integer",
"description": "Фильтр по отделу",
"name": "department_id",
"in": "query"
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.ApiResponseBase"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"put": {
"description": "Обновление данных заявки (статус, комментарии и т.д.)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"approvals"
],
"summary": "Обновление заявки",
"parameters": [
{
"description": "Данные заявки",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.Approval"
}
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.Approval"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Заявка не найдена",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"description": "Удаление заявки (только для черновиков)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"approvals"
],
"summary": "Удаление заявки",
"parameters": [
{
"description": "ID заявки для удаления",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.Approval"
}
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"type": "boolean"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Нельзя удалить не-черновую заявку",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Заявка не найдена",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/api/approvals/report": {
"get": {
"description": "Получение списка заявок для отчёта с учётом периода и доступа пользователя",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"approvals"
],
"summary": "Получение заявок для отчёта",
"parameters": [
{
"type": "integer",
"description": "ID пользователя (если не указан - все заявки)",
"name": "user_id",
"in": "query"
},
{
"type": "string",
"description": "Начальная дата (YYYY-MM-DD)",
"name": "date_from",
"in": "query"
},
{
"type": "string",
"description": "Конечная дата (YYYY-MM-DD)",
"name": "date_to",
"in": "query"
},
{
"type": "boolean",
"description": "Полный доступ (игнорировать фильтрацию по пользователю)",
"name": "all_access",
"in": "query"
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.ApiResponseBase"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/api/approvals/{id}": {
"get": {
"description": "Получение детальной информации о заявке по её ID со всеми связанными данными",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"approvals"
],
"summary": "Получение заявки по ID",
"parameters": [
{
"type": "integer",
"description": "ID заявки",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.Approval"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Заявка не найдена",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/api/auth/login": {
"post": {
"description": "авторизация с помощью связки логин-пароль",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"auth"
],
"summary": "авторизация с помощью связки логин-пароль",
"parameters": [
{
"description": "Запрос",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.AuthReqAccount"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/typescore.AuthHandlerResponse"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/api/auth/token": {
"post": {
"description": "Авторизация при помощи JWT-токена",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"auth"
],
"summary": "Авторизация при помощи JWT-токена",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/typescore.AuthHandlerResponse"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/api/categories": {
"get": {
"description": "Получение списка категорий тем с пагинацией и фильтрацией",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"categories"
],
"summary": "Получение списка категорий тем",
"parameters": [
{
"type": "integer",
"description": "Смещение для пагинации",
"name": "offset",
"in": "query"
},
{
"type": "integer",
"description": "Количество записей на странице",
"name": "limit",
"in": "query"
},
{
"type": "boolean",
"description": "Фильтр по активности",
"name": "is_active",
"in": "query"
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.ApiResponseBase"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"put": {
"description": "Обновление данных существующей категории",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"categories"
],
"summary": "Обновление категории",
"parameters": [
{
"description": "Данные категории",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.ApprovalTopicCategory"
}
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.ApprovalTopicCategory"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Категория не найдена",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"post": {
"description": "Создание новой категории тем",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"categories"
],
"summary": "Создание категории тем",
"parameters": [
{
"description": "Данные категории",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.ApprovalTopicCategory"
}
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.ApprovalTopicCategory"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"description": "Удаление категории по ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"categories"
],
"summary": "Удаление категории",
"parameters": [
{
"description": "ID категории для удаления",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.ApprovalTopicCategory"
}
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"type": "boolean"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Категория не найдена",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"409": {
"description": "Категория содержит темы",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/api/categories/{id}": {
"get": {
"description": "Получение детальной информации о категории по её ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"categories"
],
"summary": "Получение категории по ID",
"parameters": [
{
"type": "integer",
"description": "ID категории",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.ApprovalTopicCategory"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Категория не найдена",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/api/departments": {
"get": {
"description": "Получение списка отделов с пагинацией и фильтрацией",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"departments"
],
"summary": "Получение списка отделов",
"parameters": [
{
"type": "integer",
"description": "Смещение для пагинации",
"name": "offset",
"in": "query"
},
{
"type": "integer",
"description": "Количество записей на странице",
"name": "limit",
"in": "query"
},
{
"type": "boolean",
"description": "Фильтр по активности",
"name": "is_active",
"in": "query"
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.ApiResponseBase"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"put": {
"description": "Обновление данных существующего отдела",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"departments"
],
"summary": "Обновление отдела",
"parameters": [
{
"description": "Данные отдела",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.Department"
}
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.Department"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Отдел не найден",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"post": {
"description": "Создание нового отдела",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"departments"
],
"summary": "Создание отдела",
"parameters": [
{
"description": "Данные отдела",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.Department"
}
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.Department"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"description": "Удаление отдела по ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"departments"
],
"summary": "Удаление отдела",
"parameters": [
{
"description": "ID отдела для удаления",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.Department"
}
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"type": "boolean"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Отдел не найден",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/api/departments/{id}": {
"get": {
"description": "Получение детальной информации об отделе по его ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"departments"
],
"summary": "Получение отдела по ID",
"parameters": [
{
"type": "integer",
"description": "ID отдела",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.Department"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Отдел не найден",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/api/hierarchies": {
"get": {
"description": "Получение списка связей подчинённый-согласующий с пагинацией и фильтрацией",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"hierarchies"
],
"summary": "Получение списка записей иерархии",
"parameters": [
{
"type": "integer",
"description": "Смещение для пагинации",
"name": "offset",
"in": "query"
},
{
"type": "integer",
"description": "Количество записей на странице",
"name": "limit",
"in": "query"
},
{
"type": "integer",
"description": "Фильтр по подчинённому",
"name": "subordinate_id",
"in": "query"
},
{
"type": "integer",
"description": "Фильтр по согласующему",
"name": "approver_id",
"in": "query"
},
{
"type": "integer",
"description": "Фильтр по отделу",
"name": "department_id",
"in": "query"
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.ApiResponseBase"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"put": {
"description": "Обновление данных существующей записи иерархии",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"hierarchies"
],
"summary": "Обновление записи иерархии",
"parameters": [
{
"description": "Данные иерархии",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.UserHierarchy"
}
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.UserHierarchy"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Запись не найдена",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"post": {
"description": "Создание новой связи подчинённый-согласующий",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"hierarchies"
],
"summary": "Создание записи иерархии",
"parameters": [
{
"description": "Данные иерархии",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.UserHierarchy"
}
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.UserHierarchy"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"409": {
"description": "Такая связь уже существует",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"description": "Удаление связи подчинённый-согласующий по ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"hierarchies"
],
"summary": "Удаление записи иерархии",
"parameters": [
{
"description": "ID записи для удаления",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.UserHierarchy"
}
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"type": "boolean"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Запись не найдена",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/api/hierarchies/{id}": {
"get": {
"description": "Получение детальной информации о записи иерархии по её ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"hierarchies"
],
"summary": "Получение записи иерархии по ID",
"parameters": [
{
"type": "integer",
"description": "ID записи",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.UserHierarchy"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Запись не найдена",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/api/permissions": {
"get": {
"description": "Получение списка прав ролей с пагинацией и фильтрацией",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"permissions"
],
"summary": "Получение списка прав",
"parameters": [
{
"type": "integer",
"description": "Смещение для пагинации",
"name": "offset",
"in": "query"
},
{
"type": "integer",
"description": "Количество записей на странице",
"name": "limit",
"in": "query"
},
{
"type": "integer",
"description": "Фильтр по роли",
"name": "role_id",
"in": "query"
},
{
"type": "string",
"description": "Фильтр по действию (create, read, update, delete, approve, revoke)",
"name": "action",
"in": "query"
},
{
"type": "integer",
"description": "Фильтр по категории тем",
"name": "topic_category_id",
"in": "query"
},
{
"type": "integer",
"description": "Фильтр по теме",
"name": "topic_id",
"in": "query"
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.ApiResponseBase"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"put": {
"description": "Обновление данных существующего права",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"permissions"
],
"summary": "Обновление права",
"parameters": [
{
"description": "Данные права",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.Permission"
}
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.Permission"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Право не найдено",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"post": {
"description": "Назначение права на действие для роли",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"permissions"
],
"summary": "Создание права",
"parameters": [
{
"description": "Данные права",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.Permission"
}
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.Permission"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Роль, категория или тема не найдены",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"409": {
"description": "Такое право уже существует",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"description": "Удаление права по ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"permissions"
],
"summary": "Удаление права",
"parameters": [
{
"description": "ID права для удаления",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.Permission"
}
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"type": "boolean"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Право не найдено",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/api/permissions/by-role/{role_id}": {
"get": {
"description": "Получение списка всех прав для указанной роли",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"permissions"
],
"summary": "Получение прав по роли",
"parameters": [
{
"type": "integer",
"description": "ID роли",
"name": "role_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.ApiResponseBase"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Роль не найдена",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/api/permissions/{id}": {
"get": {
"description": "Получение детальной информации о праве по его ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"permissions"
],
"summary": "Получение права по ID",
"parameters": [
{
"type": "integer",
"description": "ID права",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.Permission"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Право не найдено",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/api/roles": {
"get": {
"description": "Получение списка ролей с пагинацией и фильтрацией",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"roles"
],
"summary": "Получение списка ролей",
"parameters": [
{
"type": "integer",
"description": "Смещение для пагинации",
"name": "offset",
"in": "query"
},
{
"type": "integer",
"description": "Количество записей на странице",
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.ApiResponseBase"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"put": {
"description": "Обновление данных существующей роли",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"roles"
],
"summary": "Обновление роли",
"parameters": [
{
"description": "Данные роли",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.Role"
}
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.Role"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Роль не найдена",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"post": {
"description": "Создание новой роли",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"roles"
],
"summary": "Создание роли",
"parameters": [
{
"description": "Данные роли",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.Role"
}
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.Role"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"description": "Удаление роли по ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"roles"
],
"summary": "Удаление роли",
"parameters": [
{
"description": "ID роли для удаления",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.Role"
}
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"type": "boolean"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Роль не найдена",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/api/roles/{id}": {
"get": {
"description": "Получение детальной информации о роли по её ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"roles"
],
"summary": "Получение роли по ID",
"parameters": [
{
"type": "integer",
"description": "ID роли",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.Role"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Роль не найдена",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/api/topic-executors": {
"get": {
"description": "Получение списка исполнителей с пагинацией и фильтрацией",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"topic-executors"
],
"summary": "Получение списка исполнителей тем",
"parameters": [
{
"type": "integer",
"description": "Смещение для пагинации",
"name": "offset",
"in": "query"
},
{
"type": "integer",
"description": "Количество записей на странице",
"name": "limit",
"in": "query"
},
{
"type": "integer",
"description": "Фильтр по теме",
"name": "topic_id",
"in": "query"
},
{
"type": "integer",
"description": "Фильтр по пользователю",
"name": "user_id",
"in": "query"
},
{
"type": "boolean",
"description": "Фильтр по активности",
"name": "is_active",
"in": "query"
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.ApiResponseBase"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"put": {
"description": "Обновление данных исполнителя для темы",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"topic-executors"
],
"summary": "Обновление исполнителя",
"parameters": [
{
"description": "Данные исполнителя",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.ApprovalTopicExecutor"
}
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.ApprovalTopicExecutor"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Исполнитель не найден",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"post": {
"description": "Назначение исполнителя для конкретной темы согласования",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"topic-executors"
],
"summary": "Создание исполнителя",
"parameters": [
{
"description": "Данные исполнителя",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.ApprovalTopicExecutor"
}
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.ApprovalTopicExecutor"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Тема или пользователь не найдены",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"409": {
"description": "Такой исполнитель уже назначен на этот шаг",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"description": "Удаление исполнителя из темы по ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"topic-executors"
],
"summary": "Удаление исполнителя",
"parameters": [
{
"description": "ID записи для удаления",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.ApprovalTopicExecutor"
}
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"type": "boolean"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Запись не найдена",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/api/topic-executors/by-topic/{topic_id}": {
"get": {
"description": "Получение списка всех активных исполнителей для указанной темы, отсортированных по step_order",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"topic-executors"
],
"summary": "Получение исполнителей по теме",
"parameters": [
{
"type": "integer",
"description": "ID темы",
"name": "topic_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.ApiResponseBase"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Тема не найдена",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/api/topic-executors/{id}": {
"get": {
"description": "Получение детальной информации об исполнителе по его ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"topic-executors"
],
"summary": "Получение исполнителя по ID",
"parameters": [
{
"type": "integer",
"description": "ID исполнителя",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.ApprovalTopicExecutor"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Исполнитель не найден",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/api/topics": {
"get": {
"description": "Получение списка тем с пагинацией и фильтрацией",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"topics"
],
"summary": "Получение списка тем",
"parameters": [
{
"type": "integer",
"description": "Смещение для пагинации",
"name": "offset",
"in": "query"
},
{
"type": "integer",
"description": "Количество записей на странице",
"name": "limit",
"in": "query"
},
{
"type": "integer",
"description": "Фильтр по категории",
"name": "category_id",
"in": "query"
},
{
"type": "boolean",
"description": "Фильтр по активности",
"name": "is_active",
"in": "query"
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.ApiResponseBase"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"put": {
"description": "Обновление данных существующей темы",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"topics"
],
"summary": "Обновление темы",
"parameters": [
{
"description": "Данные темы",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.ApprovalTopic"
}
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.ApprovalTopic"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Тема не найдена",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"post": {
"description": "Создание новой темы согласования",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"topics"
],
"summary": "Создание темы",
"parameters": [
{
"description": "Данные темы",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.ApprovalTopic"
}
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.ApprovalTopic"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"description": "Удаление темы по ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"topics"
],
"summary": "Удаление темы",
"parameters": [
{
"description": "ID темы для удаления",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.ApprovalTopic"
}
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"type": "boolean"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Тема не найдена",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"409": {
"description": "Тема содержит заявки",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/api/topics/{id}": {
"get": {
"description": "Получение детальной информации о теме по её ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"topics"
],
"summary": "Получение темы по ID",
"parameters": [
{
"type": "integer",
"description": "ID темы",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.ApprovalTopic"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Тема не найдена",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/api/user-roles": {
"get": {
"description": "Получение списка ролей, назначенных конкретному пользователю",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user-roles"
],
"summary": "Получение списка ролей пользователя",
"parameters": [
{
"type": "integer",
"description": "ID пользователя",
"name": "user_id",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.ApiResponseBase"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"post": {
"description": "Назначение роли пользователю (создание связи user_id + role_id)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user-roles"
],
"summary": "Назначение роли пользователю",
"parameters": [
{
"description": "user_id и role_id",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers_user_roles.AssignUserRoleRequest"
}
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.UserRole"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Пользователь или роль не найдены",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"409": {
"description": "Роль уже назначена",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"description": "Удаление связи user_id + role_id по ID записи",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user-roles"
],
"summary": "Удаление роли у пользователя",
"parameters": [
{
"description": "ID записи для удаления",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.UserRole"
}
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"type": "boolean"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Запись не найдена",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/api/user-roles/bulk": {
"post": {
"description": "Полная замена ролей пользователя: удаляет все текущие роли и назначает новые",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user-roles"
],
"summary": "Массовое назначение ролей",
"parameters": [
{
"description": "user_id и список role_ids",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers_user_roles.BulkAssignRolesRequest"
}
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.ApiResponseBase"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Пользователь не найден",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/api/users": {
"get": {
"description": "Получение списка пользователей с пагинацией, фильтрацией и подгрузкой связанных данных",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"users"
],
"summary": "Получение списка пользователей",
"parameters": [
{
"type": "integer",
"description": "Смещение для пагинации",
"name": "offset",
"in": "query"
},
{
"type": "integer",
"description": "Количество записей на странице",
"name": "limit",
"in": "query"
},
{
"type": "boolean",
"description": "Фильтр по блокировке",
"name": "is_blocked",
"in": "query"
},
{
"type": "boolean",
"description": "Фильтр по увольнению",
"name": "is_fired",
"in": "query"
},
{
"type": "integer",
"description": "Фильтр по отделу",
"name": "department_id",
"in": "query"
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.ApiResponseBase"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"put": {
"description": "Обновление данных существующего пользователя",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"users"
],
"summary": "Обновление пользователя",
"parameters": [
{
"description": "Данные пользователя",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/typescore.UpdateUserReqAdmin"
}
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.User"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Пользователь не найден",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/api/users/{id}": {
"get": {
"description": "Получение детальной информации о пользователе по его ID с подгрузкой связанных данных",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"users"
],
"summary": "Получение пользователя по ID",
"parameters": [
{
"type": "integer",
"description": "ID пользователя",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.User"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Пользователь не найден",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/api/users/{user_id}/roles": {
"get": {
"description": "Получение списка ролей, назначенных пользователю с указанным ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"user-roles"
],
"summary": "Получение списка ролей пользователя по ID",
"parameters": [
{
"type": "integer",
"description": "ID пользователя",
"name": "user_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Успех",
"schema": {
"$ref": "#/definitions/typescore.ApiResponseBase"
}
},
"400": {
"description": "Некорректный запрос",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Пользователь не найден",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Ошибка сервера",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
}
},
"definitions": {
"handlers.ErrorResponse": {
"type": "object",
"properties": {
"error_code": {
"description": "Код ошибки",
"type": "integer"
},
"error_description": {
"description": "Описание ошибки",
"type": "string"
}
}
},
"handlers_user_roles.AssignUserRoleRequest": {
"type": "object",
"properties": {
"role_id": {
"type": "integer"
},
"user_id": {
"type": "integer"
}
}
},
"handlers_user_roles.BulkAssignRolesRequest": {
"type": "object",
"properties": {
"role_ids": {
"type": "array",
"items": {
"type": "integer"
}
},
"user_id": {
"type": "integer"
}
}
},
"typescore.Admin": {
"type": "object",
"properties": {
"created_at": {
"description": "Дата создания записи",
"type": "string"
},
"id": {
"description": "Автоматически заполняемое уникальное поле для большого числа записей",
"type": "integer"
},
"is_blocked": {
"description": "Заблокирован ли администратор",
"type": "boolean"
},
"last_ip_login": {
"description": "Последний IP входа",
"type": "string"
},
"last_login": {
"description": "Дата входа",
"type": "string"
},
"login": {
"description": "Логин администратора",
"type": "string"
}
}
},
"typescore.AdminReq": {
"type": "object",
"properties": {
"login": {
"type": "string"
},
"password": {
"description": "Пароль пользователя",
"type": "string"
}
}
},
"typescore.ApiResponseBase": {
"type": "object",
"properties": {
"data": {
"description": "данные полученные от api"
},
"total_amount": {
"type": "number"
},
"total_count": {
"type": "integer"
}
}
},
"typescore.Approval": {
"type": "object",
"properties": {
"content": {
"description": "введённые пользователем данные по шаблону",
"type": "string"
},
"created_at": {
"type": "string"
},
"department": {
"$ref": "#/definitions/typescore.Department"
},
"department_id": {
"description": "снимок отдела на момент создания",
"type": "integer"
},
"files": {
"type": "array",
"items": {
"$ref": "#/definitions/typescore.ApprovalFile"
}
},
"id": {
"type": "integer"
},
"initiator": {
"$ref": "#/definitions/typescore.User"
},
"initiator_id": {
"type": "integer"
},
"metadata": {
"type": "string"
},
"revision_at": {
"type": "string"
},
"revision_by_id": {
"type": "integer"
},
"revision_comment": {
"type": "string"
},
"revision_count": {
"type": "integer"
},
"revoked_at": {
"type": "string"
},
"revoked_by": {
"$ref": "#/definitions/typescore.User"
},
"revoked_by_id": {
"type": "integer"
},
"status": {
"type": "string"
},
"steps": {
"type": "array",
"items": {
"$ref": "#/definitions/typescore.ApprovalStep"
}
},
"topic": {
"$ref": "#/definitions/typescore.ApprovalTopic"
},
"topic_id": {
"type": "integer"
},
"updated_at": {
"type": "string"
}
}
},
"typescore.ApprovalFile": {
"type": "object",
"properties": {
"approval_id": {
"type": "integer"
},
"attached_by_id": {
"type": "integer"
},
"created_at": {
"type": "string"
},
"file_base64": {
"type": "string"
},
"file_name": {
"type": "string"
},
"id": {
"type": "integer"
},
"task_id": {
"type": "integer"
}
}
},
"typescore.ApprovalStep": {
"type": "object",
"properties": {
"acted_at": {
"type": "string"
},
"approval": {
"$ref": "#/definitions/typescore.Approval"
},
"approval_id": {
"type": "integer"
},
"approver": {
"$ref": "#/definitions/typescore.User"
},
"approver_department_snapshot": {
"type": "string"
},
"approver_id": {
"type": "integer"
},
"approver_name_snapshot": {
"type": "string"
},
"comment": {
"type": "string"
},
"created_at": {
"type": "string"
},
"id": {
"type": "integer"
},
"returned_at": {
"type": "string"
},
"status": {
"type": "string"
},
"step_order": {
"type": "integer"
},
"updated_at": {
"type": "string"
}
}
},
"typescore.ApprovalTopic": {
"type": "object",
"properties": {
"allow_approver_selection": {
"type": "boolean"
},
"allow_observer_selection": {
"type": "boolean"
},
"allows_file": {
"type": "boolean"
},
"approvalMode": {
"type": "string"
},
"category": {
"$ref": "#/definitions/typescore.ApprovalTopicCategory"
},
"category_id": {
"type": "integer"
},
"code": {
"type": "string"
},
"created_at": {
"type": "string"
},
"duration_type": {
"type": "string"
},
"first_approver_role_code": {
"description": "если задан — первый согласующий выбирается из этой роли",
"type": "string"
},
"id": {
"type": "integer"
},
"instructions": {
"type": "string"
},
"is_active": {
"type": "boolean"
},
"name": {
"type": "string"
},
"payment_type": {
"type": "string"
},
"require_approver_comment": {
"type": "boolean"
},
"require_observer_selection": {
"type": "boolean"
},
"requires_file": {
"type": "boolean"
},
"template": {
"type": "string"
},
"time_type": {
"type": "string"
},
"updated_at": {
"type": "string"
}
}
},
"typescore.ApprovalTopicCategory": {
"type": "object",
"properties": {
"code": {
"description": "otgul, vacation, sick_leave",
"type": "string"
},
"created_at": {
"type": "string"
},
"description": {
"type": "string"
},
"id": {
"type": "integer"
},
"is_active": {
"type": "boolean"
},
"name": {
"type": "string"
},
"topics": {
"type": "array",
"items": {
"$ref": "#/definitions/typescore.ApprovalTopic"
}
},
"updated_at": {
"type": "string"
}
}
},
"typescore.ApprovalTopicExecutor": {
"type": "object",
"properties": {
"created_at": {
"type": "string"
},
"id": {
"type": "integer"
},
"is_active": {
"type": "boolean"
},
"require_file": {
"type": "boolean"
},
"step_order": {
"type": "integer"
},
"target_system": {
"type": "string"
},
"task_text": {
"type": "string"
},
"topic": {
"$ref": "#/definitions/typescore.ApprovalTopic"
},
"topic_id": {
"type": "integer"
},
"updated_at": {
"type": "string"
},
"user": {
"$ref": "#/definitions/typescore.User"
},
"user_id": {
"type": "integer"
}
}
},
"typescore.AuthHandlerResponse": {
"type": "object",
"properties": {
"temp_session": {
"description": "Временный токен для 2FA",
"type": "string"
},
"token": {
"description": "токен аутентификации",
"type": "string"
}
}
},
"typescore.AuthReqAccount": {
"type": "object",
"properties": {
"access_code": {
"type": "string"
},
"login": {
"type": "string"
},
"password": {
"type": "string"
},
"redirect_uri": {
"type": "string"
},
"token": {
"type": "string"
}
}
},
"typescore.Department": {
"type": "object",
"properties": {
"code": {
"description": "finance, hr, it",
"type": "string"
},
"created_at": {
"type": "string"
},
"description": {
"type": "string"
},
"id": {
"type": "integer"
},
"is_active": {
"type": "boolean"
},
"name": {
"type": "string"
},
"updated_at": {
"type": "string"
}
}
},
"typescore.Permission": {
"type": "object",
"properties": {
"action": {
"type": "string"
},
"created_at": {
"type": "string"
},
"id": {
"type": "integer"
},
"role": {
"$ref": "#/definitions/typescore.Role"
},
"role_id": {
"type": "integer"
},
"topic": {
"$ref": "#/definitions/typescore.ApprovalTopic"
},
"topic_category": {
"$ref": "#/definitions/typescore.ApprovalTopicCategory"
},
"topic_category_id": {
"type": "integer"
},
"topic_id": {
"type": "integer"
},
"updated_at": {
"type": "string"
}
}
},
"typescore.Role": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"created_at": {
"type": "string"
},
"description": {
"type": "string"
},
"id": {
"type": "integer"
},
"is_approver": {
"type": "boolean"
},
"is_default": {
"type": "boolean"
},
"is_director": {
"type": "boolean"
},
"is_executor": {
"type": "boolean"
},
"is_observer": {
"type": "boolean"
},
"name": {
"type": "string"
},
"permissions": {
"type": "array",
"items": {
"$ref": "#/definitions/typescore.Permission"
}
},
"updated_at": {
"type": "string"
}
}
},
"typescore.UpdateUserReqAdmin": {
"type": "object",
"properties": {
"department_id": {
"description": "Логин пользователя",
"type": "integer"
},
"id": {
"type": "integer"
},
"is_blocked": {
"description": "Заблокирован ли пользователь",
"type": "boolean"
},
"is_fired": {
"description": "Заблокирован ли пользователь",
"type": "boolean"
}
}
},
"typescore.User": {
"type": "object",
"properties": {
"blocked_at": {
"type": "string"
},
"created_at": {
"type": "string"
},
"department": {
"$ref": "#/definitions/typescore.Department"
},
"department_id": {
"type": "integer"
},
"full_name": {
"type": "string"
},
"id": {
"type": "integer"
},
"is_blocked": {
"type": "boolean"
},
"is_fired": {
"type": "boolean"
},
"language_code": {
"description": "FirstName *string `gorm:\"type:text;not null;column:first_name\" json:\"first_name\" db:\"first_name\" mapstructure:\"first_name\"`\nLastName *string `gorm:\"type:text;not null;column:last_name\" json:\"last_name\" db:\"last_name\" mapstructure:\"last_name\"`\nPatronymic *string `gorm:\"type:text;column:patronymic\" json:\"patronymic,omitempty\" db:\"patronymic\" mapstructure:\"patronymic\"`",
"type": "string"
},
"last_login": {
"type": "string"
},
"telegram_id": {
"type": "integer"
},
"updated_at": {
"type": "string"
},
"user_roles": {
"type": "array",
"items": {
"$ref": "#/definitions/typescore.UserRole"
}
},
"username": {
"type": "string"
}
}
},
"typescore.UserHierarchy": {
"type": "object",
"properties": {
"approver": {
"$ref": "#/definitions/typescore.User"
},
"approver_id": {
"type": "integer"
},
"created_at": {
"type": "string"
},
"department": {
"$ref": "#/definitions/typescore.Department"
},
"department_id": {
"type": "integer"
},
"id": {
"type": "integer"
},
"priority": {
"type": "integer"
},
"subordinate": {
"$ref": "#/definitions/typescore.User"
},
"subordinate_id": {
"type": "integer"
},
"topic_category_id": {
"type": "integer"
},
"topic_id": {
"type": "integer"
},
"updated_at": {
"type": "string"
}
}
},
"typescore.UserRole": {
"type": "object",
"properties": {
"created_at": {
"type": "string"
},
"id": {
"description": "Автоматически заполняемое уникальное поле для большого числа записей",
"type": "integer"
},
"role": {
"description": "← добавить gorm:\"-\"",
"allOf": [
{
"$ref": "#/definitions/typescore.Role"
}
]
},
"role_id": {
"type": "integer"
},
"updated_at": {
"type": "string"
},
"user": {
"description": "← добавить gorm:\"-\"",
"allOf": [
{
"$ref": "#/definitions/typescore.User"
}
]
},
"user_id": {
"type": "integer"
}
}
}
},
"securityDefinitions": {
"ApiKeyAuth": {
"type": "apiKey",
"name": "ApiKey",
"in": "header"
},
"BearerAuth": {
"type": "apiKey",
"name": "Authorization",
"in": "header"
},
"DeviceID": {
"type": "apiKey",
"name": "x-device-id",
"in": "header"
},
"Timestamp": {
"type": "apiKey",
"name": "X-Timestamp",
"in": "header"
}
}
}