2023-03-17 17:42:31 +00:00
|
|
|
|
import { getAccountParams, setAccountRoleBody } from "./inputs";
|
|
|
|
|
import {
|
|
|
|
|
getAccountResponse,
|
|
|
|
|
createAccountResponse,
|
|
|
|
|
setAccountRoleResponse,
|
|
|
|
|
getAccountsResponse,
|
|
|
|
|
removeRoleResponse,
|
|
|
|
|
} from "./responses";
|
|
|
|
|
|
|
|
|
|
import type { SwaggerSchema } from "@/types/swagger.type";
|
|
|
|
|
|
|
|
|
|
export const getAccountsSchema: SwaggerSchema = {
|
|
|
|
|
summary: "Получение информации об аккаунтах",
|
|
|
|
|
description: "Получение всех аккаунтов из БД",
|
|
|
|
|
tags: ["account"],
|
|
|
|
|
response: getAccountsResponse,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const getAccountSchema: SwaggerSchema = {
|
|
|
|
|
summary: "Получение информации об аккаунте",
|
|
|
|
|
description: "Получение аккаунта по ID",
|
|
|
|
|
tags: ["account"],
|
|
|
|
|
params: getAccountParams,
|
|
|
|
|
response: getAccountResponse,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const createAccountSchema: SwaggerSchema = {
|
|
|
|
|
summary: "Создание аккаунта",
|
|
|
|
|
tags: ["account"],
|
|
|
|
|
response: createAccountResponse,
|
|
|
|
|
security: [{ bearer: [] }],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const setAccountRoleSchema: SwaggerSchema = {
|
|
|
|
|
summary: "Присвоение роли пользователя",
|
|
|
|
|
tags: ["account"],
|
|
|
|
|
body: setAccountRoleBody,
|
|
|
|
|
response: setAccountRoleResponse,
|
|
|
|
|
security: [{ bearer: [] }],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const removeAccountSchema: SwaggerSchema = {
|
|
|
|
|
summary: "Удаление аккаунта",
|
|
|
|
|
description: "Помечает аккаунт удалённым, но не удаляет его из БД",
|
|
|
|
|
tags: ["account"],
|
|
|
|
|
response: removeRoleResponse,
|
|
|
|
|
security: [{ bearer: [] }],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const deleteAccountSchema: SwaggerSchema = {
|
|
|
|
|
summary: "Удаление аккаунта",
|
|
|
|
|
description: "Удаляет аккаунт из БД окончательно",
|
|
|
|
|
tags: ["account"],
|
|
|
|
|
response: removeRoleResponse,
|
|
|
|
|
security: [{ bearer: [] }],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const restoreAccountSchema: SwaggerSchema = {
|
|
|
|
|
summary: "Восстановление аккаунта",
|
|
|
|
|
description: "Восстанавливает аккаунт, который не был удалён окончательно",
|
|
|
|
|
tags: ["account"],
|
|
|
|
|
response: removeRoleResponse,
|
|
|
|
|
security: [{ bearer: [] }],
|
|
|
|
|
};
|