feat: add view client charges component (#688)

Fixes: #688
This commit is contained in:
Benura Abeywardena
2020-07-15 15:45:00 +05:30
committed by GitHub
parent 90b6e3cc6d
commit bf98074b71
11 changed files with 327 additions and 3 deletions
+23
View File
@@ -90,6 +90,14 @@ export class ClientsService {
return this.http.get(`/clients/${clientId}/charges`, { params: httpParams });
}
getSelectedChargeData(clientId: string, chargeId: string) {
const httpParams = new HttpParams().set('associations', 'all');
return this.http.get(`/clients/${clientId}/charges/${chargeId}`, { params: httpParams });
}
/**
* @param chargeData Charge Data to be waived.
*/
waiveClientCharge(chargeData: any) {
const httpParams = new HttpParams().set('command', 'waive');
return this.http.post(`/clients/${chargeData.clientId}/charges/${chargeData.resourceType}`, chargeData, { params: httpParams });
@@ -99,6 +107,21 @@ export class ClientsService {
return this.http.get(`/clients/${clientId}/charges`);
}
/**
* @param transactionData Transaction Data to be undone.
*/
undoTransaction(transactionData: any) {
return this.http.post(`/clients/${transactionData.clientId}/transactions/${transactionData.transactionId}?command=undo`, transactionData);
}
/**
* @param clientId Client Id of the relevant charge.
* @param chargeId Charge Id to be deleted.
*/
deleteCharge(clientId: string, chargeId: string) {
return this.http.delete(`/clients/${clientId}/charges/${chargeId}?associations=all`);
}
getClientSummary(clientId: string) {
const httpParams = new HttpParams().set('R_clientId', clientId)
.set('genericResultSet', 'false');