38 lines
1.3 KiB
TypeScript
38 lines
1.3 KiB
TypeScript
/**
|
|
* Monthly commission cap checks per referrer (beneficiary).
|
|
*/
|
|
export type MonthlyCapInput = {
|
|
currentReservedAmount: bigint;
|
|
currentReservedCount: number;
|
|
newCommissionAmount: bigint;
|
|
maxAmountRaw: bigint;
|
|
maxCount: number;
|
|
};
|
|
export type LevelCapConfig = {
|
|
monthlyMaxAmountRaw: string | bigint;
|
|
monthlyMaxCount: number;
|
|
};
|
|
export type EffectiveMonthlyCaps = {
|
|
maxAmountRaw: bigint;
|
|
maxCount: number;
|
|
source: 'global' | 'level';
|
|
};
|
|
export type MonthlyCapResult = {
|
|
exceeded: boolean;
|
|
reason?: 'amount' | 'count';
|
|
};
|
|
/** Level caps of 0 inherit from global program settings. */
|
|
export declare function resolveEffectiveLevelCaps(global: {
|
|
maxAmountRaw: bigint;
|
|
maxCount: number;
|
|
}, level?: LevelCapConfig | null): EffectiveMonthlyCaps;
|
|
/** Returns whether adding a commission would exceed configured monthly caps (0 = unlimited). */
|
|
export declare function wouldExceedMonthlyCommissionCap(input: MonthlyCapInput): MonthlyCapResult;
|
|
/** Validates reserved totals already include the payout being settled (no double-count). */
|
|
export declare function wouldExceedMonthlyCapAtSettlement(input: {
|
|
reservedAmount: bigint;
|
|
reservedCount: number;
|
|
maxAmountRaw: bigint;
|
|
maxCount: number;
|
|
}): MonthlyCapResult;
|
|
//# sourceMappingURL=referralCapService.d.ts.map
|