@longvansoftware/service-js-client 2.1.5 → 2.1.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.
@@ -5,3 +5,4 @@ export declare const ADD_TO_CART: DocumentNode;
5
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
+ export declare const UPDATE_PRODUCT_OPTION_ORDERLINE_ITEM: DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- 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.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!) {
@@ -385,3 +385,16 @@ exports.UPDATE_ORDER_LINE_ITEM_PARENT_ID = (0, graphql_tag_1.gql) `
385
385
  )
386
386
  }
387
387
  `;
388
+ exports.UPDATE_PRODUCT_OPTION_ORDERLINE_ITEM = (0, graphql_tag_1.gql) `
389
+ mutation updateProductOptionOrderLineItem(
390
+ $orderLineItemId: String!
391
+ $productOptionUpdate: [ProductOptionInput]!
392
+ $updateBy: String!
393
+ ) {
394
+ updateProductOptionOrderLineItem(
395
+ orderLineItemId: $orderLineItemId
396
+ productOptionUpdate: $productOptionUpdate
397
+ updateBy: $updateBy
398
+ )
399
+ }
400
+ `;
@@ -17,3 +17,4 @@ export declare const GET_VAT_INFOR_BY_OWNER_PARTY_ID: DocumentNode;
17
17
  export declare const GET_TEAM_BY_USER_ID: DocumentNode;
18
18
  export declare const GET_USERS_BY_TEAM_ID: DocumentNode;
19
19
  export declare const GET_CUSTOMER_BY_ID_DYNAMIC: (fields?: string[]) => DocumentNode;
20
+ export declare const GET_CUSTOMER_BY_IDS_DYNAMIC: (fields?: string[]) => DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GET_CUSTOMER_BY_ID_DYNAMIC = exports.GET_USERS_BY_TEAM_ID = exports.GET_TEAM_BY_USER_ID = exports.GET_VAT_INFOR_BY_OWNER_PARTY_ID = exports.GET_WARDS_BY_PROVINCE_ID = exports.GET_WARDS = exports.GET_DISTRICTS = exports.GET_PROVINCES = exports.GET_CONTACT_INFOS_BY_COMPANY_ID = exports.GET_COMPANY_BY_CONTACT_INFO_ID = exports.GET_EMPLOYEES_BY_STORE_CHANEL_ID = exports.GET_STORE_CHANEL_IDS_BY_EMPLOYESS_ID = exports.GET_POSTIONS_BY_EMPLOYEES_ID = exports.SEARCH_EMPLOYEES = exports.SEARCH_CUSTOMER = exports.GET_CUSTOMER_BY_ID = exports.SEARCH_COMPANY = exports.GET_PERSON_BY_IDS_QUERY = void 0;
3
+ exports.GET_CUSTOMER_BY_IDS_DYNAMIC = exports.GET_CUSTOMER_BY_ID_DYNAMIC = exports.GET_USERS_BY_TEAM_ID = exports.GET_TEAM_BY_USER_ID = exports.GET_VAT_INFOR_BY_OWNER_PARTY_ID = exports.GET_WARDS_BY_PROVINCE_ID = exports.GET_WARDS = exports.GET_DISTRICTS = exports.GET_PROVINCES = exports.GET_CONTACT_INFOS_BY_COMPANY_ID = exports.GET_COMPANY_BY_CONTACT_INFO_ID = exports.GET_EMPLOYEES_BY_STORE_CHANEL_ID = exports.GET_STORE_CHANEL_IDS_BY_EMPLOYESS_ID = exports.GET_POSTIONS_BY_EMPLOYEES_ID = exports.SEARCH_EMPLOYEES = exports.SEARCH_CUSTOMER = exports.GET_CUSTOMER_BY_ID = exports.SEARCH_COMPANY = exports.GET_PERSON_BY_IDS_QUERY = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  exports.GET_PERSON_BY_IDS_QUERY = (0, graphql_tag_1.gql) `
6
6
  query GetPersonByIds($partyIds: [String!]!) {
@@ -342,3 +342,14 @@ const GET_CUSTOMER_BY_ID_DYNAMIC = (fields = []) => {
342
342
  `;
343
343
  };
344
344
  exports.GET_CUSTOMER_BY_ID_DYNAMIC = GET_CUSTOMER_BY_ID_DYNAMIC;
345
+ const GET_CUSTOMER_BY_IDS_DYNAMIC = (fields = []) => {
346
+ const fieldStr = fields.join("\n ");
347
+ const hasFields = fields.length > 0;
348
+ return (0, graphql_tag_1.gql) `query GetCustomerByIds($ids: [String]) {
349
+ getCustomerByIds(ids: $ids) {
350
+ ${hasFields ? `${fieldStr}` : ""}
351
+ }
352
+ }
353
+ `;
354
+ };
355
+ exports.GET_CUSTOMER_BY_IDS_DYNAMIC = GET_CUSTOMER_BY_IDS_DYNAMIC;
@@ -17,4 +17,5 @@ export declare class OrderGraphQLService extends Service {
17
17
  searchOrderDynamic(params: any, fields: string[]): Promise<any>;
18
18
  addItemIntoOrderByProductJsonResource(serviceId: string, orderId: string, itemInput: any, durationQuantity: number, durationUnit: string, actorId: string, fields: string[]): Promise<any>;
19
19
  updateOrderLineItemParentId(orderLineItemChildIds: string[], orderLineItemParentId: string, updateBy: string): Promise<any>;
20
+ updateProductOptionOrderLineItem(orderLineItemId: string, productOptionUpdate: any, updateBy: string): Promise<any>;
20
21
  }
@@ -267,5 +267,23 @@ class OrderGraphQLService extends serviceSDK_1.Service {
267
267
  }
268
268
  });
269
269
  }
270
+ updateProductOptionOrderLineItem(orderLineItemId, productOptionUpdate, updateBy) {
271
+ return __awaiter(this, void 0, void 0, function* () {
272
+ const mutation = mutations_1.UPDATE_PRODUCT_OPTION_ORDERLINE_ITEM;
273
+ const variables = {
274
+ orderLineItemId,
275
+ productOptionUpdate,
276
+ updateBy,
277
+ };
278
+ try {
279
+ const response = yield this.graphqlMutationV2(mutation, variables);
280
+ return response.updateProductOptionOrderLineItem;
281
+ }
282
+ catch (error) {
283
+ console.log(`Error in updateProductOptionOrderLineItem: ${error}`);
284
+ throw error;
285
+ }
286
+ });
287
+ }
270
288
  }
271
289
  exports.OrderGraphQLService = OrderGraphQLService;
@@ -34,4 +34,5 @@ export declare class UserService extends Service {
34
34
  removeUserFromTeam(teamId: string, userId: string, deletedBy: string): Promise<any>;
35
35
  updateTeamName(teamId: string, name: string, updatedBy: string): Promise<any>;
36
36
  getCustomerByIdDynamic(id: string, fields: string[]): Promise<any>;
37
+ getCustomerByIdsDynamic(ids: string[], fields: string[]): Promise<any>;
37
38
  }
@@ -557,5 +557,21 @@ class UserService extends serviceSDK_1.Service {
557
557
  }
558
558
  });
559
559
  }
560
+ getCustomerByIdsDynamic(ids, fields) {
561
+ return __awaiter(this, void 0, void 0, function* () {
562
+ const query = (0, queries_1.GET_CUSTOMER_BY_IDS_DYNAMIC)(fields);
563
+ const variables = {
564
+ ids,
565
+ };
566
+ try {
567
+ const response = yield this.graphqlQueryV2(query, variables);
568
+ return response.getCustomerByIds;
569
+ }
570
+ catch (error) {
571
+ console.log(`Error in getCustomerByIds: ${error}`);
572
+ throw error;
573
+ }
574
+ });
575
+ }
560
576
  }
561
577
  exports.UserService = UserService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "2.1.5",
3
+ "version": "2.1.7",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [