feat: add description to tariff

This commit is contained in:
skeris 2023-12-15 18:16:14 +03:00
parent ee00fc3ac7
commit 6875e4d4e4
4 changed files with 7 additions and 0 deletions

@ -77,6 +77,7 @@ export const createTariff = async (request: CreateTariffRequest, reply: FastifyR
const newTariff = new TariffModel({
name: requestBody.name,
description: requestBody.description,
price: requestBody.price,
userId: request.user.id,
isCustom: requestBody.isCustom,

@ -10,6 +10,10 @@ const schema: SchemaDefinition<Tariff> = {
type: String,
required: true,
},
description: {
type: String,
required: false,
},
price: {
type: Number,
required: false,

@ -6,6 +6,7 @@ export const tariff: SwaggerMessage = {
properties: {
_id: { type: "string" },
name: { type: "string" },
description: { type: "string" },
price: { type: "number" },
isCustom: { type: "boolean" },
privileges: {

@ -4,6 +4,7 @@ import type { Eloquent } from "./eloquent.type";
export type Tariff = Eloquent & {
name: string;
userId: string;
description: string;
price?: number;
isCustom: boolean;
privileges: Array<Omit<Privilege, keyof Eloquent>>;