adminFront/src/model/discount.ts
2024-05-21 10:41:31 +03:00

52 lines
957 B
TypeScript

import { Discount } from "@frontend/kitui";
export type GetDiscountResponse = {
Discounts: Discount[];
};
export const discountTypes = {
purchasesAmount: "Лояльность",
cartPurchasesAmount: "Корзина",
service: "Сервис",
privilege: "Товар",
} as const;
export type DiscountType = keyof typeof discountTypes;
export type CreateDiscountBody = {
Name: string;
Layer: 1 | 2 | 3 | 4;
Description: string;
Condition: {
Period: {
/** ISO string */
From: string;
/** ISO string */
To: string;
};
User: string;
UserType: string;
Coupon: string;
PurchasesAmount: number;
CartPurchasesAmount: number;
Product: string;
Term: number;
Usage: number;
PriceFrom: number;
Group: string;
};
Target: {
Factor: number;
TargetScope: "Sum" | "Group" | "Each";
Overhelm: boolean;
TargetGroup: string;
Products: [
{
ID: string;
Factor: number;
Overhelm: false;
},
];
};
};