feat: add loan charge to existing loan accounts (#370)
- Add Loans Module. - Add add-loan-charge component. - Add loans-routing.module.ts - Add loan-charge-template.resolver.ts Fixes: #247
This commit is contained in:
committed by
Abhay Chawla
parent
370fc9b481
commit
9944dcce93
@@ -0,0 +1,32 @@
|
||||
/** Angular Imports */
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
|
||||
/** rxjs Imports */
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
/**
|
||||
* Loans service.
|
||||
*/
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class LoansService {
|
||||
constructor(private http: HttpClient) {}
|
||||
/**
|
||||
* @param {string} loanId loanId of the loan.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
getLoanChargeTemplateResource(loanId: string): Observable<any> {
|
||||
return this.http.get(`/loans/${loanId}/charges/template`);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {any} loanCharge to apply on a Loan Account.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
createLoanCharge(loanId: string, resourceType: string, loanCharge: any): Observable<any> {
|
||||
return this.http.post(`/loans/${loanId}/${resourceType}`, loanCharge);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user