@spritz-finance/service-client 0.3.83 → 0.3.84
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * as PaymentsClient from './paymentsClient';
|
|
2
2
|
import { DirectPayment, DirectPaymentStatus, PaymentDeliveryMethod, PaymentStatus } from '../lib/graphClient/generated';
|
|
3
|
-
import { CreateDirectPaymentArgs, ExternalPaymentInput, GetUserRewardFeeAmountBody, GetUsersTransactionVolumeBody, Payment, PaymentSource } from './types';
|
|
3
|
+
import { CreateDirectPaymentArgs, ExternalPaymentInput, GetUserRewardFeeAmountBody, GetUsersTransactionVolumeBody, Payment, PaymentQueryFilter, PaymentSource } from './types';
|
|
4
4
|
export type DirectPaymentModel = {
|
|
5
5
|
_id?: string;
|
|
6
6
|
id: string;
|
|
@@ -55,3 +55,4 @@ export declare function getDirectPaymentDetails(directPaymentId: string): Promis
|
|
|
55
55
|
}>>;
|
|
56
56
|
export declare function getAllPaymentsForUser(userId: string): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<Payment[]>>;
|
|
57
57
|
export declare function directPaymentsForRiskAnalysis(userId: string): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<DirectPaymentModel[]>>;
|
|
58
|
+
export declare function queryUserPayments(userId: string, input?: PaymentQueryFilter): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<Payment[]>>;
|
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.directPaymentsForRiskAnalysis = exports.getAllPaymentsForUser = exports.getDirectPaymentDetails = exports.getDirectPaymentToken = exports.updateExternalPaymentStatus = exports.scheduleExternalPayment = exports.initializeExternalPayment = exports.getRewardFeeAmount = exports.getRewardTransactionVolume = exports.getValidPaymentsForUser = exports.getValidPaymentsForAccount = exports.validateDirectPayment = exports.validatePaymentAmount = exports.createDirectPayment = exports.PaymentsClient = void 0;
|
|
26
|
+
exports.queryUserPayments = exports.directPaymentsForRiskAnalysis = exports.getAllPaymentsForUser = exports.getDirectPaymentDetails = exports.getDirectPaymentToken = exports.updateExternalPaymentStatus = exports.scheduleExternalPayment = exports.initializeExternalPayment = exports.getRewardFeeAmount = exports.getRewardTransactionVolume = exports.getValidPaymentsForUser = exports.getValidPaymentsForAccount = exports.validateDirectPayment = exports.validatePaymentAmount = exports.createDirectPayment = exports.PaymentsClient = void 0;
|
|
27
27
|
exports.PaymentsClient = __importStar(require("./paymentsClient"));
|
|
28
28
|
const serviceClient_1 = require("../serviceClient");
|
|
29
29
|
const PAYMENTS_ENDPOINT = '/liabilities';
|
|
@@ -114,3 +114,9 @@ async function directPaymentsForRiskAnalysis(userId) {
|
|
|
114
114
|
.then((res) => res.data);
|
|
115
115
|
}
|
|
116
116
|
exports.directPaymentsForRiskAnalysis = directPaymentsForRiskAnalysis;
|
|
117
|
+
async function queryUserPayments(userId, input = {}) {
|
|
118
|
+
return serviceClient_1.baseClient
|
|
119
|
+
.post(`${PAYMENTS_ENDPOINT}/payments/query?userId=${userId}`, input)
|
|
120
|
+
.then((res) => res.data);
|
|
121
|
+
}
|
|
122
|
+
exports.queryUserPayments = queryUserPayments;
|
package/lib/payments/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AccountProvider, CreateDirectPaymentInput } from '../lib/graphClient/generated';
|
|
1
|
+
import { AccountProvider, CreateDirectPaymentInput, Network, PaymentStatus } from '../lib/graphClient/generated';
|
|
2
2
|
export type GetUsersTransactionVolumeBody = {
|
|
3
3
|
userIds: string[];
|
|
4
4
|
monthsBack?: number;
|
|
@@ -62,3 +62,24 @@ export type Payment = {
|
|
|
62
62
|
targetCurrencyDiscount: number;
|
|
63
63
|
targetCurrencyRewardsAmount: number;
|
|
64
64
|
};
|
|
65
|
+
export type PaymentQueryFilter = {
|
|
66
|
+
createdAt?: {
|
|
67
|
+
$gte?: string;
|
|
68
|
+
$gt?: string;
|
|
69
|
+
$lte?: string;
|
|
70
|
+
$lt?: string;
|
|
71
|
+
};
|
|
72
|
+
status?: {
|
|
73
|
+
$in: PaymentStatus[];
|
|
74
|
+
} | PaymentStatus;
|
|
75
|
+
network?: {
|
|
76
|
+
$in: Network[];
|
|
77
|
+
} | Network;
|
|
78
|
+
amount?: {
|
|
79
|
+
$gte?: number;
|
|
80
|
+
$gt?: number;
|
|
81
|
+
$lte?: number;
|
|
82
|
+
$lt?: number;
|
|
83
|
+
$eq?: number;
|
|
84
|
+
};
|
|
85
|
+
};
|