2022-12-25 20:10:23 +00:00
|
|
|
|
import { getTariffParams, tariffBody, replaceTariffParams } from "./inputs";
|
2022-12-25 20:28:47 +00:00
|
|
|
|
import {
|
|
|
|
|
getTariffReponse,
|
|
|
|
|
getTariffsReponse,
|
|
|
|
|
createTariffReponse,
|
|
|
|
|
replaceTariffReponse,
|
|
|
|
|
removeTariffReponse,
|
|
|
|
|
} from "./responses";
|
2022-12-22 10:45:44 +00:00
|
|
|
|
|
|
|
|
|
import type { SwaggerSchema } from "@/types/swagger.type";
|
|
|
|
|
|
|
|
|
|
export const getTariffSchema: SwaggerSchema = {
|
|
|
|
|
summary: "Получение тарифа",
|
|
|
|
|
tags: ["tariff"],
|
|
|
|
|
params: getTariffParams,
|
|
|
|
|
response: getTariffReponse,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const getTariffsSchema: SwaggerSchema = {
|
|
|
|
|
summary: "Получение списка тарифов",
|
|
|
|
|
tags: ["tariff"],
|
|
|
|
|
response: getTariffsReponse,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const createTariffsSchema: SwaggerSchema = {
|
|
|
|
|
summary: "Создание тарифа",
|
|
|
|
|
tags: ["tariff"],
|
|
|
|
|
body: tariffBody,
|
2022-12-25 20:10:23 +00:00
|
|
|
|
security: [{ bearer: [] }],
|
2022-12-22 10:45:44 +00:00
|
|
|
|
response: createTariffReponse,
|
|
|
|
|
};
|
2022-12-25 20:28:47 +00:00
|
|
|
|
|
2022-12-22 10:45:44 +00:00
|
|
|
|
export const replaceTariffsSchema: SwaggerSchema = {
|
|
|
|
|
summary: "Замена тарифа",
|
|
|
|
|
tags: ["tariff"],
|
2022-12-25 20:10:23 +00:00
|
|
|
|
params: replaceTariffParams,
|
2022-12-22 10:45:44 +00:00
|
|
|
|
body: tariffBody,
|
2022-12-25 20:10:23 +00:00
|
|
|
|
security: [{ bearer: [] }],
|
2022-12-22 10:45:44 +00:00
|
|
|
|
response: replaceTariffReponse,
|
|
|
|
|
};
|
2022-12-25 20:28:47 +00:00
|
|
|
|
|
|
|
|
|
export const removeTariffsSchema: SwaggerSchema = {
|
|
|
|
|
summary: "Удаление тарифа",
|
|
|
|
|
description: "Помечает тариф удалённым, но не удаляет его из БД",
|
|
|
|
|
tags: ["tariff"],
|
|
|
|
|
body: getTariffParams,
|
|
|
|
|
security: [{ bearer: [] }],
|
|
|
|
|
response: removeTariffReponse,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const deleteTariffsSchema: SwaggerSchema = {
|
|
|
|
|
summary: "Удаление тарифа",
|
|
|
|
|
description: "Удаляет тариф из БД окончательно",
|
|
|
|
|
tags: ["tariff"],
|
|
|
|
|
body: getTariffParams,
|
|
|
|
|
security: [{ bearer: [] }],
|
|
|
|
|
response: removeTariffReponse,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const restoreTariffsSchema: SwaggerSchema = {
|
|
|
|
|
summary: "Восстановление тарифа",
|
|
|
|
|
tags: ["tariff"],
|
|
|
|
|
body: getTariffParams,
|
|
|
|
|
security: [{ bearer: [] }],
|
|
|
|
|
response: removeTariffReponse,
|
|
|
|
|
};
|