prospay-sdk 1.1.6 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/wallet/dto/get-customer-snapshots.dto.d.ts +4 -0
- package/dist/wallet/dto/get-customer-snapshots.dto.js +3 -0
- package/dist/wallet/dto/get-customer-snapshots.dto.js.map +1 -0
- package/dist/wallet/dto/get-customer-wallet.dto.d.ts +3 -0
- package/dist/wallet/dto/get-customer-wallet.dto.js +3 -0
- package/dist/wallet/dto/get-customer-wallet.dto.js.map +1 -0
- package/dist/wallet/dto/get-daily-snapshot.dto.d.ts +4 -0
- package/dist/wallet/dto/get-daily-snapshot.dto.js +3 -0
- package/dist/wallet/dto/get-daily-snapshot.dto.js.map +1 -0
- package/dist/wallet/dto/get-wallet-balance.dto.d.ts +3 -0
- package/dist/wallet/dto/get-wallet-balance.dto.js +3 -0
- package/dist/wallet/dto/get-wallet-balance.dto.js.map +1 -0
- package/dist/wallet/dto/get-wallet-history.dto.d.ts +6 -0
- package/dist/wallet/dto/get-wallet-history.dto.js +3 -0
- package/dist/wallet/dto/get-wallet-history.dto.js.map +1 -0
- package/dist/wallet/dto/index.d.ts +9 -0
- package/dist/wallet/dto/index.js +26 -0
- package/dist/wallet/dto/index.js.map +1 -0
- package/dist/wallet/dto/participant/add-participant.dto.d.ts +5 -0
- package/dist/wallet/dto/participant/add-participant.dto.js +3 -0
- package/dist/wallet/dto/participant/add-participant.dto.js.map +1 -0
- package/dist/wallet/dto/participant/get-participant.dto.d.ts +5 -0
- package/dist/wallet/dto/participant/get-participant.dto.js +3 -0
- package/dist/wallet/dto/participant/get-participant.dto.js.map +1 -0
- package/dist/wallet/dto/participant/index.d.ts +3 -0
- package/dist/wallet/dto/participant/index.js +20 -0
- package/dist/wallet/dto/participant/index.js.map +1 -0
- package/dist/wallet/dto/participant/remove-participant.dto.d.ts +4 -0
- package/dist/wallet/dto/participant/remove-participant.dto.js +3 -0
- package/dist/wallet/dto/participant/remove-participant.dto.js.map +1 -0
- package/dist/wallet/dto/search-wallets.dto.d.ts +43 -0
- package/dist/wallet/dto/search-wallets.dto.js +17 -0
- package/dist/wallet/dto/search-wallets.dto.js.map +1 -0
- package/dist/wallet/dto/update-credit-limit.dto.d.ts +5 -0
- package/dist/wallet/dto/update-credit-limit.dto.js +3 -0
- package/dist/wallet/dto/update-credit-limit.dto.js.map +1 -0
- package/dist/wallet/dto/update-wallet-status.dto.d.ts +6 -0
- package/dist/wallet/dto/update-wallet-status.dto.js +3 -0
- package/dist/wallet/dto/update-wallet-status.dto.js.map +1 -0
- package/dist/wallet/index.d.ts +3 -0
- package/dist/wallet/index.js +20 -0
- package/dist/wallet/index.js.map +1 -0
- package/dist/wallet/interfaces/index.d.ts +2 -0
- package/dist/wallet/interfaces/index.js +19 -0
- package/dist/wallet/interfaces/index.js.map +1 -0
- package/dist/wallet/interfaces/wallet-common.interface.d.ts +50 -0
- package/dist/wallet/interfaces/wallet-common.interface.js +9 -0
- package/dist/wallet/interfaces/wallet-common.interface.js.map +1 -0
- package/dist/wallet/interfaces/wallet-response.interface.d.ts +74 -0
- package/dist/wallet/interfaces/wallet-response.interface.js +3 -0
- package/dist/wallet/interfaces/wallet-response.interface.js.map +1 -0
- package/dist/wallet/wallet.service.d.ts +18 -0
- package/dist/wallet/wallet.service.js +135 -0
- package/dist/wallet/wallet.service.js.map +1 -0
- package/package.json +1 -1
- package/src/index.ts +12 -1
- package/src/wallet/dto/get-customer-snapshots.dto.ts +4 -0
- package/src/wallet/dto/get-customer-wallet.dto.ts +4 -0
- package/src/wallet/dto/get-daily-snapshot.dto.ts +4 -0
- package/src/wallet/dto/get-wallet-balance.dto.ts +4 -0
- package/src/wallet/dto/get-wallet-history.dto.ts +6 -0
- package/src/wallet/dto/index.ts +9 -0
- package/src/wallet/dto/participant/add-participant.dto.ts +5 -0
- package/src/wallet/dto/participant/get-participant.dto.ts +5 -0
- package/src/wallet/dto/participant/index.ts +3 -0
- package/src/wallet/dto/participant/remove-participant.dto.ts +4 -0
- package/src/wallet/dto/search-wallets.dto.ts +51 -0
- package/src/wallet/dto/update-credit-limit.dto.ts +5 -0
- package/src/wallet/dto/update-wallet-status.dto.ts +7 -0
- package/src/wallet/index.ts +3 -0
- package/src/wallet/interfaces/index.ts +2 -0
- package/src/wallet/interfaces/wallet-common.interface.ts +54 -0
- package/src/wallet/interfaces/wallet-response.interface.ts +87 -0
- package/src/wallet/wallet.service.ts +248 -0
package/README.md
CHANGED
|
@@ -77,6 +77,33 @@ Below is a concise map of each service, its methods, and the underlying Prospay
|
|
|
77
77
|
- Multi-invoice payload: pass a `data` array (same endpoint).
|
|
78
78
|
- `getInvoiceStatus(authToken, refId)` → `GET /invoices/api/v2.0/invoice-status/{refId}`
|
|
79
79
|
|
|
80
|
+
### Ledger (`ProspayLedgerService`)
|
|
81
|
+
- `getCustomerSummary(authToken, params)` → `GET /uts/api/ledgers/customers/{customerId}/summary`
|
|
82
|
+
- `getCustomerLedger(authToken, params)` → `GET /uts/api/ledgers/customers/{customerId}/ledger`
|
|
83
|
+
- `getHeadSummary(authToken, query)` → `GET /uts/api/ledgers/reports/heads`
|
|
84
|
+
- `getDateRangeSummary(authToken, params)` → `GET /uts/api/ledgers/customers/{customerId}/reports/date-range`
|
|
85
|
+
- `getTaxSummary(authToken, query)` → `GET /uts/api/ledgers/reports/tax`
|
|
86
|
+
- `getProfitLossSummary(authToken, query)` → `GET /uts/api/ledgers/reports/profit-loss`
|
|
87
|
+
|
|
88
|
+
### Wallet (`ProspayWalletService`)
|
|
89
|
+
- `updateCreditLimit(authToken, walletId, payload)` → `PUT /uts/api/wallets/{walletId}/credit-limit`
|
|
90
|
+
- `changeWalletStatus(authToken, walletId, payload)` → `PUT /uts/api/wallets/{walletId}/status`
|
|
91
|
+
- `getWalletBalance(authToken, walletId)` → `GET /uts/api/wallets/{walletId}/balance`
|
|
92
|
+
- `getCustomerWallets(authToken, customerId)` → `GET /uts/api/wallets/customer/{customerId}`
|
|
93
|
+
- `searchWallets(authToken, payload)` → `POST /uts/api/wallets/search`
|
|
94
|
+
- `getWalletHistory(authToken, walletId, params)` → `GET /uts/api/wallets/{walletId}/history`
|
|
95
|
+
- `getDailySnapshot(authToken, walletId, snapshotDate)` → `GET /uts/api/wallets/{walletId}/snapshots`
|
|
96
|
+
- `getCustomerSnapshots(authToken, customerId, snapshotDate)` → `GET /uts/api/wallets/customer/{customerId}/snapshots`
|
|
97
|
+
- `addParticipant(authToken, walletId, payload)` → `POST /uts/api/wallets/{walletId}/participants`
|
|
98
|
+
- `removeParticipant(authToken, walletId, customerId, payload)` → `DELETE /uts/api/wallets/{walletId}/participants/{customerId}`
|
|
99
|
+
- `getParticipants(authToken, walletId, params)` → `GET /uts/api/wallets/{walletId}/participants`
|
|
100
|
+
|
|
101
|
+
### Payment (`ProspayPaymentService`)
|
|
102
|
+
- `generateQr(authToken, payload)` → `POST /payments/api/v2.0/QR`
|
|
103
|
+
- `generatePaymentLink(authToken, payload)` → `POST /payments/api/v2.0/paymentLink`
|
|
104
|
+
- `refundPayment(authToken, productOrderId, payload)` → `POST /payments/api/v2.0/payment/{productOrderId}/refund`
|
|
105
|
+
- `getPaymentStatus(authToken, productOrderId)` → `GET /payments/api/v2.0/payment/{productOrderId}/status`
|
|
106
|
+
|
|
80
107
|
### Example snippets
|
|
81
108
|
|
|
82
109
|
Authenticate and create a customer:
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from './auth/auth.service';
|
|
|
9
9
|
export * from './customer/customer.service';
|
|
10
10
|
export * from './transaction';
|
|
11
11
|
export * from './ledger';
|
|
12
|
+
export * from './wallet';
|
|
12
13
|
export * from './invoice/invoice.service';
|
|
13
14
|
export * from './payment/payment.service';
|
|
14
15
|
export * from './sdk.config';
|
package/dist/index.js
CHANGED
|
@@ -31,6 +31,7 @@ const transaction_service_1 = require("./transaction/transaction.service");
|
|
|
31
31
|
const invoice_service_1 = require("./invoice/invoice.service");
|
|
32
32
|
const payment_service_1 = require("./payment/payment.service");
|
|
33
33
|
const ledger_service_1 = require("./ledger/ledger.service");
|
|
34
|
+
const wallet_service_1 = require("./wallet/wallet.service");
|
|
34
35
|
const sdk_config_1 = require("./sdk.config");
|
|
35
36
|
let ProspaySdkModule = ProspaySdkModule_1 = class ProspaySdkModule {
|
|
36
37
|
static register(options) {
|
|
@@ -55,8 +56,17 @@ let ProspaySdkModule = ProspaySdkModule_1 = class ProspaySdkModule {
|
|
|
55
56
|
invoice_service_1.ProspayInvoiceService,
|
|
56
57
|
payment_service_1.ProspayPaymentService,
|
|
57
58
|
ledger_service_1.ProspayLedgerService,
|
|
59
|
+
wallet_service_1.ProspayWalletService,
|
|
60
|
+
],
|
|
61
|
+
exports: [
|
|
62
|
+
auth_service_1.ProspayAuthService,
|
|
63
|
+
customer_service_1.ProspayCustomerService,
|
|
64
|
+
transaction_service_1.ProspayTransactionService,
|
|
65
|
+
invoice_service_1.ProspayInvoiceService,
|
|
66
|
+
payment_service_1.ProspayPaymentService,
|
|
67
|
+
ledger_service_1.ProspayLedgerService,
|
|
68
|
+
wallet_service_1.ProspayWalletService,
|
|
58
69
|
],
|
|
59
|
-
exports: [auth_service_1.ProspayAuthService, customer_service_1.ProspayCustomerService, transaction_service_1.ProspayTransactionService, invoice_service_1.ProspayInvoiceService, payment_service_1.ProspayPaymentService, ledger_service_1.ProspayLedgerService],
|
|
60
70
|
};
|
|
61
71
|
}
|
|
62
72
|
};
|
|
@@ -69,6 +79,7 @@ __exportStar(require("./auth/auth.service"), exports);
|
|
|
69
79
|
__exportStar(require("./customer/customer.service"), exports);
|
|
70
80
|
__exportStar(require("./transaction"), exports);
|
|
71
81
|
__exportStar(require("./ledger"), exports);
|
|
82
|
+
__exportStar(require("./wallet"), exports);
|
|
72
83
|
__exportStar(require("./invoice/invoice.service"), exports);
|
|
73
84
|
__exportStar(require("./payment/payment.service"), exports);
|
|
74
85
|
__exportStar(require("./sdk.config"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,4BAA0B;AAC1B,2CAAuD;AACvD,yCAA2C;AAC3C,sDAAyD;AACzD,kEAAqE;AACrE,2EAA8E;AAC9E,+DAAkE;AAClE,+DAAkE;AAClE,4DAA+D;AAC/D,6CAAsE;AAG/D,IAAM,gBAAgB,wBAAtB,MAAM,gBAAgB;IAC3B,MAAM,CAAC,QAAQ,CAAC,OAA0B;;QACxC,MAAM,OAAO,GAAG,MAAA,OAAO,CAAC,OAAO,mCAAI,8BAA8B,CAAC;QAElE,OAAO;YACL,MAAM,EAAE,kBAAgB;YACxB,OAAO,EAAE;gBACP,kBAAU,CAAC,QAAQ,CAAC;oBAClB,OAAO,EAAE,OAAO;oBAChB,OAAO,EAAE,IAAI;iBACd,CAAC;aACH;YACD,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,gCAAmB;oBAC5B,QAAQ,EAAE,OAAO;iBAClB;gBACD,iCAAkB;gBAClB,yCAAsB;gBACtB,+CAAyB;gBACzB,uCAAqB;gBACrB,uCAAqB;gBACrB,qCAAoB;aACrB;YACD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,4BAA0B;AAC1B,2CAAuD;AACvD,yCAA2C;AAC3C,sDAAyD;AACzD,kEAAqE;AACrE,2EAA8E;AAC9E,+DAAkE;AAClE,+DAAkE;AAClE,4DAA+D;AAC/D,4DAA+D;AAC/D,6CAAsE;AAG/D,IAAM,gBAAgB,wBAAtB,MAAM,gBAAgB;IAC3B,MAAM,CAAC,QAAQ,CAAC,OAA0B;;QACxC,MAAM,OAAO,GAAG,MAAA,OAAO,CAAC,OAAO,mCAAI,8BAA8B,CAAC;QAElE,OAAO;YACL,MAAM,EAAE,kBAAgB;YACxB,OAAO,EAAE;gBACP,kBAAU,CAAC,QAAQ,CAAC;oBAClB,OAAO,EAAE,OAAO;oBAChB,OAAO,EAAE,IAAI;iBACd,CAAC;aACH;YACD,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,gCAAmB;oBAC5B,QAAQ,EAAE,OAAO;iBAClB;gBACD,iCAAkB;gBAClB,yCAAsB;gBACtB,+CAAyB;gBACzB,uCAAqB;gBACrB,uCAAqB;gBACrB,qCAAoB;gBACpB,qCAAoB;aACrB;YACD,OAAO,EAAE;gBACP,iCAAkB;gBAClB,yCAAsB;gBACtB,+CAAyB;gBACzB,uCAAqB;gBACrB,uCAAqB;gBACrB,qCAAoB;gBACpB,qCAAoB;aACrB;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AApCY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,gBAAgB,CAoC5B;AAED,iDAA+B;AAC/B,sDAAoC;AACpC,8DAA4C;AAC5C,gDAA8B;AAC9B,2CAAyB;AACzB,2CAAyB;AACzB,4DAA0C;AAC1C,4DAA0C;AAC1C,+CAA6B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-customer-snapshots.dto.js","sourceRoot":"","sources":["../../../src/wallet/dto/get-customer-snapshots.dto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-customer-wallet.dto.js","sourceRoot":"","sources":["../../../src/wallet/dto/get-customer-wallet.dto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-daily-snapshot.dto.js","sourceRoot":"","sources":["../../../src/wallet/dto/get-daily-snapshot.dto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-wallet-balance.dto.js","sourceRoot":"","sources":["../../../src/wallet/dto/get-wallet-balance.dto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-wallet-history.dto.js","sourceRoot":"","sources":["../../../src/wallet/dto/get-wallet-history.dto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './update-credit-limit.dto';
|
|
2
|
+
export * from './update-wallet-status.dto';
|
|
3
|
+
export * from './get-wallet-history.dto';
|
|
4
|
+
export * from './search-wallets.dto';
|
|
5
|
+
export * from './get-wallet-balance.dto';
|
|
6
|
+
export * from './get-customer-wallet.dto';
|
|
7
|
+
export * from './get-daily-snapshot.dto';
|
|
8
|
+
export * from './get-customer-snapshots.dto';
|
|
9
|
+
export * from './participant';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./update-credit-limit.dto"), exports);
|
|
18
|
+
__exportStar(require("./update-wallet-status.dto"), exports);
|
|
19
|
+
__exportStar(require("./get-wallet-history.dto"), exports);
|
|
20
|
+
__exportStar(require("./search-wallets.dto"), exports);
|
|
21
|
+
__exportStar(require("./get-wallet-balance.dto"), exports);
|
|
22
|
+
__exportStar(require("./get-customer-wallet.dto"), exports);
|
|
23
|
+
__exportStar(require("./get-daily-snapshot.dto"), exports);
|
|
24
|
+
__exportStar(require("./get-customer-snapshots.dto"), exports);
|
|
25
|
+
__exportStar(require("./participant"), exports);
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/wallet/dto/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAC1C,6DAA2C;AAC3C,2DAAyC;AACzC,uDAAqC;AACrC,2DAAyC;AACzC,4DAA0C;AAC1C,2DAAyC;AACzC,+DAA6C;AAC7C,gDAA8B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-participant.dto.js","sourceRoot":"","sources":["../../../../src/wallet/dto/participant/add-participant.dto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-participant.dto.js","sourceRoot":"","sources":["../../../../src/wallet/dto/participant/get-participant.dto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./add-participant.dto"), exports);
|
|
18
|
+
__exportStar(require("./remove-participant.dto"), exports);
|
|
19
|
+
__exportStar(require("./get-participant.dto"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/wallet/dto/participant/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,2DAAyC;AACzC,wDAAsC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove-participant.dto.js","sourceRoot":"","sources":["../../../../src/wallet/dto/participant/remove-participant.dto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { WalletStatusType } from '../interfaces/wallet-common.interface';
|
|
2
|
+
export interface RangeFilter {
|
|
3
|
+
min?: number;
|
|
4
|
+
max?: number;
|
|
5
|
+
}
|
|
6
|
+
export interface DateRangeFilter {
|
|
7
|
+
createdAfter?: string | Date;
|
|
8
|
+
createdBefore?: string | Date;
|
|
9
|
+
}
|
|
10
|
+
export interface WalletFilters {
|
|
11
|
+
ownerIds?: string[];
|
|
12
|
+
participantIds?: string[];
|
|
13
|
+
statuses?: WalletStatusType[];
|
|
14
|
+
balanceRange?: RangeFilter;
|
|
15
|
+
creditLimitRange?: RangeFilter;
|
|
16
|
+
dateRange?: DateRangeFilter;
|
|
17
|
+
}
|
|
18
|
+
export interface WalletIncludeOptions {
|
|
19
|
+
includeParticipants?: boolean;
|
|
20
|
+
includeLogs?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare enum WalletSortField {
|
|
23
|
+
createdAt = "createdAt",
|
|
24
|
+
updatedAt = "updatedAt",
|
|
25
|
+
balance = "balance",
|
|
26
|
+
creditLimit = "creditLimit",
|
|
27
|
+
ownerId = "ownerId"
|
|
28
|
+
}
|
|
29
|
+
export declare enum SortOrder {
|
|
30
|
+
ASC = "ASC",
|
|
31
|
+
DESC = "DESC"
|
|
32
|
+
}
|
|
33
|
+
export interface WalletSorting {
|
|
34
|
+
sortBy?: WalletSortField;
|
|
35
|
+
sortOrder?: SortOrder;
|
|
36
|
+
}
|
|
37
|
+
export interface SearchWalletsDto {
|
|
38
|
+
page?: number;
|
|
39
|
+
limit?: number;
|
|
40
|
+
filters?: WalletFilters;
|
|
41
|
+
sorting?: WalletSorting;
|
|
42
|
+
includeOptions?: WalletIncludeOptions;
|
|
43
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SortOrder = exports.WalletSortField = void 0;
|
|
4
|
+
var WalletSortField;
|
|
5
|
+
(function (WalletSortField) {
|
|
6
|
+
WalletSortField["createdAt"] = "createdAt";
|
|
7
|
+
WalletSortField["updatedAt"] = "updatedAt";
|
|
8
|
+
WalletSortField["balance"] = "balance";
|
|
9
|
+
WalletSortField["creditLimit"] = "creditLimit";
|
|
10
|
+
WalletSortField["ownerId"] = "ownerId";
|
|
11
|
+
})(WalletSortField || (exports.WalletSortField = WalletSortField = {}));
|
|
12
|
+
var SortOrder;
|
|
13
|
+
(function (SortOrder) {
|
|
14
|
+
SortOrder["ASC"] = "ASC";
|
|
15
|
+
SortOrder["DESC"] = "DESC";
|
|
16
|
+
})(SortOrder || (exports.SortOrder = SortOrder = {}));
|
|
17
|
+
//# sourceMappingURL=search-wallets.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-wallets.dto.js","sourceRoot":"","sources":["../../../src/wallet/dto/search-wallets.dto.ts"],"names":[],"mappings":";;;AA0BA,IAAY,eAMX;AAND,WAAY,eAAe;IACvB,0CAAuB,CAAA;IACvB,0CAAuB,CAAA;IACvB,sCAAmB,CAAA;IACnB,8CAA2B,CAAA;IAC3B,sCAAmB,CAAA;AACvB,CAAC,EANW,eAAe,+BAAf,eAAe,QAM1B;AAED,IAAY,SAGX;AAHD,WAAY,SAAS;IACjB,wBAAW,CAAA;IACX,0BAAa,CAAA;AACjB,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-credit-limit.dto.js","sourceRoot":"","sources":["../../../src/wallet/dto/update-credit-limit.dto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-wallet-status.dto.js","sourceRoot":"","sources":["../../../src/wallet/dto/update-wallet-status.dto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./wallet.service"), exports);
|
|
18
|
+
__exportStar(require("./dto"), exports);
|
|
19
|
+
__exportStar(require("./interfaces"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/wallet/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,wCAAsB;AACtB,+CAA6B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./wallet-common.interface"), exports);
|
|
18
|
+
__exportStar(require("./wallet-response.interface"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/wallet/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAC1C,8DAA4C"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export declare enum WalletStatusType {
|
|
2
|
+
ACTIVE = "ACTIVE",
|
|
3
|
+
INACTIVE = "INACTIVE"
|
|
4
|
+
}
|
|
5
|
+
export interface WalletParticipant {
|
|
6
|
+
participantId: string;
|
|
7
|
+
addedBy: string;
|
|
8
|
+
addedAt: Date | string;
|
|
9
|
+
removedBy?: string;
|
|
10
|
+
removedAt?: Date | string;
|
|
11
|
+
reason: string;
|
|
12
|
+
}
|
|
13
|
+
export interface WalletLog {
|
|
14
|
+
performedBy: string;
|
|
15
|
+
transactionId: string;
|
|
16
|
+
chargeId: string;
|
|
17
|
+
transactionType: string;
|
|
18
|
+
transactionAmount?: number;
|
|
19
|
+
oldBalance?: number;
|
|
20
|
+
newBalance?: number;
|
|
21
|
+
oldCreditLimit?: number;
|
|
22
|
+
newCreditLimit?: number;
|
|
23
|
+
reason: string;
|
|
24
|
+
additionalData: Record<string, any>;
|
|
25
|
+
createdAt: Date | string;
|
|
26
|
+
}
|
|
27
|
+
export interface WalletDetails {
|
|
28
|
+
walletId: string;
|
|
29
|
+
ownerId: string;
|
|
30
|
+
balance: number;
|
|
31
|
+
availableBalance: number;
|
|
32
|
+
creditLimit: number;
|
|
33
|
+
availableCreditLimit: number;
|
|
34
|
+
currency: string;
|
|
35
|
+
status: string;
|
|
36
|
+
allowsTransactions: boolean;
|
|
37
|
+
participantCount: number;
|
|
38
|
+
createdAt: Date | string;
|
|
39
|
+
lastUpdatedAt: Date | string;
|
|
40
|
+
participants?: WalletParticipant[];
|
|
41
|
+
logs?: WalletLog[];
|
|
42
|
+
}
|
|
43
|
+
export interface WalletSnapshot {
|
|
44
|
+
id: string;
|
|
45
|
+
walletId: string;
|
|
46
|
+
snapshotDate: Date | string;
|
|
47
|
+
openingBalance: number;
|
|
48
|
+
closingBalance: number;
|
|
49
|
+
currency: string;
|
|
50
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WalletStatusType = void 0;
|
|
4
|
+
var WalletStatusType;
|
|
5
|
+
(function (WalletStatusType) {
|
|
6
|
+
WalletStatusType["ACTIVE"] = "ACTIVE";
|
|
7
|
+
WalletStatusType["INACTIVE"] = "INACTIVE";
|
|
8
|
+
})(WalletStatusType || (exports.WalletStatusType = WalletStatusType = {}));
|
|
9
|
+
//# sourceMappingURL=wallet-common.interface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallet-common.interface.js","sourceRoot":"","sources":["../../../src/wallet/interfaces/wallet-common.interface.ts"],"names":[],"mappings":";;;AAAA,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IACxB,qCAAiB,CAAA;IACjB,yCAAqB,CAAA;AACzB,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { WalletDetails, WalletSnapshot, WalletParticipant } from './wallet-common.interface';
|
|
2
|
+
export interface ProspayBaseResponse {
|
|
3
|
+
success: true;
|
|
4
|
+
requestId: string;
|
|
5
|
+
path: string;
|
|
6
|
+
timestamp: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ProspayWalletBalanceResponse extends ProspayBaseResponse {
|
|
9
|
+
data: WalletDetails;
|
|
10
|
+
}
|
|
11
|
+
export interface ProspayCustomerWalletsResponse extends ProspayBaseResponse {
|
|
12
|
+
data: {
|
|
13
|
+
wallets: WalletDetails[];
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface ProspaySearchWalletsResponse extends ProspayBaseResponse {
|
|
17
|
+
data: {
|
|
18
|
+
items: WalletDetails[];
|
|
19
|
+
pagination: {
|
|
20
|
+
total: number;
|
|
21
|
+
page: number;
|
|
22
|
+
limit: number;
|
|
23
|
+
totalPages: number;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export interface ProspayWalletSnapshotResponse extends ProspayBaseResponse {
|
|
28
|
+
data: WalletSnapshot;
|
|
29
|
+
}
|
|
30
|
+
export interface ProspayCustomerSnapshotsResponse extends ProspayBaseResponse {
|
|
31
|
+
data: {
|
|
32
|
+
snapshots: WalletSnapshot[];
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export interface ProspayWalletParticipantsResponse extends ProspayBaseResponse {
|
|
36
|
+
data: {
|
|
37
|
+
total: number;
|
|
38
|
+
page: number;
|
|
39
|
+
limit: number;
|
|
40
|
+
participants: WalletParticipant[];
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export interface ProspayWalletUpdateCreditLimitResponse extends ProspayBaseResponse {
|
|
44
|
+
data: {
|
|
45
|
+
walletId: string;
|
|
46
|
+
oldCreditLimit: number;
|
|
47
|
+
newCreditLimit: number;
|
|
48
|
+
newAvailableBalance: number;
|
|
49
|
+
currency: string;
|
|
50
|
+
updatedAt: string;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export interface ProspayWalletChangeStatusResponse extends ProspayBaseResponse {
|
|
54
|
+
data: {
|
|
55
|
+
walletId: string;
|
|
56
|
+
status: string;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export interface ProspayWalletAddParticipantResponse extends ProspayBaseResponse {
|
|
60
|
+
data: {
|
|
61
|
+
walletId: string;
|
|
62
|
+
addedBy: string;
|
|
63
|
+
addedAt: string;
|
|
64
|
+
reason: string;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export interface ProspayWalletRemoveParticipantResponse extends ProspayBaseResponse {
|
|
68
|
+
data: {
|
|
69
|
+
walletId: string;
|
|
70
|
+
removedBy: string;
|
|
71
|
+
removedAt: string;
|
|
72
|
+
reason: string;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallet-response.interface.js","sourceRoot":"","sources":["../../../src/wallet/interfaces/wallet-response.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HttpService } from '@nestjs/axios';
|
|
2
|
+
import { UpdateCreditLimitDto, UpdateWalletStatusDto, SearchWalletsDto, GetWalletHistoryDto, AddParticipantDto, RemoveParticipantDto, GetParticipantDto } from './dto';
|
|
3
|
+
import { ProspayWalletBalanceResponse, ProspayCustomerWalletsResponse, ProspaySearchWalletsResponse, ProspayWalletSnapshotResponse, ProspayCustomerSnapshotsResponse, ProspayWalletParticipantsResponse, ProspayWalletUpdateCreditLimitResponse, ProspayWalletChangeStatusResponse, ProspayWalletAddParticipantResponse, ProspayWalletRemoveParticipantResponse } from './interfaces';
|
|
4
|
+
export declare class ProspayWalletService {
|
|
5
|
+
private readonly http;
|
|
6
|
+
constructor(http: HttpService);
|
|
7
|
+
updateCreditLimit(authToken: string, walletId: string, payload: UpdateCreditLimitDto): Promise<ProspayWalletUpdateCreditLimitResponse>;
|
|
8
|
+
changeWalletStatus(authToken: string, walletId: string, payload: UpdateWalletStatusDto): Promise<ProspayWalletChangeStatusResponse>;
|
|
9
|
+
getWalletBalance(authToken: string, walletId: string): Promise<ProspayWalletBalanceResponse>;
|
|
10
|
+
getCustomerWallets(authToken: string, customerId: string): Promise<ProspayCustomerWalletsResponse>;
|
|
11
|
+
searchWallets(authToken: string, payload: SearchWalletsDto): Promise<ProspaySearchWalletsResponse>;
|
|
12
|
+
getWalletHistory(authToken: string, walletId: string, params: GetWalletHistoryDto): Promise<any>;
|
|
13
|
+
getDailySnapshot(authToken: string, walletId: string, snapshotDate: string): Promise<ProspayWalletSnapshotResponse>;
|
|
14
|
+
getCustomerSnapshots(authToken: string, customerId: string, snapshotDate: string): Promise<ProspayCustomerSnapshotsResponse>;
|
|
15
|
+
addParticipant(authToken: string, walletId: string, payload: AddParticipantDto): Promise<ProspayWalletAddParticipantResponse>;
|
|
16
|
+
removeParticipant(authToken: string, walletId: string, customerId: string, payload: RemoveParticipantDto): Promise<ProspayWalletRemoveParticipantResponse>;
|
|
17
|
+
getParticipants(authToken: string, walletId: string, params: GetParticipantDto): Promise<ProspayWalletParticipantsResponse>;
|
|
18
|
+
}
|