import { Discount } from "../../modules/Discount/types";
export declare const uniqueById: <T>(arr: T[], key?: string) => T[];
export declare const isNormalProductByDurationSchedule: (item: any) => boolean;
export declare const isAllNormalProduct: (items: any[]) => boolean;
/**
 * 获取折扣金额 基于折扣卡类型计算
 * 商品券：直接返回商品价格
 * 折扣卡：根据折扣卡类型计算 固定金额：直接返回折扣卡金额 百分比：根据折扣卡金额计算
 * @param discount
 * @param total
 * @param price
 * @returns
 */
export declare const getDiscountAmount: (discount: Discount, total: number, price: number) => number;
export declare const getDiscountListAmountTotal: (discount: Discount[]) => any;
/**
 * 获取折扣金额 计算每个折扣的金额
 * @param discount
 * @returns
 */
export declare const getDiscountListAmount: (discount: Discount[]) => any;
export interface ScheduleItem {
    id: number;
    name: string | {
        [key: string]: string;
    };
    type: 'standard' | 'time-slots' | 'designation';
    start_time: string | null;
    end_time: string | null;
    repeat_type: 'none' | 'daily' | 'weekly';
    repeat_rule: {
        end: {
            type: 'never' | 'date' | 'occurrence';
            end_date: string | null;
            occurrence: number | null;
        };
        frequency: number;
        excluded_date: Array<{
            start: string;
            end: string;
        }>;
        included_date: Array<{
            start: string;
            end: string;
        }>;
        frequency_date: number[];
    } | null;
    designation: Array<{
        start_date: string;
        start_time: string;
        end_date: string;
        end_time: string;
    }> | null;
    is_all: number;
    time_slot: Array<{
        start_time: string;
        end_time: string;
    }>;
}
export declare const getDateIsInSchedule: (dateTime: string, scheduleList: ScheduleItem[]) => boolean;
/**
 * 根据预约时间过滤优惠券列表
 * @param discountList 优惠券列表
 * @param bookingTime 预约时间 (格式: YYYY-MM-DD HH:mm:ss)
 * @returns 过滤后的优惠券列表
 */
export declare const filterDiscountListByBookingTime: (discountList: Discount[], bookingTime: string | null) => Discount[];
/**
 * 判断是否是订单级别的固定金额折扣卡
 * @param discount 折扣
 * @returns 是否是订单级别的固定金额折扣卡
 */
export declare const isOrderLevelFixedAmountDiscount: (discount: Discount) => boolean;
/**
 * 计算订单级别固定金额折扣卡的分摊结果
 * @param discount 折扣卡
 * @param applicableProducts 适用商品列表 { productId, amount, quantity, parentQuantity }
 * @returns 分摊结果 Map<productId, { discountAmount, difference }>
 * 注意：
 * - discountAmount 是单价折扣金额（不是总折扣金额）
 * - difference（总差值）优先直接加到数量为1的单商品折扣上，如果没有则存储在metadata中
 */
export declare const calculateOrderLevelDiscountAllocation: (discount: Discount, applicableProducts: Array<{
    productId: string | number;
    amount: number;
    quantity: number;
    parentQuantity?: number;
}>) => Map<string | number, {
    discountAmount: number;
    difference: number;
}>;
