@longvansoftware/storefront-js-client 2.2.7-beta.3 → 2.2.7-beta.4
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ADD_CUSTOMER_ID_INTO_VOUCHER: import("graphql").DocumentNode;
|
|
@@ -1 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ADD_CUSTOMER_ID_INTO_VOUCHER = void 0;
|
|
7
|
+
const graphql_tag_1 = __importDefault(require("graphql-tag"));
|
|
8
|
+
exports.ADD_CUSTOMER_ID_INTO_VOUCHER = (0, graphql_tag_1.default) `
|
|
9
|
+
mutation AddCustomerIdIntoVoucher(
|
|
10
|
+
$partyId: String!
|
|
11
|
+
$customerId: String!
|
|
12
|
+
$voucherCode: String!
|
|
13
|
+
) {
|
|
14
|
+
addCustomerIdIntoVoucher(
|
|
15
|
+
partyId: $partyId
|
|
16
|
+
customerId: $customerId
|
|
17
|
+
voucherCode: $voucherCode
|
|
18
|
+
) {
|
|
19
|
+
campaignActionId
|
|
20
|
+
campaignId
|
|
21
|
+
partyId
|
|
22
|
+
voucherCode
|
|
23
|
+
voucherType
|
|
24
|
+
status
|
|
25
|
+
discountAmount
|
|
26
|
+
discountPercent
|
|
27
|
+
usageLimitPerVoucher
|
|
28
|
+
maximumDiscount
|
|
29
|
+
numberOfTimeUsed
|
|
30
|
+
id
|
|
31
|
+
createdStamp
|
|
32
|
+
updatedStamp
|
|
33
|
+
updatedBy
|
|
34
|
+
createdBy
|
|
35
|
+
isBirthday
|
|
36
|
+
customerId
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
@@ -222,14 +222,6 @@ class AuthService extends serviceSDK_1.Service {
|
|
|
222
222
|
}
|
|
223
223
|
});
|
|
224
224
|
}
|
|
225
|
-
// mutation ResetPassword {
|
|
226
|
-
// resetPassword(
|
|
227
|
-
// orgId: "FYP"
|
|
228
|
-
// username: "0971879660"
|
|
229
|
-
// newPassword: "123123"
|
|
230
|
-
// accessToken: "882812312"
|
|
231
|
-
// )
|
|
232
|
-
// }
|
|
233
225
|
resetPassword(username, newPassword, accessToken) {
|
|
234
226
|
return __awaiter(this, void 0, void 0, function* () {
|
|
235
227
|
const query = mutations_1.RESET_PASSWORD_MUTATION;
|
|
@@ -13,4 +13,5 @@ export declare class CampaignService extends Service {
|
|
|
13
13
|
getCampaignActiveNow(campaignActionType: string, customerId: string): Promise<any>;
|
|
14
14
|
getPromotionProductPrice(productId: String, productPrice: number): Promise<any>;
|
|
15
15
|
getVoucherAvailableForCustomer(campaignId: string, customerId: string, excludeExpired: Boolean): Promise<any>;
|
|
16
|
+
addCustomerIdIntoVoucher(partyId: string, customerId: string, voucherCode: string): Promise<any>;
|
|
16
17
|
}
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.CampaignService = void 0;
|
|
13
13
|
const serviceSDK_1 = require("../serviceSDK");
|
|
14
14
|
const queries_1 = require("../../graphql/campaign/queries");
|
|
15
|
+
const mutations_1 = require("../../graphql/campaign/mutations");
|
|
15
16
|
class CampaignService extends serviceSDK_1.Service {
|
|
16
17
|
/**
|
|
17
18
|
* Constructs a new CampaignService instance.
|
|
@@ -138,5 +139,22 @@ class CampaignService extends serviceSDK_1.Service {
|
|
|
138
139
|
}
|
|
139
140
|
});
|
|
140
141
|
}
|
|
142
|
+
addCustomerIdIntoVoucher(partyId, customerId, voucherCode) {
|
|
143
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
144
|
+
const query = mutations_1.ADD_CUSTOMER_ID_INTO_VOUCHER;
|
|
145
|
+
const variables = {
|
|
146
|
+
partyId: this.orgId,
|
|
147
|
+
customerId,
|
|
148
|
+
voucherCode,
|
|
149
|
+
};
|
|
150
|
+
try {
|
|
151
|
+
const response = yield this.graphqlMutation(query, variables);
|
|
152
|
+
return response.addCustomerIdIntoVoucher;
|
|
153
|
+
}
|
|
154
|
+
catch (error) {
|
|
155
|
+
throw error;
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
}
|
|
141
159
|
}
|
|
142
160
|
exports.CampaignService = CampaignService;
|