WEB-331: Introduce loan reaging preview

This commit is contained in:
Oleksii Novikov
2025-11-12 13:08:39 +02:00
parent 38faa475ba
commit 8514f996b6
24 changed files with 403 additions and 93 deletions
@@ -1,6 +1,7 @@
import { Component, Input } from '@angular/core';
import { ActivatedRoute, RouterLink } from '@angular/router';
import { LoansService } from 'app/loans/loans.service';
import { RepaymentSchedule } from 'app/loans/models/loan-account.model';
import { SettingsService } from 'app/settings/settings.service';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
import { RepaymentScheduleTabComponent } from '../../loans-view/repayment-schedule-tab/repayment-schedule-tab.component';
@@ -23,15 +24,15 @@ export class LoansAccountScheduleStepComponent {
/** Currency Code */
@Input() currencyCode: string;
/** Loans Account Template */
@Input() loansAccountTemplate: any;
@Input() loansAccountTemplate: Record<string, unknown>;
/** Loans Account Product Template */
@Input() loansAccountProductTemplate: any;
@Input() loansAccountProductTemplate: { calendarOptions?: unknown };
/** Loans Account Data */
@Input() loansAccount: any;
@Input() loansAccount: Record<string, unknown>;
repaymentScheduleDetails: any = { periods: [] };
repaymentScheduleDetails: RepaymentSchedule | null = null;
loanId: any = null;
loanId: string | null = null;
constructor(
private loansService: LoansService,
@@ -42,7 +43,7 @@ export class LoansAccountScheduleStepComponent {
}
showRepaymentInfo(): void {
this.repaymentScheduleDetails = { periods: [] };
this.repaymentScheduleDetails = null;
const locale = this.settingsService.language.code;
const dateFormat = this.settingsService.dateFormat;
const payload = this.loansService.buildLoanRequestPayload(
@@ -55,7 +56,7 @@ export class LoansAccountScheduleStepComponent {
delete payload['enableInstallmentLevelDelinquency'];
delete payload['externalId'];
this.loansService.calculateLoanSchedule(payload).subscribe((response: any) => {
this.loansService.calculateLoanSchedule(payload).subscribe((response: RepaymentSchedule) => {
this.repaymentScheduleDetails = response;
});
}