feat: add saving-deposit and withdrawal page (#389)

- Add Savings Module.
- Add saving-account-actions component.
- Add savings-account-transactions component.
- Add savings-routing.module.ts
- Add savings-transaction-template.resolver.ts

Fixes: #249
This commit is contained in:
Jivjyot Singh
2020-05-07 02:27:28 +05:30
committed by GitHub
parent 9ab6481406
commit f2a19708b7
14 changed files with 451 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
/** rxjs Imports */
import { Observable } from 'rxjs';
/**
* Savings Service.
*/
@Injectable({
providedIn: 'root'
})
export class SavingsService {
constructor(private http: HttpClient) { }
/**
* @param {string} savingAccountId is saving account's Id.
* @returns {Observable<any>}
*/
getSavingsTransactionTemplateResource(savingAccountId: string): Observable<any> {
return this.http.get(`/savingsaccounts/${savingAccountId}/transactions/template`);
}
/**
* @param {string} action transaction type.
* @param {string} savingAccountId saving account id.
* @param {any} transactionData transaction details for saving account.
* @returns {Observable<any>}
*/
makeTransaction(action: string, savingAccountId: string, transactionData: any): Observable<any> {
return this.http.post(`/savingsaccounts/${savingAccountId}/transactions?command=${action}`, transactionData);
}
}