@longvansoftware/storefront-js-client 2.0.5 → 2.0.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/dist/src/graphql/campaign/queries.d.ts +1 -0
- package/dist/src/graphql/campaign/queries.js +50 -1
- package/dist/src/lib/campaign/index.d.ts +1 -0
- package/dist/src/lib/campaign/index.js +19 -0
- package/dist/src/lib/crm/index.d.ts +1 -0
- package/dist/src/lib/crm/index.js +18 -0
- package/package.json +1 -1
|
@@ -3,3 +3,4 @@ export declare const GET_VOUCHERS: import("graphql").DocumentNode;
|
|
|
3
3
|
export declare const CHECK_VALID_VOUCHER: import("graphql").DocumentNode;
|
|
4
4
|
export declare const GET_CAMPAIGN_ACTIVE_NOW: import("graphql").DocumentNode;
|
|
5
5
|
export declare const GET_PROMOTION_PRODUCT_PRICE: import("graphql").DocumentNode;
|
|
6
|
+
export declare const GET_VOUCHER_AVAILABLE_FOR_CUSTOMER: import("graphql").DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GET_PROMOTION_PRODUCT_PRICE = exports.GET_CAMPAIGN_ACTIVE_NOW = exports.CHECK_VALID_VOUCHER = exports.GET_VOUCHERS = exports.GET_CAMPAIGN_ACTION_ACTIVE_NOW = void 0;
|
|
3
|
+
exports.GET_VOUCHER_AVAILABLE_FOR_CUSTOMER = exports.GET_PROMOTION_PRODUCT_PRICE = exports.GET_CAMPAIGN_ACTIVE_NOW = exports.CHECK_VALID_VOUCHER = exports.GET_VOUCHERS = exports.GET_CAMPAIGN_ACTION_ACTIVE_NOW = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
exports.GET_CAMPAIGN_ACTION_ACTIVE_NOW = (0, graphql_tag_1.gql) `
|
|
6
6
|
query GetCampaignActionActiveNow(
|
|
@@ -207,3 +207,52 @@ exports.GET_PROMOTION_PRODUCT_PRICE = (0, graphql_tag_1.gql) `
|
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
`;
|
|
210
|
+
exports.GET_VOUCHER_AVAILABLE_FOR_CUSTOMER = (0, graphql_tag_1.gql) `
|
|
211
|
+
query GetVoucherAvailableForCustomer(
|
|
212
|
+
$partyId: String
|
|
213
|
+
$storeId: String
|
|
214
|
+
$campaignId: String
|
|
215
|
+
$customerId: String
|
|
216
|
+
$excludeExpired: Boolean
|
|
217
|
+
) {
|
|
218
|
+
getVoucherAvailableForCustomer(
|
|
219
|
+
searchVoucherRequest: {
|
|
220
|
+
partyId: $partyId
|
|
221
|
+
storeId: $storeId
|
|
222
|
+
campaignId: $campaignId
|
|
223
|
+
customerId: $customerId
|
|
224
|
+
excludeExpired: $excludeExpired
|
|
225
|
+
}
|
|
226
|
+
) {
|
|
227
|
+
total
|
|
228
|
+
totalPages
|
|
229
|
+
totalElements
|
|
230
|
+
last
|
|
231
|
+
first
|
|
232
|
+
number
|
|
233
|
+
numberOfElements
|
|
234
|
+
size
|
|
235
|
+
empty
|
|
236
|
+
content {
|
|
237
|
+
campaignActionId
|
|
238
|
+
campaignId
|
|
239
|
+
partyId
|
|
240
|
+
voucherCode
|
|
241
|
+
voucherType
|
|
242
|
+
status
|
|
243
|
+
discountAmount
|
|
244
|
+
discountPercent
|
|
245
|
+
usageLimitPerVoucher
|
|
246
|
+
maximumDiscount
|
|
247
|
+
numberOfTimeUsed
|
|
248
|
+
id
|
|
249
|
+
createdStamp
|
|
250
|
+
updatedStamp
|
|
251
|
+
updatedBy
|
|
252
|
+
createdBy
|
|
253
|
+
isBirthday
|
|
254
|
+
customerId
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
`;
|
|
@@ -12,4 +12,5 @@ export declare class CampaignService extends Service {
|
|
|
12
12
|
checkValidVoucher(customerId: string, voucherCode: string): Promise<any>;
|
|
13
13
|
getCampaignActiveNow(campaignActionType: string, customerId: string): Promise<any>;
|
|
14
14
|
getPromotionProductPrice(productId: String, productPrice: number): Promise<any>;
|
|
15
|
+
getVoucherAvailableForCustomer(campaignId: string, customerId: string, excludeExpired: Boolean): Promise<any>;
|
|
15
16
|
}
|
|
@@ -119,5 +119,24 @@ class CampaignService extends serviceSDK_1.Service {
|
|
|
119
119
|
}
|
|
120
120
|
});
|
|
121
121
|
}
|
|
122
|
+
getVoucherAvailableForCustomer(campaignId, customerId, excludeExpired) {
|
|
123
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
124
|
+
const query = queries_1.GET_VOUCHER_AVAILABLE_FOR_CUSTOMER;
|
|
125
|
+
const variables = {
|
|
126
|
+
partyId: this.orgId,
|
|
127
|
+
storeId: this.storeId,
|
|
128
|
+
campaignId,
|
|
129
|
+
customerId,
|
|
130
|
+
excludeExpired,
|
|
131
|
+
};
|
|
132
|
+
try {
|
|
133
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
134
|
+
return response.getVoucherAvailableForCustomer;
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
throw error;
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
}
|
|
122
141
|
}
|
|
123
142
|
exports.CampaignService = CampaignService;
|
|
@@ -30,4 +30,5 @@ export declare class CrmService extends Service {
|
|
|
30
30
|
removeTag(connectorId: string, tagId: string, removedBy: string): Promise<any>;
|
|
31
31
|
searchTopic(accountTableId: string, pageSize: number, currentPage: number): Promise<any>;
|
|
32
32
|
closeTopic(id: string, updatedBy: string): Promise<any>;
|
|
33
|
+
getTopicByCustomerId(filterTopicRequest: any, pageSize: number, currentPage: number): Promise<any>;
|
|
33
34
|
}
|
|
@@ -506,5 +506,23 @@ class CrmService extends serviceSDK_1.Service {
|
|
|
506
506
|
}
|
|
507
507
|
});
|
|
508
508
|
}
|
|
509
|
+
getTopicByCustomerId(filterTopicRequest, pageSize, currentPage) {
|
|
510
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
511
|
+
const query = queries_1.SEARCH_TOPIC;
|
|
512
|
+
const variables = {
|
|
513
|
+
filterTopicRequest,
|
|
514
|
+
partnerId: this.orgId,
|
|
515
|
+
pageSize,
|
|
516
|
+
currentPage,
|
|
517
|
+
};
|
|
518
|
+
try {
|
|
519
|
+
const response = yield this.graphqlMutationV2(query, variables);
|
|
520
|
+
return response.searchTopic;
|
|
521
|
+
}
|
|
522
|
+
catch (error) {
|
|
523
|
+
throw error;
|
|
524
|
+
}
|
|
525
|
+
});
|
|
526
|
+
}
|
|
509
527
|
}
|
|
510
528
|
exports.CrmService = CrmService;
|