style: privilegies => privileges
This commit is contained in:
parent
b30590dbfb
commit
c25f72a185
@ -15,8 +15,8 @@ export const validatePrivilege = (privilege: RawPrivilege): Error | null => {
|
||||
return null;
|
||||
};
|
||||
|
||||
export const convertPrivilegiesToMap = (privilegies: Privilege[]) => {
|
||||
return privilegies.reduce<Record<string, Privilege[]>>((accamulator, privilege) => {
|
||||
export const convertPrivilegesToMap = (privileges: Privilege[]) => {
|
||||
return privileges.reduce<Record<string, Privilege[]>>((accamulator, privilege) => {
|
||||
if (!accamulator[privilege.serviceKey]) {
|
||||
accamulator[privilege.serviceKey] = [];
|
||||
}
|
||||
|
@ -3,31 +3,31 @@ import { Types } from "mongoose";
|
||||
import { PrivilegeModel } from "@/models/privilege.model";
|
||||
|
||||
import { validateEmptyFields } from "@/utils/validate-empty-fields";
|
||||
import { convertPrivilegiesToMap, validatePrivilege } from "./helpers";
|
||||
import { convertPrivilegesToMap, validatePrivilege } from "./helpers";
|
||||
|
||||
import type { FastifyReply } from "fastify";
|
||||
import type {
|
||||
GetServicePrivilegiesRequest,
|
||||
GetServicePrivilegesRequest,
|
||||
RegisterPrivilegeRequest,
|
||||
GetPrivilegeRequest,
|
||||
RegisterPrivilegiesRequest,
|
||||
RegisterPrivilegesRequest,
|
||||
RemovePrivilegeRequest,
|
||||
} from "./types";
|
||||
|
||||
export const registerPrivilegies = async (request: RegisterPrivilegiesRequest, reply: FastifyReply) => {
|
||||
const [requestBody, errorEmpty] = validateEmptyFields(request.body ?? {}, ["privilegies"]);
|
||||
export const registerPrivileges = async (request: RegisterPrivilegesRequest, reply: FastifyReply) => {
|
||||
const [requestBody, errorEmpty] = validateEmptyFields(request.body ?? {}, ["privileges"]);
|
||||
|
||||
if (errorEmpty) {
|
||||
void reply.status(400);
|
||||
return errorEmpty;
|
||||
}
|
||||
|
||||
if (!requestBody.privilegies.length) {
|
||||
if (!requestBody.privileges.length) {
|
||||
void reply.status(400);
|
||||
return new Error("empty privilege array");
|
||||
}
|
||||
|
||||
for (const rawPrivilege of requestBody.privilegies) {
|
||||
for (const rawPrivilege of requestBody.privileges) {
|
||||
const errorInvalid = validatePrivilege(rawPrivilege);
|
||||
|
||||
if (errorInvalid) {
|
||||
@ -36,7 +36,7 @@ export const registerPrivilegies = async (request: RegisterPrivilegiesRequest, r
|
||||
}
|
||||
}
|
||||
|
||||
const updatePrivilegeRequests = requestBody.privilegies.map(async (privilege) => {
|
||||
const updatePrivilegeRequests = requestBody.privileges.map(async (privilege) => {
|
||||
await PrivilegeModel.updateOne(
|
||||
{ privilegeId: privilege.privilegeId },
|
||||
{
|
||||
@ -100,19 +100,19 @@ export const registerPrivilege = async (request: RegisterPrivilegeRequest, reply
|
||||
return newPrivilege.save();
|
||||
};
|
||||
|
||||
export const getAllPrivilegies = async () => PrivilegeModel.find({ isDeleted: false }).lean();
|
||||
export const getAllPrivileges = async () => PrivilegeModel.find({ isDeleted: false }).lean();
|
||||
|
||||
export const getAllPrivilegiesMap = async () => {
|
||||
const privilegies = await PrivilegeModel.find({ isDeleted: false }).lean();
|
||||
export const getAllPrivilegesMap = async () => {
|
||||
const privileges = await PrivilegeModel.find({ isDeleted: false }).lean();
|
||||
|
||||
if (!privilegies.length) {
|
||||
if (!privileges.length) {
|
||||
return {};
|
||||
}
|
||||
|
||||
return convertPrivilegiesToMap(privilegies);
|
||||
return convertPrivilegesToMap(privileges);
|
||||
};
|
||||
|
||||
export const getServicePrivilegies = async (request: GetServicePrivilegiesRequest, reply: FastifyReply) => {
|
||||
export const getServicePrivileges = async (request: GetServicePrivilegesRequest, reply: FastifyReply) => {
|
||||
const [requestParams, error] = validateEmptyFields(request.params ?? {}, ["serviceKey"]);
|
||||
|
||||
if (error) {
|
||||
@ -212,20 +212,20 @@ export const removePrivilege = async (request: RemovePrivilegeRequest, reply: Fa
|
||||
return privilege;
|
||||
};
|
||||
|
||||
export const replacePrivilegies = async (request: RegisterPrivilegiesRequest, reply: FastifyReply) => {
|
||||
const [requestBody, errorEmpty] = validateEmptyFields(request.body ?? {}, ["privilegies"]);
|
||||
export const replacePrivileges = async (request: RegisterPrivilegesRequest, reply: FastifyReply) => {
|
||||
const [requestBody, errorEmpty] = validateEmptyFields(request.body ?? {}, ["privileges"]);
|
||||
|
||||
if (errorEmpty) {
|
||||
void reply.status(400);
|
||||
return errorEmpty;
|
||||
}
|
||||
|
||||
if (!requestBody.privilegies.length) {
|
||||
if (!requestBody.privileges.length) {
|
||||
void reply.status(400);
|
||||
return new Error("empty privilege array");
|
||||
}
|
||||
|
||||
for (const rawPrivilege of requestBody.privilegies) {
|
||||
for (const rawPrivilege of requestBody.privileges) {
|
||||
const errorInvalid = validatePrivilege(rawPrivilege);
|
||||
|
||||
if (errorInvalid) {
|
||||
@ -234,7 +234,7 @@ export const replacePrivilegies = async (request: RegisterPrivilegiesRequest, re
|
||||
}
|
||||
}
|
||||
|
||||
const replacePrivilegeRequests = requestBody.privilegies.map(async (privilege) => {
|
||||
const replacePrivilegeRequests = requestBody.privileges.map(async (privilege) => {
|
||||
await PrivilegeModel.replaceOne(
|
||||
{ privilegeId: privilege.privilegeId },
|
||||
{
|
||||
|
@ -8,13 +8,13 @@ export type RegisterPrivilegeRequest = FastifyRequest<{
|
||||
Body?: RawPrivilege;
|
||||
}>;
|
||||
|
||||
export type RegisterPrivilegiesRequest = FastifyRequest<{
|
||||
export type RegisterPrivilegesRequest = FastifyRequest<{
|
||||
Body?: {
|
||||
privilegies?: RawPrivilege[];
|
||||
privileges?: RawPrivilege[];
|
||||
};
|
||||
}>;
|
||||
|
||||
export type GetServicePrivilegiesRequest = FastifyRequest<{
|
||||
export type GetServicePrivilegesRequest = FastifyRequest<{
|
||||
Params?: {
|
||||
serviceKey?: string;
|
||||
};
|
||||
|
@ -4,7 +4,7 @@ import type { TariffMessage } from "@/types/messages/tariff-message.type";
|
||||
import type { ObjectWithRequiredFields } from "@/types/object-with-required-fields";
|
||||
|
||||
export const validateTariff = (tariff?: TariffMessage): [ObjectWithRequiredFields<TariffMessage>, Error | null] => {
|
||||
const [validatedTariff, errorEmpty] = validateEmptyFields(tariff ?? {}, ["isCustom", "name", "privilegies"], false);
|
||||
const [validatedTariff, errorEmpty] = validateEmptyFields(tariff ?? {}, ["isCustom", "name", "privileges"], false);
|
||||
|
||||
if (errorEmpty) {
|
||||
return [validatedTariff, errorEmpty];
|
||||
|
@ -75,7 +75,7 @@ export const createTariff = async (request: CreateTariffRequest, reply: FastifyR
|
||||
throw error;
|
||||
}
|
||||
|
||||
for (const privilege of requestBody.privilegies) {
|
||||
for (const privilege of requestBody.privileges) {
|
||||
if (!Types.ObjectId.isValid(privilege.privilegeId)) {
|
||||
void reply.status(404);
|
||||
throw new Error(`privilege id <${privilege.privilegeId}> invalid`);
|
||||
@ -87,7 +87,7 @@ export const createTariff = async (request: CreateTariffRequest, reply: FastifyR
|
||||
price: requestBody.price,
|
||||
userId: request.user.id,
|
||||
isCustom: requestBody.isCustom,
|
||||
privilegies: requestBody.privilegies,
|
||||
privileges: requestBody.privileges,
|
||||
});
|
||||
|
||||
return newTariff.save();
|
||||
@ -113,19 +113,19 @@ export const replaceTariff = async (request: ReplaceTariffRequest, reply: Fastif
|
||||
throw new Error("tariff not found");
|
||||
}
|
||||
|
||||
for (const privilege of requestBody.privilegies) {
|
||||
for (const privilege of requestBody.privileges) {
|
||||
if (!Types.ObjectId.isValid(privilege.privilegeId)) {
|
||||
void reply.status(404);
|
||||
throw new Error(`privilege id <${privilege.privilegeId}> invalid`);
|
||||
}
|
||||
}
|
||||
|
||||
const privilegiesMap = new Map(requestBody.privilegies.map((privilege) => [privilege.privilegeId, privilege]));
|
||||
const privilegeIDs = requestBody.privilegies.map(({ privilegeId }) => privilegeId);
|
||||
const privilegies = await PrivilegeModel.find({ _id: privilegeIDs }).lean();
|
||||
const privilegesMap = new Map(requestBody.privileges.map((privilege) => [privilege.privilegeId, privilege]));
|
||||
const privilegeIDs = requestBody.privileges.map(({ privilegeId }) => privilegeId);
|
||||
const privileges = await PrivilegeModel.find({ _id: privilegeIDs }).lean();
|
||||
|
||||
const cleanPrivilegies = privilegies.map<Omit<Privilege, keyof Eloquent>>((privilege) => {
|
||||
const currentPrivilege = privilegiesMap.get(privilege._id.toString());
|
||||
const cleanPrivileges = privileges.map<Omit<Privilege, keyof Eloquent>>((privilege) => {
|
||||
const currentPrivilege = privilegesMap.get(privilege._id.toString());
|
||||
|
||||
return {
|
||||
name: privilege.name,
|
||||
@ -143,7 +143,7 @@ export const replaceTariff = async (request: ReplaceTariffRequest, reply: Fastif
|
||||
name: requestBody.name,
|
||||
price: requestBody.price,
|
||||
isCustom: requestBody.isCustom,
|
||||
privilegies: cleanPrivilegies,
|
||||
privileges: cleanPrivileges,
|
||||
});
|
||||
|
||||
return tariff;
|
||||
|
@ -47,7 +47,7 @@ const schema: SchemaDefinition<Privilege> = {
|
||||
|
||||
const schemaSettings = {
|
||||
versionKey: false,
|
||||
collection: "privilegies",
|
||||
collection: "privileges",
|
||||
};
|
||||
|
||||
export const PrivilegeSchema = new Schema<Privilege>(schema, schemaSettings);
|
||||
|
@ -22,7 +22,7 @@ const schema: SchemaDefinition<Tariff> = {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
privilegies: {
|
||||
privileges: {
|
||||
type: [PrivilegeSchema],
|
||||
default: [],
|
||||
},
|
||||
|
@ -2,39 +2,39 @@ import { Router } from "@/server/router";
|
||||
|
||||
import {
|
||||
registerPrivilege,
|
||||
getAllPrivilegies,
|
||||
getAllPrivilegiesMap,
|
||||
getAllPrivileges,
|
||||
getAllPrivilegesMap,
|
||||
getPrivilege,
|
||||
getServicePrivilegies,
|
||||
getServicePrivileges,
|
||||
replacePrivilege,
|
||||
registerPrivilegies,
|
||||
registerPrivileges,
|
||||
removePrivilege,
|
||||
replacePrivilegies,
|
||||
replacePrivileges,
|
||||
restorePrivilege,
|
||||
} from "@/handlers/privilege";
|
||||
|
||||
import {
|
||||
getPrivilegiesSchema,
|
||||
getPrivilegiesMapSchema,
|
||||
getPrivilegesSchema,
|
||||
getPrivilegesMapSchema,
|
||||
getPrivilegeSchema,
|
||||
getServicePrivilegiesSchema,
|
||||
getServicePrivilegesSchema,
|
||||
registerPrivilegeSchema,
|
||||
registerPrivilegiesSchema,
|
||||
registerPrivilegesSchema,
|
||||
replacePrivilegeSchema,
|
||||
replacePrivilegiesSchema,
|
||||
replacePrivilegesSchema,
|
||||
removePrivilegeSchema,
|
||||
restorePrivilegeSchema,
|
||||
} from "@/swagger/privilege";
|
||||
|
||||
export const setPrivilegeRoutes = (router: Router): void => {
|
||||
router.get("/", getAllPrivilegies, { schema: getPrivilegiesSchema });
|
||||
router.get("/service", getAllPrivilegiesMap, { schema: getPrivilegiesMapSchema });
|
||||
router.get("/", getAllPrivileges, { schema: getPrivilegesSchema });
|
||||
router.get("/service", getAllPrivilegesMap, { schema: getPrivilegesMapSchema });
|
||||
router.get("/:privilegeId", getPrivilege, { schema: getPrivilegeSchema });
|
||||
router.get("/service/:serviceKey", getServicePrivilegies, { schema: getServicePrivilegiesSchema });
|
||||
router.get("/service/:serviceKey", getServicePrivileges, { schema: getServicePrivilegesSchema });
|
||||
router.post("/", registerPrivilege, { schema: registerPrivilegeSchema });
|
||||
router.post("/many", registerPrivilegies, { schema: registerPrivilegiesSchema });
|
||||
router.post("/many", registerPrivileges, { schema: registerPrivilegesSchema });
|
||||
router.post("/restore/", restorePrivilege, { schema: restorePrivilegeSchema });
|
||||
router.put("/", replacePrivilege, { schema: replacePrivilegeSchema });
|
||||
router.put("/many", replacePrivilegies, { schema: replacePrivilegiesSchema });
|
||||
router.put("/many", replacePrivileges, { schema: replacePrivilegesSchema });
|
||||
router.delete("/", removePrivilege, { schema: removePrivilegeSchema });
|
||||
};
|
||||
|
@ -1,30 +1,30 @@
|
||||
import { privilegeBody, registerPrivilegiesBody, getPrivilegeParams, getServicePrivilegiesParams } from "./inputs";
|
||||
import { privilegeBody, registerPrivilegesBody, getPrivilegeParams, getServicePrivilegesParams } from "./inputs";
|
||||
import {
|
||||
getPrivilegeReponse,
|
||||
getPrivilegiesReponse,
|
||||
getAllPrivilegiesMapReponse,
|
||||
getAllPrivilegiesReponse,
|
||||
getPrivilegesReponse,
|
||||
getAllPrivilegesMapReponse,
|
||||
getAllPrivilegesReponse,
|
||||
registerPrivilegeResponse,
|
||||
replacePrivilegeResponse,
|
||||
registerPrivilegiesResponse,
|
||||
replacePrivilegiesResponse,
|
||||
registerPrivilegesResponse,
|
||||
replacePrivilegesResponse,
|
||||
removePrivilegeResponse,
|
||||
} from "./responses";
|
||||
|
||||
import type { SwaggerSchema } from "@/types/swagger.type";
|
||||
|
||||
export const getPrivilegiesSchema: SwaggerSchema = {
|
||||
export const getPrivilegesSchema: SwaggerSchema = {
|
||||
summary: "Получение всех привелегий",
|
||||
description: "Получение всех привелегий в виде массива",
|
||||
tags: ["privilege"],
|
||||
response: getAllPrivilegiesReponse,
|
||||
response: getAllPrivilegesReponse,
|
||||
};
|
||||
|
||||
export const getPrivilegiesMapSchema: SwaggerSchema = {
|
||||
export const getPrivilegesMapSchema: SwaggerSchema = {
|
||||
summary: "Получение всех привелегий",
|
||||
description: "Получение всех привелегий в виде объекта ключ-значение, где ключём является serviceKey",
|
||||
tags: ["privilege"],
|
||||
response: getAllPrivilegiesMapReponse,
|
||||
response: getAllPrivilegesMapReponse,
|
||||
};
|
||||
|
||||
export const getPrivilegeSchema: SwaggerSchema = {
|
||||
@ -34,11 +34,11 @@ export const getPrivilegeSchema: SwaggerSchema = {
|
||||
response: getPrivilegeReponse,
|
||||
};
|
||||
|
||||
export const getServicePrivilegiesSchema: SwaggerSchema = {
|
||||
export const getServicePrivilegesSchema: SwaggerSchema = {
|
||||
summary: "Получение привилегий сервиса",
|
||||
tags: ["privilege"],
|
||||
params: getServicePrivilegiesParams,
|
||||
response: getPrivilegiesReponse,
|
||||
params: getServicePrivilegesParams,
|
||||
response: getPrivilegesReponse,
|
||||
};
|
||||
|
||||
export const registerPrivilegeSchema: SwaggerSchema = {
|
||||
@ -48,11 +48,11 @@ export const registerPrivilegeSchema: SwaggerSchema = {
|
||||
response: registerPrivilegeResponse,
|
||||
};
|
||||
|
||||
export const registerPrivilegiesSchema: SwaggerSchema = {
|
||||
export const registerPrivilegesSchema: SwaggerSchema = {
|
||||
summary: "Регистрация привелегий сервиса",
|
||||
tags: ["privilege"],
|
||||
body: registerPrivilegiesBody,
|
||||
response: registerPrivilegiesResponse,
|
||||
body: registerPrivilegesBody,
|
||||
response: registerPrivilegesResponse,
|
||||
};
|
||||
|
||||
export const replacePrivilegeSchema: SwaggerSchema = {
|
||||
@ -62,11 +62,11 @@ export const replacePrivilegeSchema: SwaggerSchema = {
|
||||
response: replacePrivilegeResponse,
|
||||
};
|
||||
|
||||
export const replacePrivilegiesSchema: SwaggerSchema = {
|
||||
export const replacePrivilegesSchema: SwaggerSchema = {
|
||||
summary: "Замена привилегий сервиса",
|
||||
tags: ["privilege"],
|
||||
body: registerPrivilegiesBody,
|
||||
response: replacePrivilegiesResponse,
|
||||
body: registerPrivilegesBody,
|
||||
response: replacePrivilegesResponse,
|
||||
};
|
||||
|
||||
export const removePrivilegeSchema: SwaggerSchema = {
|
||||
|
@ -27,15 +27,15 @@ export const privilegeBody: SwaggerMessage = {
|
||||
],
|
||||
};
|
||||
|
||||
export const privilegiesBody: SwaggerMessage = {
|
||||
export const privilegesBody: SwaggerMessage = {
|
||||
type: "array",
|
||||
items: privilegeBody,
|
||||
};
|
||||
|
||||
export const registerPrivilegiesBody: SwaggerMessage = {
|
||||
export const registerPrivilegesBody: SwaggerMessage = {
|
||||
type: "object",
|
||||
properties: {
|
||||
privilegies: privilegiesBody,
|
||||
privileges: privilegesBody,
|
||||
},
|
||||
};
|
||||
|
||||
@ -51,7 +51,7 @@ export const getPrivilegeParams: SwaggerMessage = {
|
||||
examples: [{ privilegeId: "507f1f77bcf86cd799439011" }],
|
||||
};
|
||||
|
||||
export const getServicePrivilegiesParams: SwaggerMessage = {
|
||||
export const getServicePrivilegesParams: SwaggerMessage = {
|
||||
type: "object",
|
||||
required: ["serviceKey"],
|
||||
properties: {
|
||||
|
@ -4,7 +4,7 @@ import { privilege } from "./models";
|
||||
|
||||
import type { SwaggerMessage } from "@/types/swagger.type";
|
||||
|
||||
export const getAllPrivilegiesReponse: Record<string, SwaggerMessage> = {
|
||||
export const getAllPrivilegesReponse: Record<string, SwaggerMessage> = {
|
||||
200: {
|
||||
type: "array",
|
||||
description: "Привилегии",
|
||||
@ -12,7 +12,7 @@ export const getAllPrivilegiesReponse: Record<string, SwaggerMessage> = {
|
||||
},
|
||||
};
|
||||
|
||||
export const getAllPrivilegiesMapReponse: Record<string, SwaggerMessage> = {
|
||||
export const getAllPrivilegesMapReponse: Record<string, SwaggerMessage> = {
|
||||
200: {
|
||||
type: "object",
|
||||
description: "Привилегии",
|
||||
@ -44,7 +44,7 @@ export const getAllPrivilegiesMapReponse: Record<string, SwaggerMessage> = {
|
||||
},
|
||||
};
|
||||
|
||||
export const getPrivilegiesReponse: Record<string, SwaggerMessage> = {
|
||||
export const getPrivilegesReponse: Record<string, SwaggerMessage> = {
|
||||
200: {
|
||||
type: "array",
|
||||
description: "Массив привилегий",
|
||||
@ -64,7 +64,7 @@ export const registerPrivilegeResponse: Record<string, SwaggerMessage> = {
|
||||
409: swaggerError(409, "privilege already exist"),
|
||||
};
|
||||
|
||||
export const registerPrivilegiesResponse: Record<string, SwaggerMessage> = {
|
||||
export const registerPrivilegesResponse: Record<string, SwaggerMessage> = {
|
||||
200: {
|
||||
type: "array",
|
||||
description: "Массив привилегий",
|
||||
@ -79,7 +79,7 @@ export const replacePrivilegeResponse: Record<string, SwaggerMessage> = {
|
||||
404: swaggerError(404, "privilege not found"),
|
||||
};
|
||||
|
||||
export const replacePrivilegiesResponse: Record<string, SwaggerMessage> = {
|
||||
export const replacePrivilegesResponse: Record<string, SwaggerMessage> = {
|
||||
200: {
|
||||
type: "array",
|
||||
description: "Массив привилегий",
|
||||
|
@ -29,12 +29,12 @@ export const getTariffsQuerystring: SwaggerMessage = {
|
||||
export const tariffBody: SwaggerMessage = {
|
||||
type: "object",
|
||||
description: "Тариф",
|
||||
required: ["name", "isCustom", "privilegies"],
|
||||
required: ["name", "isCustom", "privileges"],
|
||||
properties: {
|
||||
name: { type: "string" },
|
||||
price: { type: "number" },
|
||||
isCustom: { type: "boolean" },
|
||||
privilegies: {
|
||||
privileges: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "object",
|
||||
@ -57,7 +57,7 @@ export const tariffBody: SwaggerMessage = {
|
||||
name: "Использование сервисов",
|
||||
price: 14000,
|
||||
isCustom: false,
|
||||
privilegies: [
|
||||
privileges: [
|
||||
{
|
||||
name: "Количество попыток использования",
|
||||
privilegeId: "507f1f77bcf86cd799439011",
|
||||
|
@ -8,7 +8,7 @@ export const tariff: SwaggerMessage = {
|
||||
name: { type: "string" },
|
||||
price: { type: "number" },
|
||||
isCustom: { type: "boolean" },
|
||||
privilegies: {
|
||||
privileges: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "object",
|
||||
@ -43,7 +43,7 @@ export const tariff: SwaggerMessage = {
|
||||
name: "Использование сервисов",
|
||||
price: 14000,
|
||||
isCustom: false,
|
||||
privilegies: [
|
||||
privileges: [
|
||||
{
|
||||
name: "name",
|
||||
privilegeId: "507f1f77bcf86cd799439011",
|
||||
@ -63,7 +63,7 @@ export const tariff: SwaggerMessage = {
|
||||
name: "user",
|
||||
price: 14000,
|
||||
isCustom: false,
|
||||
privilegies: [
|
||||
privileges: [
|
||||
{
|
||||
name: "507f1f77bcf86cd799439011",
|
||||
privilegeId: "507f1f77bcf86cd799439011",
|
||||
@ -103,7 +103,7 @@ export const tariffs: SwaggerMessage = {
|
||||
name: "Использование сервисов",
|
||||
price: 14000,
|
||||
isCustom: false,
|
||||
privilegies: [
|
||||
privileges: [
|
||||
{
|
||||
name: "name",
|
||||
privilegeId: "507f1f77bcf86cd799439011",
|
||||
@ -123,7 +123,7 @@ export const tariffs: SwaggerMessage = {
|
||||
name: "user",
|
||||
price: 14000,
|
||||
isCustom: false,
|
||||
privilegies: [
|
||||
privileges: [
|
||||
{
|
||||
name: "507f1f77bcf86cd799439011",
|
||||
privilegeId: "507f1f77bcf86cd799439011",
|
||||
|
@ -6,5 +6,5 @@ export type Tariff = Eloquent & {
|
||||
userId: string;
|
||||
price?: number;
|
||||
isCustom: boolean;
|
||||
privilegies: Array<Omit<Privilege, keyof Eloquent>>;
|
||||
privileges: Array<Omit<Privilege, keyof Eloquent>>;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user