@veloceapps/sdk 6.0.0-99 → 7.0.0-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.
@@ -775,6 +775,22 @@
775
775
  }, [0, 0])) !== null && _b !== void 0 ? _b : [0, 0], 2), net = _c[0], list = _c[1];
776
776
  return { net: net, list: list };
777
777
  };
778
+ var generateModifiedAssetsMap = function (lineItems) {
779
+ return lineItems.reduce(function (acc, li) {
780
+ var _a;
781
+ if (li.rampInstanceId && li.status !== 'EXIST') {
782
+ var target = li;
783
+ while (target && target.rampInstanceId) {
784
+ target = lineItems.find(function (sub) { return sub.id === li.rampInstanceId; });
785
+ }
786
+ var id = (_a = target === null || target === void 0 ? void 0 : target.assetId) !== null && _a !== void 0 ? _a : target === null || target === void 0 ? void 0 : target.openOrderLineItemId;
787
+ if (id) {
788
+ acc[id] = true;
789
+ }
790
+ }
791
+ return acc;
792
+ }, {});
793
+ };
778
794
  var multiplyLineItems = function (lineItem, qty, split) {
779
795
  if (split) {
780
796
  var unifyIds_1 = function (lineItem) { return (Object.assign(Object.assign({}, lineItem), { id: core.UUID.UUID(), lineItems: lineItem.lineItems.map(unifyIds_1) })); };
@@ -803,6 +819,7 @@
803
819
  getAttributeValue: getAttributeValue,
804
820
  generateLineItem: generateLineItem,
805
821
  getRecommendedPrices: getRecommendedPrices,
822
+ generateModifiedAssetsMap: generateModifiedAssetsMap,
806
823
  multiplyLineItems: multiplyLineItems
807
824
  });
808
825
 
@@ -1878,6 +1895,7 @@
1878
1895
  exports.findLineItem = findLineItem;
1879
1896
  exports.findLineItemWithComparator = findLineItemWithComparator;
1880
1897
  exports.generateLineItem = generateLineItem;
1898
+ exports.generateModifiedAssetsMap = generateModifiedAssetsMap;
1881
1899
  exports.getAttributeValue = getAttributeValue;
1882
1900
  exports.getAttributes = getAttributes;
1883
1901
  exports.getDefaultLineItem = getDefaultLineItem;