@longvansoftware/service-js-client 1.17.1 → 1.17.3
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/crm_camping/queries.d.ts +2 -0
- package/dist/src/graphql/crm_camping/queries.js +73 -1
- package/dist/src/lib/crm_camping/index.d.ts +2 -0
- package/dist/src/lib/crm_camping/index.js +32 -0
- package/dist/src/lib/order/index.d.ts +1 -0
- package/dist/src/lib/order/index.js +17 -0
- package/package.json +1 -1
|
@@ -6,3 +6,5 @@ export declare const GET_AVERAGE_RATING: import("graphql").DocumentNode;
|
|
|
6
6
|
export declare const GET_URL_EVALUATION: import("graphql").DocumentNode;
|
|
7
7
|
export declare const GET_NUMBER_OF_TICKET_EVALUATION: import("graphql").DocumentNode;
|
|
8
8
|
export declare const SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE: import("graphql").DocumentNode;
|
|
9
|
+
export declare const GET_VOUCHERS_V2: import("graphql").DocumentNode;
|
|
10
|
+
export declare const SEARCH_CAMPAIGN: import("graphql").DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE = exports.GET_NUMBER_OF_TICKET_EVALUATION = exports.GET_URL_EVALUATION = exports.GET_AVERAGE_RATING = exports.GET_VOUCHERS = exports.SUGGEST_VOUCHER = exports.GET_CAMPAIGN_ACTION_BY_ID = exports.SEARCH_PRODUCT_QUANTITY_PROMOTION_ACTION = void 0;
|
|
3
|
+
exports.SEARCH_CAMPAIGN = exports.GET_VOUCHERS_V2 = exports.SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE = exports.GET_NUMBER_OF_TICKET_EVALUATION = exports.GET_URL_EVALUATION = exports.GET_AVERAGE_RATING = exports.GET_VOUCHERS = exports.SUGGEST_VOUCHER = exports.GET_CAMPAIGN_ACTION_BY_ID = exports.SEARCH_PRODUCT_QUANTITY_PROMOTION_ACTION = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
exports.SEARCH_PRODUCT_QUANTITY_PROMOTION_ACTION = (0, graphql_tag_1.gql) `
|
|
6
6
|
query SearchProductQuantityPromotionAction(
|
|
@@ -280,3 +280,75 @@ exports.SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE = (0, graphql_tag_1.gql) `
|
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
282
|
`;
|
|
283
|
+
exports.GET_VOUCHERS_V2 = (0, graphql_tag_1.gql) `
|
|
284
|
+
query SearchVoucher($searchVoucherRequest: SearchVoucherRequest) {
|
|
285
|
+
searchVoucher(searchVoucherRequest: $searchVoucherRequest) {
|
|
286
|
+
total
|
|
287
|
+
totalPages
|
|
288
|
+
totalElements
|
|
289
|
+
last
|
|
290
|
+
first
|
|
291
|
+
number
|
|
292
|
+
numberOfElements
|
|
293
|
+
size
|
|
294
|
+
empty
|
|
295
|
+
content {
|
|
296
|
+
campaignActionId
|
|
297
|
+
campaignId
|
|
298
|
+
partyId
|
|
299
|
+
voucherCode
|
|
300
|
+
voucherType
|
|
301
|
+
status
|
|
302
|
+
discountAmount
|
|
303
|
+
discountPercent
|
|
304
|
+
usageLimitPerVoucher
|
|
305
|
+
maximumDiscount
|
|
306
|
+
numberOfTimeUsed
|
|
307
|
+
id
|
|
308
|
+
createdStamp
|
|
309
|
+
updatedStamp
|
|
310
|
+
updatedBy
|
|
311
|
+
createdBy
|
|
312
|
+
isBirthday
|
|
313
|
+
customerId
|
|
314
|
+
scope
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
`;
|
|
319
|
+
exports.SEARCH_CAMPAIGN = (0, graphql_tag_1.gql) `
|
|
320
|
+
query SearchCampaign($searchCampaignRequest: SearchCampaignRequest) {
|
|
321
|
+
searchCampaign(searchCampaignRequest: $searchCampaignRequest) {
|
|
322
|
+
content {
|
|
323
|
+
id
|
|
324
|
+
createdStamp
|
|
325
|
+
updatedStamp
|
|
326
|
+
updatedBy
|
|
327
|
+
createdBy
|
|
328
|
+
useForAll
|
|
329
|
+
description
|
|
330
|
+
partyId
|
|
331
|
+
name
|
|
332
|
+
type
|
|
333
|
+
domain
|
|
334
|
+
fromDate
|
|
335
|
+
toDate
|
|
336
|
+
status
|
|
337
|
+
}
|
|
338
|
+
total
|
|
339
|
+
totalPages
|
|
340
|
+
totalElements
|
|
341
|
+
last
|
|
342
|
+
first
|
|
343
|
+
number
|
|
344
|
+
numberOfElements
|
|
345
|
+
size
|
|
346
|
+
empty
|
|
347
|
+
sort {
|
|
348
|
+
sorted
|
|
349
|
+
unsorted
|
|
350
|
+
empty
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
`;
|
|
@@ -13,4 +13,6 @@ export declare class CrmCampingService extends Service {
|
|
|
13
13
|
getNumberOfTicketEvaluation(customerId: string): Promise<any>;
|
|
14
14
|
searchProductGiftPromotionResponse(parameterSearchProductGift: any): Promise<any>;
|
|
15
15
|
addProductGiftPromotion(orderId: string, updatedBy: string, addData: any): Promise<any>;
|
|
16
|
+
searchVouchersV2(searchVoucherRequest: any): Promise<any>;
|
|
17
|
+
searchCampaign(searchCampaignRequest: any): Promise<any>;
|
|
16
18
|
}
|
|
@@ -223,5 +223,37 @@ class CrmCampingService extends serviceSDK_1.Service {
|
|
|
223
223
|
}
|
|
224
224
|
});
|
|
225
225
|
}
|
|
226
|
+
searchVouchersV2(searchVoucherRequest) {
|
|
227
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
228
|
+
const query = queries_1.GET_VOUCHERS_V2;
|
|
229
|
+
const variables = {
|
|
230
|
+
searchVoucherRequest: Object.assign({ partyId: this.orgId }, searchVoucherRequest),
|
|
231
|
+
};
|
|
232
|
+
try {
|
|
233
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
234
|
+
return response.searchVoucher;
|
|
235
|
+
}
|
|
236
|
+
catch (error) {
|
|
237
|
+
console.log(`Error fetching searchVoucher: ${error}`);
|
|
238
|
+
throw error;
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
searchCampaign(searchCampaignRequest) {
|
|
243
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
244
|
+
const query = queries_1.SEARCH_CAMPAIGN;
|
|
245
|
+
const variables = {
|
|
246
|
+
searchCampaignRequest: Object.assign({ partyId: this.orgId }, searchCampaignRequest),
|
|
247
|
+
};
|
|
248
|
+
try {
|
|
249
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
250
|
+
return response.searchCampaign;
|
|
251
|
+
}
|
|
252
|
+
catch (error) {
|
|
253
|
+
console.log(`Error fetching searchCampaign: ${error}`);
|
|
254
|
+
throw error;
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
}
|
|
226
258
|
}
|
|
227
259
|
exports.CrmCampingService = CrmCampingService;
|
|
@@ -472,4 +472,5 @@ export declare class OrderService extends Service {
|
|
|
472
472
|
findCampaignActionGiftVoucher(): Promise<any>;
|
|
473
473
|
addProductGiftPromotion(orderId: string, updatedBy: string, data: any): Promise<any>;
|
|
474
474
|
removeProductGiftPromotion(orderId: string, orderLineItemId: string): Promise<any>;
|
|
475
|
+
checkNewCustomer(orderId: string, customer_id: string): Promise<any>;
|
|
475
476
|
}
|
|
@@ -1313,5 +1313,22 @@ class OrderService extends serviceSDK_1.Service {
|
|
|
1313
1313
|
}
|
|
1314
1314
|
});
|
|
1315
1315
|
}
|
|
1316
|
+
checkNewCustomer(orderId, customer_id) {
|
|
1317
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1318
|
+
console.log("🚀 ~ OrderService ~ removeProductGiftPromotion ~ orderLineItemId:", customer_id);
|
|
1319
|
+
console.log("🚀 ~ OrderService ~ removeProductGiftPromotion ~ orderId:", orderId);
|
|
1320
|
+
const endpoint = `/front/orders/${this.orgId}/${customer_id}/${orderId}/newCustomer`;
|
|
1321
|
+
const method = "GET";
|
|
1322
|
+
try {
|
|
1323
|
+
const response = yield this.restApiCallWithToken(endpoint, method);
|
|
1324
|
+
console.log(response);
|
|
1325
|
+
return response;
|
|
1326
|
+
}
|
|
1327
|
+
catch (error) {
|
|
1328
|
+
console.log(`Error in removeProductGiftPromotion: ${error}`);
|
|
1329
|
+
throw error;
|
|
1330
|
+
}
|
|
1331
|
+
});
|
|
1332
|
+
}
|
|
1316
1333
|
}
|
|
1317
1334
|
exports.OrderService = OrderService;
|