adminFront/src/model/tariff.ts

46 lines
1.2 KiB
TypeScript
Raw Normal View History

2023-02-18 14:00:49 +00:00
2023-02-25 12:28:50 +00:00
2023-03-06 13:23:13 +00:00
export const SERVICE_LIST = [
{
serviceKey: "templategen",
displayName: "Шаблонизатор документов"
},
{
serviceKey: "squiz",
displayName: "Опросник"
},
{
serviceKey: "dwarfener",
displayName: "Сокращатель ссылок"
2023-02-25 12:28:50 +00:00
}
2023-03-06 13:23:13 +00:00
] as const;
export type ServiceType = typeof SERVICE_LIST[number]["serviceKey"];
export type PrivilegeType =
| "unlim"
| "gencount"
| "activequiz"
| "abcount"
| "extended";
export interface Privilege {
serviceKey: ServiceType;
name: PrivilegeType;
privilegeId: string;
description: string;
/** Единица измерения привелегии: время в днях/кол-во */
type: "day" | "count";
/** Стоимость одной единицы привелегии */
pricePerUnit: number;
}
2023-02-25 09:22:54 +00:00
2023-03-06 13:23:13 +00:00
export interface Tariff {
id: string;
name: string;
privilege: Privilege;
/** Количество единиц привелегии */
amount: number;
/** Кастомная цена, если есть, то используется вместо privilege.price */
customPricePerUnit?: number;
2023-02-25 09:22:54 +00:00
}