@aptos-scp/scp-component-store-selling-features-domain-model 1.46.3 → 1.46.5

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.
@@ -93,7 +93,7 @@ class FulfillmentGroup {
93
93
  return this;
94
94
  }
95
95
  static getDeliveryAddress(contact) {
96
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
96
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
97
97
  const primaryAddress = (_a = contact.addresses) === null || _a === void 0 ? void 0 : _a.find((address) => address.primaryIndicator);
98
98
  return {
99
99
  addressLine1: ((_b = contact) === null || _b === void 0 ? void 0 : _b.address1) || ((_c = primaryAddress) === null || _c === void 0 ? void 0 : _c.address1),
@@ -106,6 +106,7 @@ class FulfillmentGroup {
106
106
  countryCode: ((_r = contact) === null || _r === void 0 ? void 0 : _r.countryCode) || ((_s = primaryAddress) === null || _s === void 0 ? void 0 : _s.countryCode),
107
107
  firstAdminDivision: ((_t = contact) === null || _t === void 0 ? void 0 : _t.firstAdminDivision) || ((_u = primaryAddress) === null || _u === void 0 ? void 0 : _u.firstAdminDivision),
108
108
  firstAdminDivisionCode: ((_v = contact) === null || _v === void 0 ? void 0 : _v.firstAdminDivisionCode) || ((_w = primaryAddress) === null || _w === void 0 ? void 0 : _w.firstAdminDivisionCode),
109
+ firstAdminDivisionType: ((_x = contact) === null || _x === void 0 ? void 0 : _x.firstAdminDivisionType) || ((_y = primaryAddress) === null || _y === void 0 ? void 0 : _y.firstAdminDivisionType),
109
110
  };
110
111
  }
111
112
  static getDeliveryContact(contact) {
@@ -141,13 +141,15 @@ class TenderType {
141
141
  var _a, _b, _c, _d;
142
142
  let total = new scp_component_business_core_1.Money(0, accountingCurrency);
143
143
  (_b = (_a = displayInfo) === null || _a === void 0 ? void 0 : _a.shippingFeeDisplayLines) === null || _b === void 0 ? void 0 : _b.forEach((shippingFeeDisplayLine) => {
144
+ var _a;
144
145
  if (shippingFeeDisplayLine.lineType === scp_types_commerce_transaction_1.LineType.TransactionFeeRefund) {
145
- total = total.plus(shippingFeeDisplayLine.extendedAmountIncludingTax.abs());
146
+ total = total.plus((_a = shippingFeeDisplayLine.extendedAmountIncludingTax) === null || _a === void 0 ? void 0 : _a.abs());
146
147
  }
147
148
  });
148
149
  (_d = (_c = displayInfo) === null || _c === void 0 ? void 0 : _c.itemFeeDisplayLines) === null || _d === void 0 ? void 0 : _d.forEach((itemFeeDisplayLine) => {
150
+ var _a;
149
151
  if (itemFeeDisplayLine.lineType === scp_types_commerce_transaction_1.LineType.ItemFeeRefund) {
150
- total = total.plus(itemFeeDisplayLine.extendedAmount.abs());
152
+ total = total.plus((_a = itemFeeDisplayLine.extendedAmountIncludingTax) === null || _a === void 0 ? void 0 : _a.abs());
151
153
  }
152
154
  });
153
155
  return total;
@@ -236,8 +238,7 @@ class TenderType {
236
238
  withoutTransactionTotal = withoutTransactionTotal.plus(withoutTransactionItemAmount);
237
239
  const withoutTransactionTenderedAmount = TenderType.getTenderedAmountsWithoutTransaction((_b = displayInfo) === null || _b === void 0 ? void 0 : _b.tenderDisplayLines, accountingCurrency, configurationManager);
238
240
  withoutTransactionTotal = withoutTransactionTotal.minus(withoutTransactionTenderedAmount);
239
- const feesTotal = TenderType.getFeesTotal(displayInfo, accountingCurrency);
240
- withoutTransactionTotal = withoutTransactionTotal.plus(feesTotal);
241
+ // shipping and item fee are not returned on RWOR
241
242
  return withoutTransactionTotal;
242
243
  }
243
244
  static getWithTransactionTotal(displayInfo, accountingCurrency, configurationManager) {
@@ -258,8 +259,7 @@ class TenderType {
258
259
  withOfflineTransactionTotal = withOfflineTransactionTotal.plus(withOfflineTransactionItemAmount);
259
260
  const withOfflineTransactionTenderedAmount = TenderType.getTenderedAmountsWithOfflineTransaction((_b = displayInfo) === null || _b === void 0 ? void 0 : _b.tenderDisplayLines, accountingCurrency, configurationManager);
260
261
  withOfflineTransactionTotal = withOfflineTransactionTotal.minus(withOfflineTransactionTenderedAmount);
261
- const feesTotal = TenderType.getFeesTotal(displayInfo, accountingCurrency);
262
- withOfflineTransactionTotal = withOfflineTransactionTotal.plus(feesTotal);
262
+ // shipping and item fee are not returned on offline returns
263
263
  return withOfflineTransactionTotal;
264
264
  }
265
265
  static getOriginalRefundableTenders(container, accountingCurrency, originalTransactionsDetails, balanceDue, itemTypes, orderTypes, isRefund, productAttributeTypes, displayInfo) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aptos-scp/scp-component-store-selling-features-domain-model",
3
- "version": "1.46.3",
3
+ "version": "1.46.5",
4
4
  "description": "This component library provides the common components to handle the coordination of processing the business events from the UI.",
5
5
  "private": false,
6
6
  "license": "SEE LICENSE IN LICENSE.md",