import { AutoEncoder } from '@simonbackx/simple-encoding'; import { Group } from './Group.js'; import { GroupPriceDiscount } from './GroupPriceDiscount.js'; import { type RegisterCart } from './members/checkout/RegisterCart.js'; import { RegisterItem } from './members/checkout/RegisterItem.js'; import { RegistrationWithPlatformMember } from './members/checkout/RegistrationWithPlatformMember.js'; import { type PlatformMember } from './members/PlatformMember.js'; import { TranslatedString } from './TranslatedString.js'; export declare class BundleDiscount extends AutoEncoder { id: string; name: TranslatedString; discounts: GroupPriceDiscount[]; /** * Whether all registrations of the family are counted together (true), or they are all counted separately per member (false). */ countWholeFamily: boolean; /** * Whether all registrations are counted together regardless the group (false), or each group is counted separately (true). * Note: this is always false (ignored) if countWholeFamily is false. Because a member cannot register for the same group multiple times. */ countPerGroup: boolean; get humanDescription(): string; static discountsToText(discounts: GroupPriceDiscount[]): string; get discountsText(): string; calculate(cart: RegisterCart): BundleDiscountCalculationGroup; applyableTo(item: RegisterItem | RegistrationWithPlatformMember): boolean; } declare class BundleDiscountCalculationGroup { bundle: BundleDiscount; calculations: Map; constructor(options: { bundle: BundleDiscount; }); calculate(): void; getCalculationFor(item: RegisterItem | RegistrationWithPlatformMember, options?: { onlyExisting?: boolean; }): BundleDiscountCalculation | null; } export declare class BundleDiscountCalculation { bundle: BundleDiscount; member: PlatformMember | null; group: Group | null; /** * Keep track of the distribution of discounts. * This will set the 'applied discounts' for these items once their registration is created in the database */ items: Map; /** * Existing registations that cause a discount. * The value contains the new calculated discount for this registration */ registrations: Map; /** * Keeps track of the deleted registrations so we can exclude these registrations from the calculation */ deleteRegistrations: RegistrationWithPlatformMember[]; constructor(options: { bundle: BundleDiscount; group?: Group | null; member?: PlatformMember | null; }); get name(): string; /** The total dicount, not taking into account what has already been given in the past */ get total(): number; get totalAlreadyApplied(): number; get netTotal(): number; get netTotalDueLater(): number; get netTotalDueNow(): number; getTotalFor(item: RegisterItem | RegistrationWithPlatformMember): number; addIfNotBeingRemoved(item: RegisterItem | RegistrationWithPlatformMember): void; add(item: RegisterItem | RegistrationWithPlatformMember): void; remove(registration: RegistrationWithPlatformMember): void; get itemsAndRegistrations(): (RegisterItem | RegistrationWithPlatformMember)[]; calculate(): void; } export {}; //# sourceMappingURL=BundleDiscount.d.ts.map