tariffs/src/swagger/tariff/index.ts

67 lines
1.8 KiB
TypeScript
Raw 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.

import { getTariffParams, tariffBody, replaceTariffParams } from "./inputs";
import {
getTariffReponse,
getTariffsReponse,
createTariffReponse,
replaceTariffReponse,
removeTariffReponse,
} from "./responses";
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,
security: [{ bearer: [] }],
response: createTariffReponse,
};
export const replaceTariffsSchema: SwaggerSchema = {
summary: "Замена тарифа",
tags: ["tariff"],
params: replaceTariffParams,
body: tariffBody,
security: [{ bearer: [] }],
response: replaceTariffReponse,
};
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,
};