import { ICollectionAuditedEntity, ICollectionMoney } from './Common'; export declare enum PaymentPlanType { NORMAL = "NORMAL", BALLOON = "BALLOON" } export declare enum PaymentPlanConfigurationStatus { DRAFT = "DRAFT", ACTIVE = "ACTIVE", ARCHIVED = "ARCHIVED" } export declare enum PaymentPlanFrequency { WEEKLY = "WEEKLY", BIWEEKLY = "BIWEEKLY", MONTHLY = "MONTHLY", CUSTOM = "CUSTOM" } export declare enum PaymentDueDateAdjustment { NONE = "NONE", NEXT_BUSINESS_DAY = "NEXT_BUSINESS_DAY", PREVIOUS_BUSINESS_DAY = "PREVIOUS_BUSINESS_DAY" } export declare enum DecimalRoundingMode { HALF_UP = "HALF_UP", HALF_EVEN = "HALF_EVEN", UP = "UP", DOWN = "DOWN" } export interface IPaymentPlanFormulaTestCase { name: string; variables: { [variableName: string]: string; }; expectedResult: string; } export interface IPaymentPlanFormula { /** Expression in the backend-supported formula DSL. Never executable JavaScript. */ expression: string; variableNames: string[]; allowedFunctionNames?: string[]; roundingMode: DecimalRoundingMode; testCases?: IPaymentPlanFormulaTestCase[]; } export interface IPaymentPlanFeeTier { id: string; fromDays: number; toDays: number; honorariumPercentage: string; honorariumCoefficient: string; collectionCommissionPercentage: string; expenseCommissionPercentage: string; } export interface IPaymentPlanConfigurationSnapshot { configurationId: string; configurationVersion: number; name: string; type: PaymentPlanType; minimumInstallments: number; maximumInstallments: number; frequency: PaymentPlanFrequency; dueDateAdjustment: PaymentDueDateAdjustment; businessCalendarId?: string; updateInterestPercentage?: string; refinancingInterestPercentage?: string; otherCharges?: ICollectionMoney; vatPercentage?: string; vatCoefficient?: string; feeTiers: IPaymentPlanFeeTier[]; firstPaymentFormula: IPaymentPlanFormula; installmentFormula: IPaymentPlanFormula; balloonPaymentFormula?: IPaymentPlanFormula; } export interface IPaymentPlanConfiguration extends ICollectionAuditedEntity { portfolioId: string; name: string; description?: string; type: PaymentPlanType; status: PaymentPlanConfigurationStatus; version: number; previousVersionId?: string; minimumInstallments: number; maximumInstallments: number; frequency: PaymentPlanFrequency; dueDateAdjustment: PaymentDueDateAdjustment; businessCalendarId?: string; updateInterestPercentage?: string; refinancingInterestPercentage?: string; otherCharges?: ICollectionMoney; vatPercentage?: string; vatCoefficient?: string; /** Ranges may contain gaps but must never overlap. */ feeTiers: IPaymentPlanFeeTier[]; firstPaymentFormula: IPaymentPlanFormula; installmentFormula: IPaymentPlanFormula; /** Required when type is BALLOON. */ balloonPaymentFormula?: IPaymentPlanFormula; activatedAt?: Date; activatedBy?: string; archivedAt?: Date; archivedBy?: string; }