feat: add make account transfer (transfer-funds) (#1151)

Fixes: #251 #1060
This commit is contained in:
Muskan Khedia
2020-07-23 12:12:45 +05:30
committed by GitHub
parent 55280eae2a
commit 63a9e46fc2
16 changed files with 497 additions and 49 deletions
+5 -1
View File
@@ -175,6 +175,10 @@ const routes: Routes = [
actionButtonData: LoanActionButtonResolver
}
},
{
path: 'transfer-funds',
loadChildren: '../account-transfers/account-transfers.module#AccountTransfersModule'
}
]
},
{
@@ -187,7 +191,7 @@ const routes: Routes = [
},
]
}]
}
},
];
@NgModule({
imports: [RouterModule.forChild(routes)],
@@ -129,12 +129,12 @@ export class CreateGuarantorComponent implements OnInit, AfterViewInit {
}
}
clientSelected(clientDetails: any){
clientSelected(clientDetails: any) {
console.log(clientDetails);
this.accountOptions = [];
this.loanService.guarantorAccountResource(this.loanId, clientDetails.id).subscribe((response: any) => {
this.accountOptions = response.accountLinkingOptions;
})
});
}
/**
@@ -153,17 +153,17 @@ export class CreateGuarantorComponent implements OnInit, AfterViewInit {
// TODO: Update once language and date settings are setup
const dateFormat = 'dd-MM-yyyy';
const locale = 'en';
let newGuarantorData = {
const newGuarantorData = {
... this.newGuarantorForm.value,
locale,
guarantorTypeId
};
if(this.newGuarantorForm.value.existingClient) {
if (this.newGuarantorForm.value.existingClient) {
newGuarantorData['entityId'] = this.newGuarantorForm.controls.name.value.id;
} else {
newGuarantorData['dob'] = this.datePipe.transform(prevdob, dateFormat),
newGuarantorData['dateFormat'] = dateFormat
newGuarantorData['dateFormat'] = dateFormat;
}
delete newGuarantorData.existingClient;
@@ -127,6 +127,10 @@ export class LoansViewComponent implements OnInit {
case 'Modify Application':
this.router.navigate(['edit-loans-account'], { relativeTo: this.route});
break;
case 'Transfer Funds':
const queryParams: any = { loanId: this.loanId, accountType: 'fromloans' };
this.router.navigate(['transfer-funds/make-account-transfer'], { relativeTo: this.route, queryParams: queryParams });
break;
default:
button = button.replace(/\s/g, '-').toLowerCase();
button = button.replace(/\(/g, '');