feat: add loan action button (#874)

- add prepay loan action
- add repayment loan action

Fixes: #243
Fixes: #242
This commit is contained in:
Muskan Khedia
2020-06-13 17:54:26 +05:30
committed by GitHub
parent da609f0de4
commit 06fd5e793c
17 changed files with 504 additions and 32 deletions
+11 -4
View File
@@ -21,7 +21,7 @@ export class LoansService {
return this.http.get(`/loans/${loanId}/charges/template`);
}
getLoanChargeTemplate(loanId: string, command: string): Observable<any> {
getLoanActionTemplate(loanId: string, command: string): Observable<any> {
const httpParams = new HttpParams().set('command', command);
return this.http.get(`/loans/${loanId}/transactions/template`, { params: httpParams });
}
@@ -102,9 +102,16 @@ export class LoansService {
return this.http.delete(`/loans/${loanId}/notes/${noteId}`);
}
closeAccount(loanId: string, closeData: any) {
const httpParams = new HttpParams().set('command', 'close');
return this.http.post(`/loans/${loanId}/transactions`, closeData, {params: httpParams});
/**
* Used For: Close Action, Prepay Loan Action
* Returns the response of the action
* @param loanId Loan Id
* @param data Data
* @param command Command
*/
submitLoanActionButton(loanId: string, data: any, command: any) {
const httpParams = new HttpParams().set('command', command);
return this.http.post(`/loans/${loanId}/transactions`, data, {params: httpParams});
}
/**