fix types

This commit is contained in:
nflnkr 2023-02-25 15:28:50 +03:00
parent 62c8890112
commit 6c5c229455
3 changed files with 23 additions and 23 deletions

@ -49,23 +49,6 @@ export interface Discount {
// New types from snippet
export namespace Cart {
export type PrivilegeType =
| "unlim"
| "gencount"
| "activequiz"
| "abcount"
| "extended";
export interface Privilege {
serviceKey: Tariffs.ServiceType;
name: PrivilegeType;
privilegeId: string;
description: string;
type: "day" | "count";
price: number;
}
interface DiscountBase {
_id: string;
name: string;
@ -193,7 +176,7 @@ export namespace Cart {
endless: boolean;
from: string;
dueTo: string;
privileges: Privilege[];
privileges: Tariffs.Privilege[];
}
export interface CartItem {

@ -38,11 +38,27 @@ export interface ArrayProps {
tariffs?: Array<Tariff>;
}
export const SERVICE_LIST = ["templategen", "squiz", "dwarfener"] as const;
export namespace Tariffs {
export type ServiceType =
| "templategen"
| "squiz"
| "dwarfener";
export type ServiceType = typeof SERVICE_LIST[number];
export type PrivilegeType =
| "unlim"
| "gencount"
| "activequiz"
| "abcount"
| "extended";
export interface Privilege {
serviceKey: Tariffs.ServiceType;
name: PrivilegeType;
privilegeId: string;
description: string;
type: "day" | "count";
price: number;
}
export interface Tariff {
id: string;

@ -1,8 +1,9 @@
import { Cart } from "../../model/cart";
import { Tariffs } from "../../model/tariff";
type ExampleCartValues = {
privileges: Cart.Privilege[];
privileges: Tariffs.Privilege[];
discounts: Cart.AnyDiscount[];
testCases: any;
};