From 0e178e8ab55ceec902b673309674542a2c9dde45 Mon Sep 17 00:00:00 2001 From: Jose Alberto Hernandez Date: Sun, 4 Sep 2022 16:24:04 -0500 Subject: [PATCH] Realtime Loan Delinquency Classification --- .../shell/breadcrumb/breadcrumb.component.ts | 1 + .../loan-delinquency-tags.resolver.ts | 31 +++ .../create-loans-account.component.html | 2 +- .../create-loans-account.component.ts | 7 +- .../edit-loans-account.component.ts | 13 +- .../loans-account-charges-step.component.html | 7 +- .../loans-account-charges-step.component.ts | 4 + .../loans-account-details-step.component.html | 3 + .../loans-account-details-step.component.ts | 7 +- .../loans-account-terms-step.component.html | 211 +++++++-------- .../loans-account-terms-step.component.ts | 252 +++++++++++++----- src/app/loans/loans-routing.module.ts | 18 +- .../loan-delinquency-tags-tab.component.html | 36 +++ .../loan-delinquency-tags-tab.component.scss | 11 + ...oan-delinquency-tags-tab.component.spec.ts | 25 ++ .../loan-delinquency-tags-tab.component.ts | 23 ++ .../loans-view/loans-view.component.html | 6 + src/app/loans/loans.module.ts | 4 +- src/app/loans/loans.service.ts | 61 +++-- 19 files changed, 509 insertions(+), 213 deletions(-) create mode 100644 src/app/loans/common-resolvers/loan-delinquency-tags.resolver.ts create mode 100644 src/app/loans/loans-view/loan-delinquency-tags-tab/loan-delinquency-tags-tab.component.html create mode 100644 src/app/loans/loans-view/loan-delinquency-tags-tab/loan-delinquency-tags-tab.component.scss create mode 100644 src/app/loans/loans-view/loan-delinquency-tags-tab/loan-delinquency-tags-tab.component.spec.ts create mode 100644 src/app/loans/loans-view/loan-delinquency-tags-tab/loan-delinquency-tags-tab.component.ts diff --git a/src/app/core/shell/breadcrumb/breadcrumb.component.ts b/src/app/core/shell/breadcrumb/breadcrumb.component.ts index 7f177b206..48e31fa66 100644 --- a/src/app/core/shell/breadcrumb/breadcrumb.component.ts +++ b/src/app/core/shell/breadcrumb/breadcrumb.component.ts @@ -107,6 +107,7 @@ export class BreadcrumbComponent implements OnInit { const routeData: Data = route.snapshot.data; if (routeData.breadcrumb === 'Clients') { breadcrumbLabel = routeData.clientViewData.displayName; + currentUrl += `/general`; } else if (routeData.breadcrumb === 'Groups') { breadcrumbLabel = routeData.groupViewData.name; } else if (routeData.breadcrumb === 'Centers') { diff --git a/src/app/loans/common-resolvers/loan-delinquency-tags.resolver.ts b/src/app/loans/common-resolvers/loan-delinquency-tags.resolver.ts new file mode 100644 index 000000000..f310243bf --- /dev/null +++ b/src/app/loans/common-resolvers/loan-delinquency-tags.resolver.ts @@ -0,0 +1,31 @@ +/** Angular Imports */ +import { Injectable } from '@angular/core'; +import { Resolve, ActivatedRouteSnapshot } from '@angular/router'; + +/** rxjs Imports */ +import { Observable } from 'rxjs'; + +/** Custom Services */ +import { LoansService } from '../loans.service'; + +/** + * Clients data resolver. + */ +@Injectable() +export class LoanDelinquencyTagsResolver implements Resolve { + + /** + * @param {LoansService} LoansService Loans service. + */ + constructor(private loansService: LoansService) { } + + /** + * Returns the Loans with Association data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId') || route.parent.parent.paramMap.get('loanId'); + return this.loansService.getDelinquencyTags(loanId); + } + +} diff --git a/src/app/loans/create-loans-account/create-loans-account.component.html b/src/app/loans/create-loans-account/create-loans-account.component.html index 41a2112aa..7ba4b21c9 100644 --- a/src/app/loans/create-loans-account/create-loans-account.component.html +++ b/src/app/loans/create-loans-account/create-loans-account.component.html @@ -36,7 +36,7 @@ TERMS diff --git a/src/app/loans/create-loans-account/create-loans-account.component.ts b/src/app/loans/create-loans-account/create-loans-account.component.ts index f67418998..32474e018 100644 --- a/src/app/loans/create-loans-account/create-loans-account.component.ts +++ b/src/app/loans/create-loans-account/create-loans-account.component.ts @@ -110,7 +110,8 @@ export class CreateLoansAccountComponent implements OnInit { ...this.loansAccountDetailsStep.loansAccountDetails, ...this.loansAccountTermsStep.loansAccountTerms, ...this.loansAccountChargesStep.loansAccountCharges, - ...this.loansAccountTermsStep.loanCollateral + ...this.loansAccountTermsStep.loanCollateral, + ...this.loansAccountTermsStep.disbursementData }; } @@ -169,9 +170,11 @@ export class CreateLoansAccountComponent implements OnInit { delete loansAccountData.disbursementData; } delete loansAccountData.isValid; + loansAccountData.principal = loansAccountData.principalAmount; + delete loansAccountData.principalAmount; this.loansService.createLoansAccount(loansAccountData).subscribe((response: any) => { - this.router.navigate(['../', response.resourceId], { relativeTo: this.route }); + this.router.navigate(['../', response.resourceId, 'general'], { relativeTo: this.route }); }); } diff --git a/src/app/loans/edit-loans-account/edit-loans-account.component.ts b/src/app/loans/edit-loans-account/edit-loans-account.component.ts index a91331df9..abcd0e35f 100644 --- a/src/app/loans/edit-loans-account/edit-loans-account.component.ts +++ b/src/app/loans/edit-loans-account/edit-loans-account.component.ts @@ -78,11 +78,12 @@ export class EditLoansAccountComponent implements OnInit { /** Checks wheter all the forms in different steps are valid and not pristine */ get loansAccountFormValidAndNotPristine() { return ( - this.loansAccountDetailsForm.valid && - this.loansAccountTermsForm.valid && + (this.loansAccountDetailsForm.valid && + this.loansAccountTermsForm.valid) && ( !this.loansAccountDetailsForm.pristine || !this.loansAccountTermsForm.pristine || + !this.loansAccountTermsStep.pristine || !this.loansAccountChargesStep.pristine ) ); @@ -94,6 +95,8 @@ export class EditLoansAccountComponent implements OnInit { ...this.loansAccountDetailsStep.loansAccountDetails, ...this.loansAccountTermsStep.loansAccountTerms, ...this.loansAccountChargesStep.loansAccountCharges, + ...this.loansAccountTermsStep.loanCollateral, + ...this.loansAccountTermsStep.disbursementData }; } @@ -117,6 +120,10 @@ export class EditLoansAccountComponent implements OnInit { value: collateralEle.value, description: collateralEle.description })), + disbursementData: this.loansAccount.disbursementData.map((item: any) => ({ + expectedDisbursementDate: this.dateUtils.formatDate(item.expectedDisbursementDate, dateFormat), + principal: item.principal + })), interestChargedFromDate: this.dateUtils.formatDate(this.loansAccount.interestChargedFromDate, dateFormat), repaymentsStartingFromDate: this.dateUtils.formatDate(this.loansAccount.repaymentsStartingFromDate, dateFormat), submittedOnDate: this.dateUtils.formatDate(this.loansAccount.submittedOnDate, dateFormat), @@ -141,6 +148,8 @@ export class EditLoansAccountComponent implements OnInit { if (!(loansAccountData.isFloatingInterestRate === false)) { delete loansAccountData.isFloatingInterestRate; } + loansAccountData.principal = loansAccountData.principalAmount; + delete loansAccountData.principalAmount; this.loansService.updateLoansAccount(this.loanId, loansAccountData).subscribe((response: any) => { this.router.navigate(['../'], { relativeTo: this.route }); }); diff --git a/src/app/loans/loans-account-stepper/loans-account-charges-step/loans-account-charges-step.component.html b/src/app/loans/loans-account-stepper/loans-account-charges-step/loans-account-charges-step.component.html index 025b4dbeb..d662c9afe 100644 --- a/src/app/loans/loans-account-stepper/loans-account-charges-step/loans-account-charges-step.component.html +++ b/src/app/loans/loans-account-stepper/loans-account-charges-step/loans-account-charges-step.component.html @@ -55,10 +55,10 @@ - {{(charge.dueDate | dateFormat) || 'Unassigned'}} + {{(charge.dueDate | dateFormat) || 'Unassigned'}} - {{(charge.feeOnMonthDay | dateFormat) || 'Unassigned'}} + {{(charge.feeOnMonthDay | dateFormat) || 'Unassigned'}} + diff --git a/src/app/loans/loans-account-stepper/loans-account-charges-step/loans-account-charges-step.component.ts b/src/app/loans/loans-account-stepper/loans-account-charges-step/loans-account-charges-step.component.ts index 3e8524e8e..17ae4f33d 100644 --- a/src/app/loans/loans-account-stepper/loans-account-charges-step/loans-account-charges-step.component.ts +++ b/src/app/loans/loans-account-stepper/loans-account-charges-step/loans-account-charges-step.component.ts @@ -14,6 +14,7 @@ import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield- import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base'; import { SettingsService } from 'app/settings/settings.service'; import { Dates } from 'app/core/utils/dates'; +import { ActivatedRoute } from '@angular/router'; /** * Recurring Deposit Account Charges Step @@ -50,6 +51,7 @@ export class LoansAccountChargesStepComponent implements OnInit, OnChanges { isCollateralSufficient = false; /** Total value of all collateral added to a loan */ totalCollateralValue: any = 0; + loanId: any = null; /** * Loans Account Charges Form Step @@ -59,7 +61,9 @@ export class LoansAccountChargesStepComponent implements OnInit, OnChanges { */ constructor(public dialog: MatDialog, private dateUtils: Dates, + private route: ActivatedRoute, private settingsService: SettingsService) { + this.loanId = this.route.snapshot.params['loanId']; } ngOnInit() { diff --git a/src/app/loans/loans-account-stepper/loans-account-details-step/loans-account-details-step.component.html b/src/app/loans/loans-account-stepper/loans-account-details-step/loans-account-details-step.component.html index c6554d8b2..1cfa3a8b3 100644 --- a/src/app/loans/loans-account-stepper/loans-account-details-step/loans-account-details-step.component.html +++ b/src/app/loans/loans-account-stepper/loans-account-details-step/loans-account-details-step.component.html @@ -96,6 +96,9 @@ Next   + diff --git a/src/app/loans/loans-account-stepper/loans-account-details-step/loans-account-details-step.component.ts b/src/app/loans/loans-account-stepper/loans-account-details-step/loans-account-details-step.component.ts index 2577f94b3..d565dea27 100644 --- a/src/app/loans/loans-account-stepper/loans-account-details-step/loans-account-details-step.component.ts +++ b/src/app/loans/loans-account-stepper/loans-account-details-step/loans-account-details-step.component.ts @@ -1,6 +1,7 @@ /** Angular Imports */ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; import { FormGroup, FormBuilder, Validators } from '@angular/forms'; +import { ActivatedRoute } from '@angular/router'; import { SettingsService } from 'app/settings/settings.service'; /** Custom Services */ @@ -38,6 +39,8 @@ export class LoansAccountDetailsStepComponent implements OnInit { /** Loans Account Details Form */ loansAccountDetailsForm: FormGroup; + loanId: any = null; + /** Loans Account Template with product data */ @Output() loansAccountProductTemplate = new EventEmitter(); /** @@ -48,12 +51,14 @@ export class LoansAccountDetailsStepComponent implements OnInit { */ constructor(private formBuilder: FormBuilder, private loansService: LoansService, + private route: ActivatedRoute, private settingsService: SettingsService) { + this.loanId = this.route.snapshot.params['loanId']; this.createLoansAccountDetailsForm(); } ngOnInit() { - this.maxDate = this.settingsService.businessDate; + this.maxDate = this.settingsService.maxFutureDate; this.buildDependencies(); if (this.loansAccountTemplate) { this.productData = this.loansAccountTemplate.productOptions; diff --git a/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.html b/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.html index 2d201d198..3b929c7e1 100644 --- a/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.html +++ b/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.html @@ -3,9 +3,9 @@
- Principal {{loansAccountProductTemplate?.currency.displaySymbol}} - - + Principal {{currencyDisplaySymbol}} + + Principal is required @@ -52,8 +52,7 @@ Repaid every - + Repaid every is required @@ -61,8 +60,7 @@ Frequency - + {{ repaymentFrequencyType.value }} @@ -100,7 +98,7 @@ - + Nominal interest rate @@ -109,8 +107,7 @@ Interest method - + {{ interestType.value }} @@ -119,13 +116,13 @@ + [checked]="loansAccountTemplate?.isEqualAmortization">

Is Equal Amortization

- + - +

Calculate interest for exact days in partial period

- Arrears tolerance {{loansAccountProductTemplate?.currency.displaySymbol}} - + Arrears tolerance {{currencyDisplaySymbol}} + @@ -201,9 +191,7 @@ Repayment strategy - + @@ -217,27 +205,24 @@

Moratorium

- + On Principal Payment - + On Interest Payment - + On Arreas Aging - + Installment Amount - +

Is Topup Loan?

@@ -259,58 +244,58 @@
Recalculate Interest - {{ loansAccountProductTemplate?.isInterestRecalculationEnabled? 'Yes' : 'No' }} + {{ loansAccountTemplate?.isInterestRecalculationEnabled? 'Yes' : 'No' }}
-
+
Days in year - {{ loansAccountProductTemplate?.daysInYearType.value}} + {{ loansAccountTemplate?.daysInYearType.value}}
- + -
+
Advance payments adjustment type - {{ loansAccountProductTemplate?.interestRecalculationData.rescheduleStrategyType.value }} + {{ loansAccountTemplate?.interestRecalculationData.rescheduleStrategyType.value }}
-
+
Days in month - {{ loansAccountProductTemplate?.daysInMonthType.value }} + {{ loansAccountTemplate?.daysInMonthType.value }}
- +
Interest recalculation compounding on - {{ loansAccountProductTemplate?.interestRecalculationData.interestRecalculationCompoundingType.value }} + {{ loansAccountTemplate?.interestRecalculationData.interestRecalculationCompoundingType.value }}
Frequency Interval for recalculation - {{ loansAccountProductTemplate?.interestRecalculationData.recalculationRestFrequencyType.value}} - - on {{ loansAccountProductTemplate?.interestRecalculationData.recalculationRestFrequencyWeekday.value}} - on day - {{ loansAccountProductTemplate?.interestRecalculationData.recalculationRestFrequencyOnDay}} - on - {{ loansAccountProductTemplate?.interestRecalculationData.recalculationRestFrequencyNthDay.value}} - {{ loansAccountProductTemplate?.interestRecalculationData.recalculationRestFrequencyWeekday.value}} + {{ loansAccountTemplate?.interestRecalculationData.recalculationRestFrequencyType.value}} + + on {{ loansAccountTemplate?.interestRecalculationData.recalculationRestFrequencyWeekday.value}} + on day + {{ loansAccountTemplate?.interestRecalculationData.recalculationRestFrequencyOnDay}} + on + {{ loansAccountTemplate?.interestRecalculationData.recalculationRestFrequencyNthDay.value}} + {{ loansAccountTemplate?.interestRecalculationData.recalculationRestFrequencyWeekday.value}}
-
+
Frequency Interval for recalculation - {{ loansAccountProductTemplate?.interestRecalculationData.recalculationRestFrequencyInterval}} + {{ loansAccountTemplate?.interestRecalculationData.recalculationRestFrequencyInterval}}
@@ -320,86 +305,81 @@ Maximum allowed outstanding balance - - -
+ -
+ +
+ + - - Expected disbursement on - - - - - Expected disbursement on is required - - + + + + - - Principal - - - Principal is required - - - - - - - - - - + + + + + + +
Eexpected Disbursement Date + {{ row.expectedDisbursementDate | dateFormat }} Principal + {{ row.principal }} Actions + +
+ *ngIf="loansAccountTemplate?.isInterestRecalculationEnabled && loansAccountTemplate?.interestRecalculationData.interestRecalculationCompoundingType.id != 0">
Frequency for compounding - {{ loansAccountProductTemplate?.interestRecalculationData.recalculationCompoundingFrequencyType.value}} - - on {{ loansAccountProductTemplate?.interestRecalculationData.recalculationCompoundingFrequencyWeekday.value}} + {{ loansAccountTemplate?.interestRecalculationData.recalculationCompoundingFrequencyType.value}} + + on {{ loansAccountTemplate?.interestRecalculationData.recalculationCompoundingFrequencyWeekday.value}} - on day - {{ loansAccountProductTemplate?.interestRecalculationData.recalculationCompoundingFrequencyOnDay}} + on day + {{ loansAccountTemplate?.interestRecalculationData.recalculationCompoundingFrequencyOnDay}} - on - {{ loansAccountProductTemplate?.interestRecalculationData.recalculationCompoundingFrequencyNthDay.value}} - {{ loansAccountProductTemplate?.interestRecalculationData.recalculationCompoundingFrequencyWeekday.value}} + on + {{ loansAccountTemplate?.interestRecalculationData.recalculationCompoundingFrequencyNthDay.value}} + {{ loansAccountTemplate?.interestRecalculationData.recalculationCompoundingFrequencyWeekday.value}}
-
+
Frequency Interval for compounding - {{ loansAccountProductTemplate?.interestRecalculationData.recalculationCompoundingFrequencyInterval}} + {{ loansAccountTemplate?.interestRecalculationData.recalculationCompoundingFrequencyInterval}}
-
+

Collaterals Data

- +
- + @@ -453,6 +433,9 @@ Next   +
diff --git a/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.ts b/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.ts index 73eb85201..c7802ce21 100644 --- a/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.ts +++ b/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.ts @@ -2,9 +2,14 @@ import { Component, OnInit, Input, OnChanges } from '@angular/core'; import { FormGroup, FormBuilder, Validators, FormArray } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; +import { ActivatedRoute, Router } from '@angular/router'; import { LoansAccountAddCollateralDialogComponent } from 'app/loans/custom-dialog/loans-account-add-collateral-dialog/loans-account-add-collateral-dialog.component'; import { SettingsService } from 'app/settings/settings.service'; import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component'; +import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component'; +import { DatepickerBase } from 'app/shared/form-dialog/formfield/model/datepicker-base'; +import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-base'; +import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base'; /** * Create Loans Account Terms Step @@ -20,8 +25,10 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges { @Input() loansAccountProductTemplate: any; /** Loans Account Template */ @Input() loansAccountTemplate: any; + loansAccountTermsData: any; + /** Is Multi Disburse Loan */ - @Input() multiDisburseLoan: any; + multiDisburseLoan: any; // @Input() loansAccountFormValid: LoansAccountFormValid @Input() loansAccountFormValid: boolean; // @Input collateralOptions: Collateral Options @@ -51,6 +58,9 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges { transactionProcessingStrategyData: any; /** Client Active Loan Data */ clientActiveLoanData: any; + /** Multi Disbursement Data */ + disbursementDataSource: {}[] = []; + currencyDisplaySymbol = '$'; /** Check if value of collateral added is more than principal amount */ isCollateralSufficient = false; @@ -60,62 +70,148 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges { collateralDataSource: {}[] = []; /** Columns to be displayed in collateral table. */ loanCollateralDisplayedColumns: string[] = ['type', 'value', 'totalValue', 'totalCollateralValue', 'action']; + /** Disbursement Data Displayed Columns */ + disbursementDisplayedColumns: string[] = ['expectedDisbursementDate', 'principal', 'actions']; + /** Multi Disbursement Control */ + totalMultiDisbursed: any = 0; + isMultiDisbursedCompleted = false; + /** Component is pristine if there has been no changes by user interaction */ pristine = true; + loanId: any = null; + /** * Create Loans Account Terms Form * @param formBuilder FormBuilder * @param {SettingsService} settingsService SettingsService */ constructor(private formBuilder: FormBuilder, - private settingsService: SettingsService, - public dialog: MatDialog) { - this.createloansAccountTermsForm(); + private settingsService: SettingsService, + private route: ActivatedRoute, + public dialog: MatDialog) { + this.loanId = this.route.snapshot.params['loanId']; + this.createloansAccountTermsForm(); } /** * Executes on change of input values */ ngOnChanges() { if (this.loansAccountProductTemplate) { + this.loansAccountTermsData = this.loansAccountProductTemplate; + this.currencyDisplaySymbol = this.loansAccountTermsData.currency.displaySymbol; + if (this.loanId != null && this.loansAccountTemplate.accountNo) { + this.loansAccountTermsData = this.loansAccountTemplate; + } + this.loansAccountTermsForm.patchValue({ - 'principal': this.loansAccountProductTemplate.principal, - 'loanTermFrequency': this.loansAccountProductTemplate.termFrequency, - 'loanTermFrequencyType': this.loansAccountProductTemplate.termPeriodFrequencyType.id, - 'numberOfRepayments': this.loansAccountProductTemplate.numberOfRepayments, - 'repaymentEvery': this.loansAccountProductTemplate.repaymentEvery, - 'repaymentFrequencyType': this.loansAccountProductTemplate.repaymentFrequencyType.id, - 'interestRatePerPeriod': this.loansAccountProductTemplate.interestRatePerPeriod, - 'amortizationType': this.loansAccountProductTemplate.amortizationType.id, - 'isEqualAmortization': this.loansAccountProductTemplate.isEqualAmortization, - 'interestType': this.loansAccountProductTemplate.interestType.id, - 'isFloatingInterestRate': this.loansAccountProductTemplate.isLoanProductLinkedToFloatingRate ? false : '', - 'interestCalculationPeriodType': this.loansAccountProductTemplate.interestCalculationPeriodType.id, - 'allowPartialPeriodInterestCalcualtion': this.loansAccountProductTemplate.allowPartialPeriodInterestCalcualtion, - 'inArrearsTolerance': this.loansAccountProductTemplate.inArrearsTolerance, - 'graceOnPrincipalPayment': this.loansAccountProductTemplate.graceOnPrincipalPayment, - 'graceOnInterestPayment': this.loansAccountProductTemplate.graceOnInterestPayment, - 'graceOnArrearsAgeing': this.loansAccountProductTemplate.graceOnArrearsAgeing, - 'transactionProcessingStrategyId': this.loansAccountProductTemplate.transactionProcessingStrategyId, - 'graceOnInterestCharged': this.loansAccountProductTemplate.graceOnInterestCharged, - 'fixedEmiAmount': this.loansAccountProductTemplate.fixedEmiAmount, - 'maxOutstandingLoanBalance': this.loansAccountProductTemplate.maxOutstandingLoanBalance + 'principalAmount': this.loansAccountTermsData.principal, + 'loanTermFrequency': this.loansAccountTermsData.termFrequency, + 'loanTermFrequencyType': this.loansAccountTermsData.termPeriodFrequencyType.id, + 'numberOfRepayments': this.loansAccountTermsData.numberOfRepayments, + 'repaymentEvery': this.loansAccountTermsData.repaymentEvery, + 'repaymentFrequencyType': this.loansAccountTermsData.repaymentFrequencyType.id, + 'interestRatePerPeriod': this.loansAccountTermsData.interestRatePerPeriod, + 'amortizationType': this.loansAccountTermsData.amortizationType.id, + 'isEqualAmortization': this.loansAccountTermsData.isEqualAmortization, + 'interestType': this.loansAccountTermsData.interestType.id, + 'isFloatingInterestRate': this.loansAccountTermsData.isLoanProductLinkedToFloatingRate ? false : '', + 'interestCalculationPeriodType': this.loansAccountTermsData.interestCalculationPeriodType.id, + 'allowPartialPeriodInterestCalcualtion': this.loansAccountTermsData.allowPartialPeriodInterestCalcualtion, + 'inArrearsTolerance': this.loansAccountTermsData.inArrearsTolerance, + 'graceOnPrincipalPayment': this.loansAccountTermsData.graceOnPrincipalPayment, + 'graceOnInterestPayment': this.loansAccountTermsData.graceOnInterestPayment, + 'graceOnArrearsAgeing': this.loansAccountTermsData.graceOnArrearsAgeing, + 'transactionProcessingStrategyId': this.loansAccountTermsData.transactionProcessingStrategyId, + 'graceOnInterestCharged': this.loansAccountTermsData.graceOnInterestCharged, + 'fixedEmiAmount': this.loansAccountTermsData.fixedEmiAmount, + 'maxOutstandingLoanBalance': this.loansAccountTermsData.maxOutstandingLoanBalance }); + + this.multiDisburseLoan = this.loansAccountTermsData.multiDisburseLoan; + if (this.loansAccountTermsData.disbursementDetails) { + this.disbursementDataSource = this.loansAccountTermsData.disbursementDetails; + this.totalMultiDisbursed = 0; + this.disbursementDataSource.forEach((item: any) => { + this.totalMultiDisbursed += item.principal; + }); + } + + this.collateralDataSource = this.loansAccountTermsData.collateral || []; + + const allowAttributeOverrides = this.loansAccountTermsData.product.allowAttributeOverrides; + if (!allowAttributeOverrides.repaymentEvery) { + this.loansAccountTermsForm.controls.repaymentEvery.disable(); + this.loansAccountTermsForm.controls.repaymentFrequencyType.disable(); + } + if (!allowAttributeOverrides.interestType) { + this.loansAccountTermsForm.controls.interestType.disable(); + } + if (!allowAttributeOverrides.amortizationType) { + this.loansAccountTermsForm.controls.amortizationType.disable(); + } + if (!allowAttributeOverrides.interestCalculationPeriodType) { + this.loansAccountTermsForm.controls.interestCalculationPeriodType.disable(); + this.loansAccountTermsForm.controls.allowPartialPeriodInterestCalcualtion.disable(); + } + if (!allowAttributeOverrides.inArrearsTolerance) { + this.loansAccountTermsForm.controls.inArrearsTolerance.disable(); + } + if (!allowAttributeOverrides.transactionProcessingStrategyId) { + this.loansAccountTermsForm.controls.transactionProcessingStrategyId.disable(); + } + if (!allowAttributeOverrides.graceOnPrincipalAndInterestPayment) { + this.loansAccountTermsForm.controls.graceOnPrincipalPayment.disable(); + } + if (!allowAttributeOverrides.graceOnPrincipalAndInterestPayment) { + this.loansAccountTermsForm.controls.graceOnInterestPayment.disable(); + } + if (!allowAttributeOverrides.graceOnArrearsAgeing) { + this.loansAccountTermsForm.controls.graceOnArrearsAgeing.disable(); + } this.setOptions(); } } ngOnInit() { - this.maxDate = this.settingsService.businessDate; - if (this.loansAccountTemplate) { - if (this.loansAccountTemplate.loanProductId) { + this.maxDate = this.settingsService.maxFutureDate; + this.loansAccountTermsData = this.loansAccountProductTemplate; + if (this.loanId != null && this.loansAccountTemplate.accountNo) { + this.loansAccountTermsData = this.loansAccountTemplate; + } + + if (this.loansAccountTermsData) { + if (this.loansAccountTermsData.loanProductId) { this.loansAccountTermsForm.patchValue({ - 'repaymentsStartingFromDate': this.loansAccountTemplate.expectedFirstRepaymentOnDate && new Date(this.loansAccountTemplate.expectedFirstRepaymentOnDate) + 'repaymentsStartingFromDate': this.loansAccountTermsData.expectedFirstRepaymentOnDate && new Date(this.loansAccountTermsData.expectedFirstRepaymentOnDate) }); } + this.loansAccountTermsForm.patchValue({ + 'principalAmount': this.loansAccountTermsData.principal, + 'loanTermFrequency': this.loansAccountTermsData.termFrequency, + 'loanTermFrequencyType': this.loansAccountTermsData.termPeriodFrequencyType.id, + 'numberOfRepayments': this.loansAccountTermsData.numberOfRepayments, + 'repaymentEvery': this.loansAccountTermsData.repaymentEvery, + 'repaymentFrequencyType': this.loansAccountTermsData.repaymentFrequencyType.id, + 'interestRatePerPeriod': this.loansAccountTermsData.interestRatePerPeriod, + 'amortizationType': this.loansAccountTermsData.amortizationType.id, + 'isEqualAmortization': this.loansAccountTermsData.isEqualAmortization, + 'interestType': this.loansAccountTermsData.interestType.id, + 'isFloatingInterestRate': this.loansAccountTermsData.isLoanProductLinkedToFloatingRate ? false : '', + 'interestCalculationPeriodType': this.loansAccountTermsData.interestCalculationPeriodType.id, + 'allowPartialPeriodInterestCalcualtion': this.loansAccountTermsData.allowPartialPeriodInterestCalcualtion, + 'inArrearsTolerance': this.loansAccountTermsData.inArrearsTolerance, + 'graceOnPrincipalPayment': this.loansAccountTermsData.graceOnPrincipalPayment, + 'graceOnInterestPayment': this.loansAccountTermsData.graceOnInterestPayment, + 'graceOnArrearsAgeing': this.loansAccountTermsData.graceOnArrearsAgeing, + 'transactionProcessingStrategyId': this.loansAccountTermsData.transactionProcessingStrategyId, + 'graceOnInterestCharged': this.loansAccountTermsData.graceOnInterestCharged, + 'fixedEmiAmount': this.loansAccountTermsData.fixedEmiAmount, + 'maxOutstandingLoanBalance': this.loansAccountTermsData.maxOutstandingLoanBalance + }); } this.createloansAccountTermsForm(); - this.setCustomValidators(); + // this.setCustomValidators(); } /** Custom Validators for the form */ @@ -142,20 +238,18 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges { /** Create Loans Account Terms Form */ createloansAccountTermsForm() { this.loansAccountTermsForm = this.formBuilder.group({ - 'principal': ['', Validators.required], + 'principalAmount': ['', Validators.required], 'loanTermFrequency': ['', Validators.required], 'loanTermFrequencyType': ['', Validators.required], 'numberOfRepayments': ['', Validators.required], 'repaymentEvery': ['', Validators.required], 'repaymentFrequencyType': ['', Validators.required], - 'disbursementData': this.formBuilder.array([]), 'repaymentFrequencyNthDayType': [''], 'repaymentFrequencyDayOfWeekType': [''], 'repaymentsStartingFromDate': [''], 'interestChargedFromDate': [''], 'interestRatePerPeriod': [''], 'interestType': [''], - // 'interestRateDifferential': [''], 'isFloatingInterestRate': [''], 'isEqualAmortization': [''], 'amortizationType': ['', Validators.required], @@ -175,51 +269,87 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges { } /** - * Creates the Disbursement Data form. - * @returns {FormGroup} Disbursement Data form. + * Gets the Disbursement Data array. + * @returns {Array} Disbursement Data array. */ - createDisbursementDataForm(): FormGroup { - return this.formBuilder.group({ - 'expectedDisbursementDate': [new Date()], - 'principal': [''] + get disbursementData() { + return { + disbursementData: this.disbursementDataSource + }; + } + + /** + * Adds the Disbursement Data entry form to given Disbursement Data entry. + */ + addDisbursementDataEntry() { + const currentPrincipalAmount = this.loansAccountTermsForm.get('principalAmount').value; + const formfields: FormfieldBase[] = [ + new DatepickerBase({ + controlName: 'expectedDisbursementDate', + label: 'Expected Disbursement Date', + value: new Date() || '', + type: 'datetime-local', + minDate: this.minDate, + maxDate: this.maxDate, + required: true, + order: 1 + }), + new InputBase({ + controlName: 'principal', + label: 'Principal', + value: (currentPrincipalAmount - this.totalMultiDisbursed), + type: 'number', + required: true, + order: 2 + }) + ]; + const data = { + title: 'Add Disbursement Details', + layout: { addButtonText: 'Add' }, + formfields: formfields + }; + const disbursementDialogRef = this.dialog.open(FormDialogComponent, { data }); + disbursementDialogRef.afterClosed().subscribe((response: any) => { + if (response.data) { + const principal = response.data.value.principal * 1; + if ((this.totalMultiDisbursed + principal) <= currentPrincipalAmount) { + this.disbursementDataSource = this.disbursementDataSource.concat(response.data.value); + this.totalMultiDisbursed += principal; + this.isMultiDisbursedCompleted = (this.totalMultiDisbursed === currentPrincipalAmount); + this.pristine = false; + } + } }); } - /** - * Gets the Disbursement Data form array. - * @returns {FormArray} Disbursement Data form array. - */ - get disbursementData(): FormArray { - return this.loansAccountTermsForm.get('disbursementData') as FormArray; - } - - /** - * Adds the Disbursement Data entry form to given Disbursement Data entry form array. - * @param {FormArray} disbursementDataFormArray Given affected gl entry form array (debit/credit). - */ - addDisbursementDataEntry(disbursementDataFormArray: FormArray) { - disbursementDataFormArray.push(this.createDisbursementDataForm()); - } - /** * Removes the Disbursement Data entry form from given Disbursement Data entry form array at given index. - * @param {FormArray} disbursementDataFormArray Given Disbursement Data entry form array. * @param {number} index Array index from where Disbursement Data entry form needs to be removed. */ - removeDisbursementDataEntry(disbursementDataFormArray: FormArray, index: number) { - disbursementDataFormArray.removeAt(index); + removeDisbursementDataEntry(index: number) { + const currentPrincipalAmount = this.loansAccountTermsForm.get('principalAmount').value; + const dialogRef = this.dialog.open(DeleteDialogComponent, { + data: { deleteContext: `this` } + }); + dialogRef.afterClosed().subscribe((response: any) => { + if (response.delete) { + const principal = this.disbursementDataSource[index]['principal'] * 1; + this.disbursementDataSource.splice(index, 1); + this.disbursementDataSource = this.disbursementDataSource.concat([]); + this.totalMultiDisbursed -= principal; + this.isMultiDisbursedCompleted = (this.totalMultiDisbursed === currentPrincipalAmount); + } + }); } /** * Add a Collateral to the loan */ - addCollateral() { + addCollateral() { const addCollateralDialogRef = this.dialog.open(LoansAccountAddCollateralDialogComponent, { data: { collateralOptions: this.collateralOptions } }); - console.log(this.collateralOptions); addCollateralDialogRef.afterClosed().subscribe((response: any) => { - console.log(this.loanPrincipal); if (response.data) { const collateralData = { type: response.data.value.collateral, diff --git a/src/app/loans/loans-routing.module.ts b/src/app/loans/loans-routing.module.ts index 9836db919..d6fcde635 100644 --- a/src/app/loans/loans-routing.module.ts +++ b/src/app/loans/loans-routing.module.ts @@ -51,6 +51,8 @@ import { GLIMViewResolver } from './glim-account/glim-account-view.resolver'; import { GSIMAccountsResolver } from 'app/groups/common-resolvers/gsim-account-resolver'; import { GLIMLoanTemplateResolver } from './common-resolvers/glim-loan-template.resolver'; import { GroupViewResolver } from 'app/groups/common-resolvers/group-view.resolver'; +import { LoanDelinquencyTagsResolver } from './common-resolvers/loan-delinquency-tags.resolver'; +import { LoanDelinquencyTagsTabComponent } from './loans-view/loan-delinquency-tags-tab/loan-delinquency-tags-tab.component'; /** Loans Route. */ const routes: Routes = [ @@ -116,6 +118,19 @@ const routes: Routes = [ } ] }, + { + path: 'delinquencytags', + data: { title: extract('Loans Delinquency Tags'), breadcrumb: 'Delinquency Tags', routeParamBreadcrumb: false }, + resolve: { + loanDelinquencyTagsData: LoanDelinquencyTagsResolver + }, + children: [ + { + path: '', + component: LoanDelinquencyTagsTabComponent + }, + ] + }, { path: 'loan-collateral', component: LoanCollateralTabComponent, @@ -250,7 +265,7 @@ const routes: Routes = [ }, { path: 'edit-loans-account', - data: { title: extract('Edit Loans Account'), breadcrumb: 'Edit Loans Account', routeParamBreadcrumb: 'Edit' }, + data: { title: extract('Modify Loans Account'), breadcrumb: 'Modify Loans Account', routeParamBreadcrumb: 'Edit' }, component: EditLoansAccountComponent, resolve: { loansAccountAndTemplate: LoansAccountAndTemplateResolver @@ -293,6 +308,7 @@ const routes: Routes = [ LoanNotesResolver, LoanDatatablesResolver, LoanDatatableResolver, + LoanDelinquencyTagsResolver, LoanActionButtonResolver, LoansAccountTemplateResolver, LoanDocumentsResolver, diff --git a/src/app/loans/loans-view/loan-delinquency-tags-tab/loan-delinquency-tags-tab.component.html b/src/app/loans/loans-view/loan-delinquency-tags-tab/loan-delinquency-tags-tab.component.html new file mode 100644 index 000000000..3e22ceb9d --- /dev/null +++ b/src/app/loans/loans-view/loan-delinquency-tags-tab/loan-delinquency-tags-tab.component.html @@ -0,0 +1,36 @@ +
+ +

Loan Delinquency Tags

+ + + + + + + + + + + + + + + + + + + + +
Delinquency Classification {{ item.delinquencyRange.classification }} + ( {{ item.delinquencyRange.minimumAgeDays }} - {{ item.delinquencyRange.maximumAgeDays }} ) + ( {{ item.delinquencyRange.minimumAgeDays }} ) + Added On + + {{ item.addedOnDate | dateFormat }} + + Lifted On + + {{ item.liftedOnDate | dateFormat }} + +
+
diff --git a/src/app/loans/loans-view/loan-delinquency-tags-tab/loan-delinquency-tags-tab.component.scss b/src/app/loans/loans-view/loan-delinquency-tags-tab/loan-delinquency-tags-tab.component.scss new file mode 100644 index 000000000..5ffc94951 --- /dev/null +++ b/src/app/loans/loans-view/loan-delinquency-tags-tab/loan-delinquency-tags-tab.component.scss @@ -0,0 +1,11 @@ +table { + width: 100%; +} + +.container { + padding-top: 1%; + padding-bottom: 2%; + .delete-button { + margin-left: 1%; + } +} diff --git a/src/app/loans/loans-view/loan-delinquency-tags-tab/loan-delinquency-tags-tab.component.spec.ts b/src/app/loans/loans-view/loan-delinquency-tags-tab/loan-delinquency-tags-tab.component.spec.ts new file mode 100644 index 000000000..a396de2ca --- /dev/null +++ b/src/app/loans/loans-view/loan-delinquency-tags-tab/loan-delinquency-tags-tab.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { LoanDelinquencyTagsTabComponent } from './loan-delinquency-tags-tab.component'; + +describe('LoanDelinquencyTagsTabComponent', () => { + let component: LoanDelinquencyTagsTabComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ LoanDelinquencyTagsTabComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(LoanDelinquencyTagsTabComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/loans/loans-view/loan-delinquency-tags-tab/loan-delinquency-tags-tab.component.ts b/src/app/loans/loans-view/loan-delinquency-tags-tab/loan-delinquency-tags-tab.component.ts new file mode 100644 index 000000000..2d28f9f9e --- /dev/null +++ b/src/app/loans/loans-view/loan-delinquency-tags-tab/loan-delinquency-tags-tab.component.ts @@ -0,0 +1,23 @@ +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; + +@Component({ + selector: 'mifosx-loan-delinquency-tags-tab', + templateUrl: './loan-delinquency-tags-tab.component.html', + styleUrls: ['./loan-delinquency-tags-tab.component.scss'] +}) +export class LoanDelinquencyTagsTabComponent implements OnInit { + + loanDelinquencyTags: any; + loanDelinquencyTagsColumns: string[] = ['classification', 'addedOn', 'liftedOn']; + + constructor(private route: ActivatedRoute) { + this.route.parent.data.subscribe((data: { loanDelinquencyTagsData: any }) => { + this.loanDelinquencyTags = data.loanDelinquencyTagsData; + }); + } + + ngOnInit(): void { + } + +} diff --git a/src/app/loans/loans-view/loans-view.component.html b/src/app/loans/loans-view/loans-view.component.html index 96d567a74..f31733849 100644 --- a/src/app/loans/loans-view/loans-view.component.html +++ b/src/app/loans/loans-view/loans-view.component.html @@ -100,6 +100,12 @@ Transactions + + + Delinquency Tags + + diff --git a/src/app/loans/loans.module.ts b/src/app/loans/loans.module.ts index 7d51d1f31..ceb80a5a6 100644 --- a/src/app/loans/loans.module.ts +++ b/src/app/loans/loans.module.ts @@ -71,6 +71,7 @@ import { LoansAccountViewGuarantorDetailsDialogComponent } from './custom-dialog import { LoansAccountAddCollateralDialogComponent } from './custom-dialog/loans-account-add-collateral-dialog/loans-account-add-collateral-dialog.component'; import { LoanAccountLoadDocumentsDialogComponent } from './custom-dialog/loan-account-load-documents-dialog/loan-account-load-documents-dialog.component'; import { LoanCreditBalanceRefundComponent } from './loans-view/loan-account-actions/loan-credit-balance-refund/loan-credit-balance-refund.component'; +import { LoanDelinquencyTagsTabComponent } from './loans-view/loan-delinquency-tags-tab/loan-delinquency-tags-tab.component'; /** * Loans Module @@ -140,7 +141,8 @@ import { LoanCreditBalanceRefundComponent } from './loans-view/loan-account-acti GlimDetailsStepComponent, GlimChargesStepComponent, GlimTermsStepComponent, - GlimPreviewStepComponent + GlimPreviewStepComponent, + LoanDelinquencyTagsTabComponent ], providers: [ ], }) diff --git a/src/app/loans/loans.service.ts b/src/app/loans/loans.service.ts index ed81c3984..82f8cdf0f 100644 --- a/src/app/loans/loans.service.ts +++ b/src/app/loans/loans.service.ts @@ -47,15 +47,19 @@ export class LoansService { return this.http.delete(`/loans/${loanId}`); } + getDelinquencyTags(loanId: string): Observable { + return this.http.get(`/loans/${loanId}/delinquencytags`); + } + /** * Returns the loan template data with specific condition * @param loanId Loan Id */ getLoanTemplate(loanId: string): Observable { const httpParams = new HttpParams() - .set('fields', 'id,loanOfficerId,loanOfficerOptions') - .set('staffInSelectedOfficeOnly', 'true') - .set('template', 'true'); + .set('fields', 'id,loanOfficerId,loanOfficerOptions') + .set('staffInSelectedOfficeOnly', 'true') + .set('template', 'true'); return this.http.get(`/loans/${loanId}`, { params: httpParams }); } @@ -102,7 +106,7 @@ export class LoansService { const httpParams = new HttpParams() .set('associations', 'all') .set('exclude', 'guarantors,futureSchedule'); - return this.http.get(`/loans/${loanId}`, {params: httpParams}); + return this.http.get(`/loans/${loanId}`, { params: httpParams }); } getApproveAssociationsDetails(loanId: any) { @@ -156,13 +160,13 @@ export class LoansService { */ submitLoanActionButton(loanId: string, data: any, command: any) { const httpParams = new HttpParams().set('command', command); - return this.http.post(`/loans/${loanId}/transactions`, data, {params: httpParams}); + return this.http.post(`/loans/${loanId}/transactions`, data, { params: httpParams }); } getLoanScreenReportsData(): Observable { const httpParams = new HttpParams().set('entityId', '1') - .set('typeId', '0'); - return this.http.get(`/templates`, {params: httpParams}); + .set('typeId', '0'); + return this.http.get(`/templates`, { params: httpParams }); } /** @@ -222,19 +226,19 @@ export class LoansService { */ loanActionButtons(loanId: any, command: any, data?: any): Observable { const httpParams = new HttpParams().set('command', command); - return this.http.post(`/loans/${loanId}`, data, {params: httpParams}); + return this.http.post(`/loans/${loanId}`, data, { params: httpParams }); } /** * @param {string|number} loanId Loan Id. * @param {any} foreclosuredata ForeClosure Data */ - getForeclosureData(loanId: string|number, foreclosuredata: any) { + getForeclosureData(loanId: string | number, foreclosuredata: any) { const httpParams = new HttpParams().set('command', foreclosuredata.command) - .set('dateFormat', foreclosuredata.dateFormat) - .set('locale', foreclosuredata.locale) - .set('transactionDate', foreclosuredata.transactionDate); - return this.http.get(`/loans/${loanId}/transactions/template`, {params: httpParams}); + .set('dateFormat', foreclosuredata.dateFormat) + .set('locale', foreclosuredata.locale) + .set('transactionDate', foreclosuredata.transactionDate); + return this.http.get(`/loans/${loanId}/transactions/template`, { params: httpParams }); } @@ -244,7 +248,7 @@ export class LoansService { */ loanForclosureData(loanId: any, data: any) { const httpParams = new HttpParams().set('command', 'foreclosure'); - return this.http.post(`/loans/${loanId}/transactions`, data, {params: httpParams}); + return this.http.post(`/loans/${loanId}/transactions`, data, { params: httpParams }); } /** @@ -260,7 +264,7 @@ export class LoansService { */ submitRescheduleData(data: any) { const httpParams = new HttpParams().set('command', 'reschedule'); - return this.http.post('/rescheduleloans', data, {params: httpParams}); + return this.http.post('/rescheduleloans', data, { params: httpParams }); } /** @@ -270,19 +274,19 @@ export class LoansService { */ getLoansAccountTemplateResource(entityId: any, isGroup: boolean, productId?: any): Observable { let httpParams = new HttpParams().set('activeOnly', 'true') - .set('staffInSelectedOfficeOnly', 'true'); + .set('staffInSelectedOfficeOnly', 'true'); httpParams = productId ? httpParams.set('productId', productId) : httpParams; httpParams = isGroup ? httpParams.set('groupId', entityId) - .set('templateType', 'group') : - httpParams.set('clientId', entityId) - .set('templateType', 'individual'); + .set('templateType', 'group') : + httpParams.set('clientId', entityId) + .set('templateType', 'individual'); return this.http.get('/loans/template', { params: httpParams }); } getLoansAccountAndTemplateResource(loanId: any): Observable { const httpParams = new HttpParams().set('associations', 'charges,collateral,meeting,multiDisburseDetails') - .set('staffInSelectedOfficeOnly', 'true') - .set('template', 'true'); + .set('staffInSelectedOfficeOnly', 'true') + .set('template', 'true'); return this.http.get(`/loans/${loanId}`, { params: httpParams }); } @@ -292,8 +296,8 @@ export class LoansService { */ getLoansCollateralTemplateResource(productId: any): Observable { const httpParams = new HttpParams().set('fields', 'id, loanCollateralOptions') - .set('productId', productId) - .set('templateType', 'collateral'); + .set('productId', productId) + .set('templateType', 'collateral'); return this.http.get('/loans/template', { params: httpParams }); } @@ -346,7 +350,7 @@ export class LoansService { getTemplateData(templateId: any, loanId: any): Observable { const httpParams = new HttpParams().set('loanId', loanId); - return this.http.post(`/templates/${templateId}`, {}, { params: httpParams, responseType: 'text'}); + return this.http.post(`/templates/${templateId}`, {}, { params: httpParams, responseType: 'text' }); } /** @@ -444,16 +448,17 @@ export class LoansService { * @param glimId GLIM Id of account to get data for. * @returns {Observable} GLIM Account data. */ - getGLIMAccountData(glimId: string, groupId: string): Observable { + getGLIMAccountData(glimId: string, groupId: string): Observable { return this.http.get(`/loans/glimAccount/${glimId}`); } getGLIMLoanAccountTemplate(groupId: any): Observable { const httpParams = new HttpParams().set('groupId', groupId) - .set('lendingStrategy', '300') - .set('templateType', 'jlgbulk'); - return this.http.get('/loans/template', { params: httpParams }); + .set('lendingStrategy', '300') + .set('templateType', 'jlgbulk'); + return this.http.get('/loans/template', { params: httpParams }); } + createGlimAccount(glimAccount: any): Observable { return this.http.post('/batches?enclosingTransaction=true', glimAccount); }