feat: add loan transactions tab actions (#1206)

- add export transaction
- add view transactions
- add edit transactions
- add undo transactions
- add view receipt

Fixes: #1205
This commit is contained in:
Muskan Khedia
2020-08-15 19:26:05 +05:30
committed by GitHub
parent c42e128b09
commit 537d8482c7
26 changed files with 985 additions and 54 deletions
+34
View File
@@ -404,4 +404,38 @@ export class LoansService {
return this.http.delete(`/loans/${accountId}/charges/${chargeId}`);
}
/**
* @param {string} accountId Loans Account Id
* @param {string} transactionId Transaction Id
* @returns {Observable<any>}
*/
getLoansAccountTransaction(accountId: string, transactionId: string): Observable<any> {
return this.http.get(`/loans/${accountId}/transactions/${transactionId}`);
}
/**
* @param {string} accountId Loans Account Id
* @param {string} transactionId Transaction Id
* @returns {Observable<any>}
*/
getLoansAccountTransactionTemplate(accountId: string, transactionId: string): Observable<any> {
const httpParams = new HttpParams().set('template', 'true');
return this.http.get(`/loans/${accountId}/transactions/${transactionId}`, { params: httpParams });
}
/**
* @param {string} accountId Loans Account Id
* @param {string} command Command
* @param {any} data Data
* @param {string} transactionId Transaction Id
* @returns {Observable<any>}
*/
executeLoansAccountTransactionsCommand(accountId: string, command: string, data: any, transactionId?: any): Observable<any> {
const httpParams = new HttpParams().set('command', command);
if (transactionId) {
return this.http.post(`/loans/${accountId}/transactions/${transactionId}`, data, { params: httpParams });
}
return this.http.post(`/loans/${accountId}/transactions`, data, { params: httpParams });
}
}