@longvansoftware/storefront-js-client 2.6.7 → 2.6.9

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.
@@ -214,6 +214,7 @@ exports.GET_VOUCHER_AVAILABLE_FOR_CUSTOMER = (0, graphql_tag_1.gql) `
214
214
  $partyId: String
215
215
  $storeId: String
216
216
  $campaignId: String
217
+ $campaignActionId: String
217
218
  $customerId: String
218
219
  $excludeExpired: Boolean
219
220
  $isPageAble: Boolean
@@ -223,6 +224,7 @@ exports.GET_VOUCHER_AVAILABLE_FOR_CUSTOMER = (0, graphql_tag_1.gql) `
223
224
  partyId: $partyId
224
225
  storeId: $storeId
225
226
  campaignId: $campaignId
227
+ campaignActionId: $campaignActionId
226
228
  customerId: $customerId
227
229
  excludeExpired: $excludeExpired
228
230
  isPageAble: $isPageAble
@@ -12,7 +12,7 @@ export declare class CampaignService extends Service {
12
12
  checkValidVoucher(customerId: string, voucherCode: string): Promise<any>;
13
13
  getCampaignActiveNow(campaignActionType: string, customerId: string): Promise<any>;
14
14
  getPromotionProductPrice(productId: String, productPrice: number): Promise<any>;
15
- getVoucherAvailableForCustomer(campaignId: string, customerId: string, excludeExpired: Boolean, isPageAble: Boolean): Promise<any>;
15
+ getVoucherAvailableForCustomer(campaignId: string, campaignActionId: string, customerId: string, excludeExpired: Boolean, isPageAble: Boolean): Promise<any>;
16
16
  addCustomerToVoucher(voucherCode: string, userId: string): Promise<any>;
17
17
  suggestVoucher(): Promise<any>;
18
18
  getCampaignActionById(id: string): Promise<any>;
@@ -121,13 +121,14 @@ class CampaignService extends serviceSDK_1.Service {
121
121
  }
122
122
  });
123
123
  }
124
- getVoucherAvailableForCustomer(campaignId, customerId, excludeExpired, isPageAble) {
124
+ getVoucherAvailableForCustomer(campaignId, campaignActionId, customerId, excludeExpired, isPageAble) {
125
125
  return __awaiter(this, void 0, void 0, function* () {
126
126
  const query = queries_1.GET_VOUCHER_AVAILABLE_FOR_CUSTOMER;
127
127
  const variables = {
128
128
  partyId: this.orgId,
129
129
  storeId: this.storeId,
130
130
  campaignId,
131
+ campaignActionId,
131
132
  customerId,
132
133
  excludeExpired,
133
134
  isPageAble,
@@ -120,7 +120,7 @@ export declare class OrderService extends Service {
120
120
  * @returns A promise that resolves when the customer and shipping address are updated.
121
121
  * @throws If an error occurs while updating the customer and shipping address.
122
122
  */
123
- updatePriceInOrder(orderId: string, orderItemId: string, priceNew: number): Promise<any>;
123
+ updatePriceInOrder(orderId: string, orderItemId: string, priceNew: number, reason: string): Promise<any>;
124
124
  /**
125
125
  * Update discount price in order
126
126
  * @param orderId - The ID of the order.
@@ -283,12 +283,15 @@ class OrderService extends serviceSDK_1.Service {
283
283
  * @returns A promise that resolves when the customer and shipping address are updated.
284
284
  * @throws If an error occurs while updating the customer and shipping address.
285
285
  */
286
- updatePriceInOrder(orderId, orderItemId, priceNew) {
286
+ updatePriceInOrder(orderId, orderItemId, priceNew, reason) {
287
287
  return __awaiter(this, void 0, void 0, function* () {
288
288
  const endpoint = `/orders/${this.orgId}/${this.storeId}/${orderId}/${orderItemId}/price?price_new=${priceNew}`;
289
289
  const method = "PUT";
290
+ const dataReq = {
291
+ reason,
292
+ };
290
293
  try {
291
- const response = yield this.restApiCallWithToken(endpoint, method);
294
+ const response = yield this.restApiCallWithToken(endpoint, method, dataReq);
292
295
  return response;
293
296
  }
294
297
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "2.6.7",
3
+ "version": "2.6.9",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [