@longvansoftware/service-js-client 1.20.6 → 1.20.8

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.
@@ -391,11 +391,12 @@ exports.LINKING_RESUME_DOMAIN_AND_CONTACT = (0, graphql_tag_1.gql) `
391
391
  `;
392
392
  exports.ADD_RESOURCE_RELATED = (0, graphql_tag_1.gql) `
393
393
  mutation AddResourceRelated(
394
- $fromId: String!
395
- $fromResourceType: String!
396
- $toIds: [String]!
397
- $toResourceType: String!
398
- $createdBy: String!
394
+ $fromId: String
395
+ $fromResourceType: String
396
+ $toIds: [String]
397
+ $toResourceType: String
398
+ $createdBy: String
399
+ $type: String
399
400
  ) {
400
401
  addResourceRelated(
401
402
  fromId: $fromId
@@ -403,6 +404,7 @@ exports.ADD_RESOURCE_RELATED = (0, graphql_tag_1.gql) `
403
404
  toIds: $toIds
404
405
  toResourceType: $toResourceType
405
406
  createdBy: $createdBy
407
+ type: $type
406
408
  )
407
409
  }
408
410
  `;
@@ -5,3 +5,4 @@ export declare const GET_QUANTITY_ORDER_LINEITEMS: DocumentNode;
5
5
  export declare const GET_ORDER_LINE_ITEM_BY_SERVICE_ID: DocumentNode;
6
6
  export declare const GET_ORDER_BY_SERVICE_ID: DocumentNode;
7
7
  export declare const FIND_ORDER_BY_OWNER_PARTYID: DocumentNode;
8
+ export declare const CALC_EXCHANGE_PRICE_EXTEND_RESOURCE_DETAIL_DYNAMIC: (fields?: string[]) => DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FIND_ORDER_BY_OWNER_PARTYID = exports.GET_ORDER_BY_SERVICE_ID = exports.GET_ORDER_LINE_ITEM_BY_SERVICE_ID = exports.GET_QUANTITY_ORDER_LINEITEMS = exports.GET_ORDER_DETAIL_DYNAMIC = exports.GET_ORDER_DETAIL = void 0;
3
+ exports.CALC_EXCHANGE_PRICE_EXTEND_RESOURCE_DETAIL_DYNAMIC = exports.FIND_ORDER_BY_OWNER_PARTYID = exports.GET_ORDER_BY_SERVICE_ID = exports.GET_ORDER_LINE_ITEM_BY_SERVICE_ID = exports.GET_QUANTITY_ORDER_LINEITEMS = exports.GET_ORDER_DETAIL_DYNAMIC = exports.GET_ORDER_DETAIL = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  exports.GET_ORDER_DETAIL = (0, graphql_tag_1.gql) `
6
6
  query getOrderDetail($orderId: String!) {
@@ -138,46 +138,46 @@ exports.GET_ORDER_DETAIL = (0, graphql_tag_1.gql) `
138
138
  title
139
139
  }
140
140
  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
- unitGift
178
- giftDuration
179
- giftDurationUnit
180
- }
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
+ unitGift
178
+ giftDuration
179
+ giftDurationUnit
180
+ }
181
181
  itemType
182
182
  }
183
183
  serviceId
@@ -434,3 +434,27 @@ exports.FIND_ORDER_BY_OWNER_PARTYID = (0, graphql_tag_1.gql) `
434
434
  findOrderByOwnerPartyId(partnerId: $partnerId, ownerPartyId: $ownerPartyId)
435
435
  }
436
436
  `;
437
+ const CALC_EXCHANGE_PRICE_EXTEND_RESOURCE_DETAIL_DYNAMIC = (fields = []) => {
438
+ const fieldStr = fields.join("\n ");
439
+ const hasFields = fields.length > 0;
440
+ return (0, graphql_tag_1.gql) `
441
+ query CalcExchangePriceExtendResourceDetail(
442
+ $partnerId: String!
443
+ $storeId: String!
444
+ $serviceId: String!
445
+ $productBaseIdNew: String!
446
+ $durationQuantity: BigDecimal!
447
+ $durationUnit: String!
448
+ ) {
449
+ calcExchangePriceExtendResourceDetail(
450
+ partnerId: $partnerId
451
+ storeId: $storeId
452
+ serviceId: $serviceId
453
+ productBaseIdNew: $productBaseIdNew
454
+ durationQuantity: $durationQuantity
455
+ durationUnit: $durationUnit
456
+ ) ${hasFields ? `{ ${fieldStr} }` : ""}
457
+ }
458
+ `;
459
+ };
460
+ exports.CALC_EXCHANGE_PRICE_EXTEND_RESOURCE_DETAIL_DYNAMIC = CALC_EXCHANGE_PRICE_EXTEND_RESOURCE_DETAIL_DYNAMIC;
@@ -32,7 +32,7 @@ export declare class CrmService extends Service {
32
32
  getResumeDomainByServiceId(serviceId: string): Promise<any>;
33
33
  getCollegesByProvinceId(provinceId: string | null): Promise<any>;
34
34
  getRelatedResourceByResourceType(fromId: string, fromResourceType: string, toResourceType: string): Promise<any>;
35
- addResourceRelated(fromId: string, fromResourceType: string, toIds: string[], toResourceType: string, createdBy: string): Promise<any>;
35
+ addResourceRelated(fromId: string, fromResourceType: string, toIds: string[], toResourceType: string, createdBy: string, type: string): Promise<any>;
36
36
  getResumeInfoByCustomerId(customerId: string): Promise<any>;
37
37
  getResumeInfoByCustomerIdDynamic(customerId: string, fields: string[]): Promise<any>;
38
38
  createResumeInfo(data: any): Promise<any>;
@@ -527,7 +527,7 @@ class CrmService extends serviceSDK_1.Service {
527
527
  }
528
528
  });
529
529
  }
530
- addResourceRelated(fromId, fromResourceType, toIds, toResourceType, createdBy) {
530
+ addResourceRelated(fromId, fromResourceType, toIds, toResourceType, createdBy, type) {
531
531
  return __awaiter(this, void 0, void 0, function* () {
532
532
  const mutation = mutations_1.ADD_RESOURCE_RELATED;
533
533
  const variables = {
@@ -536,6 +536,7 @@ class CrmService extends serviceSDK_1.Service {
536
536
  toIds,
537
537
  toResourceType,
538
538
  createdBy,
539
+ type
539
540
  };
540
541
  try {
541
542
  const response = yield this.graphqlMutationV2(mutation, variables);
@@ -13,4 +13,5 @@ export declare class OrderGraphQLService extends Service {
13
13
  addToCart(serviceId: string, actorId: string, cartId: string): Promise<any>;
14
14
  removeProductOptionOrderLineItem(orderLineItemId: string, optionId: string, updateBy: string): Promise<any>;
15
15
  findOrderByOwnerPartyId(ownerPartyId: string): Promise<any>;
16
+ calcExchangePriceExtendResourceDetail(serviceId: string, productBaseIdNew: string, durationQuantity: string, durationUnit: string, fields: string[]): Promise<any>;
16
17
  }
@@ -188,5 +188,26 @@ class OrderGraphQLService extends serviceSDK_1.Service {
188
188
  }
189
189
  });
190
190
  }
191
+ calcExchangePriceExtendResourceDetail(serviceId, productBaseIdNew, durationQuantity, durationUnit, fields) {
192
+ return __awaiter(this, void 0, void 0, function* () {
193
+ const query = (0, queries_1.CALC_EXCHANGE_PRICE_EXTEND_RESOURCE_DETAIL_DYNAMIC)(fields);
194
+ const variables = {
195
+ partnerId: this.orgId,
196
+ storeId: this.storeId,
197
+ serviceId,
198
+ productBaseIdNew,
199
+ durationQuantity,
200
+ durationUnit,
201
+ };
202
+ try {
203
+ const response = yield this.graphqlQueryV2(query, variables);
204
+ return response.calcExchangePriceExtendResourceDetail;
205
+ }
206
+ catch (error) {
207
+ console.log(`Error in calcExchangePriceExtendResourceDetail: ${error}`);
208
+ throw error;
209
+ }
210
+ });
211
+ }
191
212
  }
192
213
  exports.OrderGraphQLService = OrderGraphQLService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "1.20.6",
3
+ "version": "1.20.8",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [