import { AmountData, amountDataFromJson } from './AmountData'; export { AmountData } from './AmountData'; export class InstallmentPlan { id?: string; installmentPeriod?: number; interestRate?: number; amount?: AmountData; upfrontFees?: number; issuerCode?: string; issuerNameEn?: string; issuerNameAr?: string; issuerLogoAr?: string; issuerLogoEn?: string; processingFeesType?: string; processingFeesAmount?: string; feeDisplayValue?: string; constructor( id?: string, installmentPeriod?: number, interestRate?: number, amount?: AmountData, upfrontFees?: number, issuerCode?: string, issuerNameEn?: string, issuerNameAr?: string, issuerLogoAr?: string, issuerLogoEn?: string, processingFeesType?: string, processingFeesAmount?: string, feeDisplayValue?: string ) { this.id = id; this.installmentPeriod = installmentPeriod; this.interestRate = interestRate; this.amount = amount; this.upfrontFees = upfrontFees; this.issuerCode = issuerCode; this.issuerNameEn = issuerNameEn; this.issuerNameAr = issuerNameAr; this.issuerLogoAr = issuerLogoAr; this.issuerLogoEn = issuerLogoEn; this.processingFeesType = processingFeesType; this.processingFeesAmount = processingFeesAmount; this.feeDisplayValue = feeDisplayValue; } } /** * Creates an InstallmentPlan instance from a JSON object. */ export function installmentPlanFromJson(json: { [key: string]: any; }): InstallmentPlan { return new InstallmentPlan( json.id, json.installment_period, typeof json.interest_rate === 'number' ? json.interest_rate : undefined, json.amount ? amountDataFromJson(json.amount) : undefined, typeof json.upfront_fees === 'number' ? json.upfront_fees : undefined, json.issuer_code, json.issuer_name_en, json.issuer_name_ar, json.issuer_logo_ar, json.issuer_logo_en, json.processing_fees_type, json.processing_fees_amount, json.fee_display_value ); }