2023-03-06 13:23:13 +00:00
|
|
|
export const SERVICE_LIST = [
|
2023-06-20 18:21:44 +00:00
|
|
|
{
|
|
|
|
serviceKey: "templategen",
|
|
|
|
displayName: "Шаблонизатор документов",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
serviceKey: "squiz",
|
|
|
|
displayName: "Опросник",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
serviceKey: "dwarfener",
|
|
|
|
displayName: "Аналитика сокращателя",
|
|
|
|
},
|
2023-03-06 13:23:13 +00:00
|
|
|
] as const;
|
|
|
|
|
2023-05-16 16:57:44 +00:00
|
|
|
export type ServiceType = (typeof SERVICE_LIST)[number]["serviceKey"];
|
2023-03-06 13:23:13 +00:00
|
|
|
|
2023-05-16 16:57:44 +00:00
|
|
|
export type PrivilegeType = "unlim" | "gencount" | "activequiz" | "abcount" | "extended";
|
2023-03-06 13:23:13 +00:00
|
|
|
|
2023-06-15 20:29:27 +00:00
|
|
|
export interface Privilege_BACKEND {
|
2023-06-20 18:21:44 +00:00
|
|
|
name: string;
|
|
|
|
privilegeId: string;
|
2023-07-12 10:27:21 +00:00
|
|
|
serviceKey: "templategen" | "squiz" | "dwarfener";
|
2023-06-20 18:21:44 +00:00
|
|
|
amount: number;
|
|
|
|
description: string;
|
|
|
|
price: number;
|
2023-07-12 10:27:21 +00:00
|
|
|
type: "count" | "day" | "mb";
|
2023-06-20 18:21:44 +00:00
|
|
|
value: string;
|
|
|
|
updatedAt: string;
|
|
|
|
_id: string;
|
2023-03-06 13:23:13 +00:00
|
|
|
}
|
2023-07-12 10:27:21 +00:00
|
|
|
|
2023-06-15 20:29:27 +00:00
|
|
|
export type Tariff_FRONTEND = {
|
2023-06-20 18:21:44 +00:00
|
|
|
id: string,
|
|
|
|
name: string,
|
|
|
|
amount: number,
|
|
|
|
privilegeId: string,
|
|
|
|
customPricePerUnit?: number;
|
|
|
|
};
|
|
|
|
|
|
|
|
/** @deprecated */
|
|
|
|
export interface Privilege {
|
|
|
|
serviceKey: ServiceType;
|
|
|
|
name: PrivilegeType;
|
|
|
|
privilegeId: string;
|
|
|
|
description: string;
|
|
|
|
/** Единица измерения привелегии: время в днях/кол-во */
|
|
|
|
type: "day" | "count";
|
|
|
|
/** Стоимость одной единицы привелегии */
|
|
|
|
price: number;
|
|
|
|
}
|
|
|
|
|
2023-07-03 10:55:43 +00:00
|
|
|
export type Tariff_BACKEND = {
|
|
|
|
_id: string,
|
|
|
|
name: string,
|
|
|
|
price: number,
|
|
|
|
isCustom: boolean,
|
|
|
|
isFront: false,
|
|
|
|
privilegies: Privilege_BACKEND[],
|
|
|
|
isDeleted: boolean,
|
|
|
|
createdAt: string,
|
|
|
|
updatedAt: string;
|
|
|
|
};
|
|
|
|
export type Tariff = {
|
2023-06-20 18:21:44 +00:00
|
|
|
id: string;
|
|
|
|
name: string;
|
2023-07-03 11:28:42 +00:00
|
|
|
isCustom?: boolean;
|
|
|
|
price?: number;
|
2023-06-20 18:21:44 +00:00
|
|
|
privilegeId: string;
|
2023-07-03 10:55:43 +00:00
|
|
|
amount: number; //Количество единиц привелегии
|
|
|
|
customPricePerUnit?: number; //Кастомная цена, если есть, то используется вместо privilege.price
|
|
|
|
isDeleted?: boolean,
|
2023-06-20 18:21:44 +00:00
|
|
|
isFront?: boolean;
|
|
|
|
}
|