@spritz-finance/service-client 0.7.1 → 0.7.2
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,7 +1,7 @@
|
|
|
1
1
|
export * as LiabilitiesClient from "./liabilitiesServiceClient";
|
|
2
2
|
import { CheckbookUser } from "../lib/graphClient/generated";
|
|
3
3
|
import { ExternalBillInput } from "../payableAccounts/types";
|
|
4
|
-
import { CheckbookCardResponse, CheckbookDebitCardResponse, CheckbookDigitalAccountResponse, CheckbookUpdateCardResponse, CreateCheckbookUserParams, CreateDebitCardInput, CreateDigitalAccountInput, CreateEntityParams, DirectPaymentResponse, MethodFiEntity, RewardTransaction } from "./types";
|
|
4
|
+
import { CheckbookCardResponse, CheckbookDebitCardResponse, CheckbookDigitalAccountResponse, CheckbookUpdateCardResponse, CreateCheckbookUserParams, CreateDebitCardInput, CreateDigitalAccountInput, CreateEntityParams, DirectPaymentResponse, IssueRefundCreditInput, IssueRefundCreditResult, MethodFiEntity, RewardTransaction } from "./types";
|
|
5
5
|
export declare function getRewardTransaction(transactionId: string): Promise<RewardTransaction>;
|
|
6
6
|
export declare function createMethodFiEntity(args: CreateEntityParams): Promise<MethodFiEntity>;
|
|
7
7
|
export declare function getMethodFiEntity(userId: string): Promise<MethodFiEntity | null>;
|
|
@@ -27,3 +27,4 @@ export declare function addCashbackCredit(input: {
|
|
|
27
27
|
}): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<RewardTransaction>>;
|
|
28
28
|
export declare function getRewardTransactionsFor(userId: string): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<RewardTransaction[]>>;
|
|
29
29
|
export declare function getDirectPayment(directPaymentId: string): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<DirectPaymentResponse>>;
|
|
30
|
+
export declare function issueRefundCredit(userId: string, input: IssueRefundCreditInput): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<IssueRefundCreditResult>>;
|
|
@@ -51,6 +51,7 @@ exports.addPromotionCredit = addPromotionCredit;
|
|
|
51
51
|
exports.addCashbackCredit = addCashbackCredit;
|
|
52
52
|
exports.getRewardTransactionsFor = getRewardTransactionsFor;
|
|
53
53
|
exports.getDirectPayment = getDirectPayment;
|
|
54
|
+
exports.issueRefundCredit = issueRefundCredit;
|
|
54
55
|
exports.LiabilitiesClient = __importStar(require("./liabilitiesServiceClient"));
|
|
55
56
|
const serviceClient_1 = require("../serviceClient");
|
|
56
57
|
const LIABILITIES_ENDPOINT = "/liabilities";
|
|
@@ -146,3 +147,8 @@ async function getDirectPayment(directPaymentId) {
|
|
|
146
147
|
.get(`${LIABILITIES_V2_ENDPOINT}/direct-payment/${directPaymentId}`)
|
|
147
148
|
.then((res) => res.data);
|
|
148
149
|
}
|
|
150
|
+
async function issueRefundCredit(userId, input) {
|
|
151
|
+
return serviceClient_1.baseClient
|
|
152
|
+
.post(`${LIABILITIES_V2_ENDPOINT}/rewards/users/${userId}/refund-credits`, input)
|
|
153
|
+
.then((res) => res.data);
|
|
154
|
+
}
|
|
@@ -12,9 +12,12 @@ export declare enum RewardCreditSource {
|
|
|
12
12
|
REFERRER_REWARD = "REFERRER_REWARD",
|
|
13
13
|
REFERRAL_REWARD = "REFERRAL_REWARD",
|
|
14
14
|
CONTEST = "CONTEST",
|
|
15
|
+
CASHBACK = "CASHBACK",
|
|
16
|
+
COMPENSATION = "COMPENSATION",
|
|
15
17
|
REFUND = "REFUND",
|
|
16
18
|
OTHER = "OTHER",
|
|
17
|
-
REVENUE_SHARE = "REVENUE_SHARE"
|
|
19
|
+
REVENUE_SHARE = "REVENUE_SHARE",
|
|
20
|
+
PROMOTION = "PROMOTION"
|
|
18
21
|
}
|
|
19
22
|
export type CheckbookCardResponse = {
|
|
20
23
|
userId: string;
|
|
@@ -54,7 +57,16 @@ export interface RewardTransaction {
|
|
|
54
57
|
updatedAt: string;
|
|
55
58
|
userId: string;
|
|
56
59
|
context?: string;
|
|
60
|
+
reference?: string;
|
|
57
61
|
}
|
|
62
|
+
export type IssueRefundCreditInput = {
|
|
63
|
+
amount: number;
|
|
64
|
+
reference: string;
|
|
65
|
+
};
|
|
66
|
+
export type IssueRefundCreditResult = {
|
|
67
|
+
credit: RewardTransaction;
|
|
68
|
+
created: boolean;
|
|
69
|
+
};
|
|
58
70
|
type TEntityTypes = "individual" | "c_corporation" | "s_corporation" | "llc" | "partnership" | "sole_proprietorship" | "receive_only";
|
|
59
71
|
interface IEntityIndividual {
|
|
60
72
|
first_name: string | null;
|
package/lib/liabilities/types.js
CHANGED
|
@@ -17,7 +17,10 @@ var RewardCreditSource;
|
|
|
17
17
|
RewardCreditSource["REFERRER_REWARD"] = "REFERRER_REWARD";
|
|
18
18
|
RewardCreditSource["REFERRAL_REWARD"] = "REFERRAL_REWARD";
|
|
19
19
|
RewardCreditSource["CONTEST"] = "CONTEST";
|
|
20
|
+
RewardCreditSource["CASHBACK"] = "CASHBACK";
|
|
21
|
+
RewardCreditSource["COMPENSATION"] = "COMPENSATION";
|
|
20
22
|
RewardCreditSource["REFUND"] = "REFUND";
|
|
21
23
|
RewardCreditSource["OTHER"] = "OTHER";
|
|
22
24
|
RewardCreditSource["REVENUE_SHARE"] = "REVENUE_SHARE";
|
|
25
|
+
RewardCreditSource["PROMOTION"] = "PROMOTION";
|
|
23
26
|
})(RewardCreditSource || (exports.RewardCreditSource = RewardCreditSource = {}));
|