feat: add savings charge form (#726)

Fixes: #250
This commit is contained in:
Abhijeet Singh
2020-06-07 22:57:18 +05:30
committed by GitHub
parent 5d77a9c676
commit 347e84f366
9 changed files with 362 additions and 28 deletions
+26 -2
View File
@@ -12,8 +12,7 @@ import { Observable } from 'rxjs';
providedIn: 'root'
})
export class SavingsService {
constructor(private http: HttpClient) { }
constructor(private http: HttpClient) {}
/**
* @param {string} savingAccountId is saving account's Id.
* @returns {Observable<any>}
@@ -31,4 +30,29 @@ export class SavingsService {
makeTransaction(action: string, savingAccountId: string, transactionData: any): Observable<any> {
return this.http.post(`/savingsaccounts/${savingAccountId}/transactions?command=${action}`, transactionData);
}
/**
* @param {string} savingAccountId saving account id.
* @returns {Observable<any>}
*/
getSavingsChargeTemplateResource(savingAccountId: string): Observable<any> {
return this.http.get(`/savingsaccounts/${savingAccountId}/charges/template`);
}
/**
* @param {any} savingsCharge to apply on a savings Account.
* @returns {Observable<any>}
*/
createSavingsCharge(savingAccountId: string, resourceType: string, savingsCharge: any): Observable<any> {
return this.http.post(`/savingsaccounts/${savingAccountId}/${resourceType}`, savingsCharge);
}
/**
* @param {string} chargeId Charge ID of charge.
* @returns {Observable<any>} Charge.
*/
getChargeTemplate(chargeId: string): Observable<any> {
const params = { template: 'true' };
return this.http.get(`/charges/${chargeId}`, { params: params });
}
}