@longvansoftware/service-js-client 1.17.4 → 1.17.6

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.
@@ -6,5 +6,3 @@ 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_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;
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;
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(
@@ -257,12 +257,9 @@ exports.SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE = (0, graphql_tag_1.gql) `
257
257
  productId
258
258
  productParentId
259
259
  quantityLimit
260
- newCustomer
261
- minimumSpend
262
260
  giftPromotions {
263
261
  fromQuantity
264
262
  toProductId
265
- toProductParentId
266
263
  toQuantity
267
264
  productName
268
265
  sku
@@ -280,75 +277,3 @@ exports.SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE = (0, graphql_tag_1.gql) `
280
277
  }
281
278
  }
282
279
  `;
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
- `;
@@ -113,8 +113,6 @@ exports.GET_ORDER_DETAIL = (0, graphql_tag_1.gql) `
113
113
  currencyCode
114
114
  }
115
115
  orderLineItemParentId
116
- giftConditionProductId
117
- giftQuantity
118
116
  variant {
119
117
  id
120
118
  price {
@@ -137,44 +135,18 @@ exports.GET_ORDER_DETAIL = (0, graphql_tag_1.gql) `
137
135
  value
138
136
  title
139
137
  }
138
+ resourceItems {
139
+ name
140
+ quantity
141
+ unit
142
+ productId
143
+ }
140
144
  resourceConfigs {
141
- name
142
- quantity
143
- unit
144
- productId
145
- giftProductId
146
- gift
147
- giftQuantity
148
- campaignId
149
- campaignActionId
150
- qualify
151
- idParent
152
- addQuantity
153
- defaultQuantity
154
- title
155
- price
156
- unitPrice
157
- totalResource
158
- }
159
- resourceItems {
160
- name
161
- quantity
162
- unit
163
- productId
164
- giftProductId
165
- gift
166
- giftQuantity
167
- campaignId
168
- campaignActionId
169
- qualify
170
- idParent
171
- addQuantity
172
- defaultQuantity
173
- title
174
- price
175
- unitPrice
176
- totalResource
177
- }
145
+ name
146
+ quantity
147
+ unit
148
+ productId
149
+ }
178
150
  itemType
179
151
  }
180
152
  serviceId
@@ -209,7 +181,6 @@ exports.GET_QUANTITY_ORDER_LINEITEMS = (0, graphql_tag_1.gql) `
209
181
  }
210
182
  itemType
211
183
  orderLineItemParentId
212
- giftConditionProductId
213
184
  }
214
185
  }
215
186
  }
@@ -269,8 +240,6 @@ exports.GET_ORDER_LINE_ITEM_BY_SERVICE_ID = (0, graphql_tag_1.gql) `
269
240
  updatedStamp
270
241
  completedAt
271
242
  orderLineItemParentId
272
- giftConditionProductId
273
- giftQuantity
274
243
  orderStatus
275
244
  totalVAT {
276
245
  amount
@@ -13,6 +13,4 @@ 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>;
18
16
  }
@@ -223,37 +223,5 @@ 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
- }
258
226
  }
259
227
  exports.CrmCampingService = CrmCampingService;
@@ -471,6 +471,4 @@ export declare class OrderService extends Service {
471
471
  addProductInOrderWithoutLogin(orderId: string, updated_by: string, data: any, store: string): Promise<any>;
472
472
  findCampaignActionGiftVoucher(): Promise<any>;
473
473
  addProductGiftPromotion(orderId: string, updatedBy: string, data: any): Promise<any>;
474
- removeProductGiftPromotion(orderId: string, orderLineItemId: string): Promise<any>;
475
- checkNewCustomer(orderId: string, customer_id: string): Promise<any>;
476
474
  }
@@ -1295,40 +1295,5 @@ class OrderService extends serviceSDK_1.Service {
1295
1295
  }
1296
1296
  });
1297
1297
  }
1298
- // https://storefront.dev.longvan.vn/swagger-ui/index.html#/Order%20API/removeGiftQuantity
1299
- removeProductGiftPromotion(orderId, orderLineItemId) {
1300
- return __awaiter(this, void 0, void 0, function* () {
1301
- console.log("🚀 ~ OrderService ~ removeProductGiftPromotion ~ orderLineItemId:", orderLineItemId);
1302
- console.log("🚀 ~ OrderService ~ removeProductGiftPromotion ~ orderId:", orderId);
1303
- const endpoint = `/orders/${this.orgId}/${orderId}/${orderLineItemId}/giftQuantity`;
1304
- const method = "PUT";
1305
- try {
1306
- const response = yield this.restApiCallWithToken(endpoint, method);
1307
- console.log(response);
1308
- return response;
1309
- }
1310
- catch (error) {
1311
- console.log(`Error in removeProductGiftPromotion: ${error}`);
1312
- throw error;
1313
- }
1314
- });
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
- }
1333
1298
  }
1334
1299
  exports.OrderService = OrderService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "1.17.4",
3
+ "version": "1.17.6",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [