@longvansoftware/service-js-client 2.6.0 → 2.6.1

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,3 +6,5 @@ export declare const REMOVE_PRODUCT_OPTION_ORDER_LINE_ITEM: DocumentNode;
6
6
  export declare const ADD_ITEM_INTO_ORDER_BY_PRODUCT_JSON_RESOURCE: (fields?: string[]) => DocumentNode;
7
7
  export declare const UPDATE_ORDER_LINE_ITEM_PARENT_ID: DocumentNode;
8
8
  export declare const UPDATE_PRODUCT_OPTION_ORDERLINE_ITEM: DocumentNode;
9
+ export declare const APPLY_REFERRAL_CODE: DocumentNode;
10
+ export declare const REMOVE_REFERRAL_CODE: DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UPDATE_PRODUCT_OPTION_ORDERLINE_ITEM = exports.UPDATE_ORDER_LINE_ITEM_PARENT_ID = exports.ADD_ITEM_INTO_ORDER_BY_PRODUCT_JSON_RESOURCE = exports.REMOVE_PRODUCT_OPTION_ORDER_LINE_ITEM = exports.ADD_TO_CART = exports.UPDATE_QUANTITY_V2 = exports.CREATE_ORDER = void 0;
3
+ exports.REMOVE_REFERRAL_CODE = exports.APPLY_REFERRAL_CODE = exports.UPDATE_PRODUCT_OPTION_ORDERLINE_ITEM = exports.UPDATE_ORDER_LINE_ITEM_PARENT_ID = exports.ADD_ITEM_INTO_ORDER_BY_PRODUCT_JSON_RESOURCE = exports.REMOVE_PRODUCT_OPTION_ORDER_LINE_ITEM = exports.ADD_TO_CART = exports.UPDATE_QUANTITY_V2 = exports.CREATE_ORDER = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  exports.CREATE_ORDER = (0, graphql_tag_1.gql) `
6
6
  mutation CreateOrder($input: CreateOrderInput!) {
@@ -398,3 +398,13 @@ exports.UPDATE_PRODUCT_OPTION_ORDERLINE_ITEM = (0, graphql_tag_1.gql) `
398
398
  )
399
399
  }
400
400
  `;
401
+ exports.APPLY_REFERRAL_CODE = (0, graphql_tag_1.gql) `
402
+ mutation ApplyReferralCode($input: ReferralCodeOrderInput!) {
403
+ applyReferralCode(input: $input)
404
+ }
405
+ `;
406
+ exports.REMOVE_REFERRAL_CODE = (0, graphql_tag_1.gql) `
407
+ mutation RemoveReferralCode($input: ReferralCodeOrderInput!) {
408
+ removeReferralCode(input: $input)
409
+ }
410
+ `;
@@ -19,4 +19,6 @@ export declare class OrderGraphQLService extends Service {
19
19
  updateOrderLineItemParentId(orderLineItemChildIds: string[], orderLineItemParentId: string, updateBy: string): Promise<any>;
20
20
  updateProductOptionOrderLineItem(orderLineItemId: string, productOptionUpdate: any, updateBy: string): Promise<any>;
21
21
  calculateResourceChangePrice(productIds: string[], quantity: string, unit: string, storeId: string, fields: string[], serviceId: string): Promise<any>;
22
+ applyReferralCode(input: any): Promise<any>;
23
+ removeReferralCode(input: any): Promise<any>;
22
24
  }
@@ -306,5 +306,37 @@ class OrderGraphQLService extends serviceSDK_1.Service {
306
306
  }
307
307
  });
308
308
  }
309
+ applyReferralCode(input) {
310
+ return __awaiter(this, void 0, void 0, function* () {
311
+ const mutation = mutations_1.APPLY_REFERRAL_CODE;
312
+ const variables = {
313
+ input,
314
+ };
315
+ try {
316
+ const response = yield this.graphqlMutationV2(mutation, variables);
317
+ return response.applyReferralCode;
318
+ }
319
+ catch (error) {
320
+ console.log(`Error in applyReferralCode: ${error}`);
321
+ throw error;
322
+ }
323
+ });
324
+ }
325
+ removeReferralCode(input) {
326
+ return __awaiter(this, void 0, void 0, function* () {
327
+ const mutation = mutations_1.REMOVE_REFERRAL_CODE;
328
+ const variables = {
329
+ input,
330
+ };
331
+ try {
332
+ const response = yield this.graphqlMutationV2(mutation, variables);
333
+ return response.removeReferralCode;
334
+ }
335
+ catch (error) {
336
+ console.log(`Error in removeReferralCode: ${error}`);
337
+ throw error;
338
+ }
339
+ });
340
+ }
309
341
  }
310
342
  exports.OrderGraphQLService = OrderGraphQLService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "2.6.0",
3
+ "version": "2.6.1",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [