From 4355698db85211fc70e3e8218b3698e467cf662d Mon Sep 17 00:00:00 2001 From: skeris Date: Fri, 15 Dec 2023 23:01:09 +0300 Subject: [PATCH] feat: tariff ordering support --- src/handlers/tariff/index.ts | 4 +++- src/models/tariff.model.ts | 4 ++++ src/swagger/tariff/models.ts | 1 + src/types/models/tariff.type.ts | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/handlers/tariff/index.ts b/src/handlers/tariff/index.ts index 4b34202..2be1c37 100644 --- a/src/handlers/tariff/index.ts +++ b/src/handlers/tariff/index.ts @@ -31,7 +31,7 @@ export const getTariffs = async (request: GetTariffsRequest): Promise = { type: Number, required: false, }, + order: { + type: Number, + required: false, + }, userId: { type: String, required: true, diff --git a/src/swagger/tariff/models.ts b/src/swagger/tariff/models.ts index 80fa522..950a7f8 100644 --- a/src/swagger/tariff/models.ts +++ b/src/swagger/tariff/models.ts @@ -8,6 +8,7 @@ export const tariff: SwaggerMessage = { name: { type: "string" }, description: { type: "string" }, price: { type: "number" }, + order: { type: "number" }, isCustom: { type: "boolean" }, privileges: { type: "array", diff --git a/src/types/models/tariff.type.ts b/src/types/models/tariff.type.ts index c176b60..c81c0ba 100644 --- a/src/types/models/tariff.type.ts +++ b/src/types/models/tariff.type.ts @@ -6,6 +6,7 @@ export type Tariff = Eloquent & { userId: string; description: string; price?: number; + order?: number; isCustom: boolean; privileges: Array>; };