@crystaldesign/basket-model 24.12.0-beta.3 → 24.12.0-beta.30

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.
@@ -79,85 +79,93 @@ var GroupsData = /*#__PURE__*/_createClass__default["default"](function GroupsDa
79
79
  this.Group = new GroupData(json);
80
80
  });
81
81
 
82
- var VariantItemData = /*#__PURE__*/_createClass__default["default"](function VariantItemData(json) {
83
- _classCallCheck__default["default"](this, VariantItemData);
84
- _defineProperty__default["default"](this, "BasketID", void 0);
85
- _defineProperty__default["default"](this, "OPT", void 0);
86
- // OptionCodex
87
- _defineProperty__default["default"](this, "OPTName", void 0);
88
- // Name der Option
89
- _defineProperty__default["default"](this, "OPTName_locales", void 0);
90
- _defineProperty__default["default"](this, "TabGroup", void 0);
91
- // TabGroup in welches sich die Option befindet
92
- _defineProperty__default["default"](this, "TabGroup_locales", void 0);
93
- _defineProperty__default["default"](this, "OPV", void 0);
94
- // OptionValue Codex
95
- _defineProperty__default["default"](this, "vOPV", void 0);
96
- // Benutzerfreudliche OptionValue Codex (IDM) welcher im Frontend angezeigt werden soll
97
- _defineProperty__default["default"](this, "OPVName", void 0);
98
- _defineProperty__default["default"](this, "OPVName_locales", void 0);
99
- _defineProperty__default["default"](this, "OPVImage", void 0);
100
- _defineProperty__default["default"](this, "OPVHexVal", void 0);
101
- _defineProperty__default["default"](this, "SinglePrice", void 0);
102
- // Aufpreis / Basepreis der option
103
- _defineProperty__default["default"](this, "AddPercentage", void 0);
104
- // Prozentueller Aufpreis der Option
105
- _defineProperty__default["default"](this, "ShowOPVAsArticleNr", void 0);
106
- _defineProperty__default["default"](this, "SendToSAP", void 0);
107
- _defineProperty__default["default"](this, "ArticlePlaceholder", void 0);
108
- _defineProperty__default["default"](this, "HideInOrderText", void 0);
109
- _defineProperty__default["default"](this, "Hidden", void 0);
110
- _defineProperty__default["default"](this, "IsDescribingState", void 0);
111
- // If true it means this option does not change the Product but just the state like if an Ombrella is opened or closed
112
- _defineProperty__default["default"](this, "FreeText", void 0);
113
- _defineProperty__default["default"](this, "FreeTextLang", void 0);
114
- _defineProperty__default["default"](this, "MeasureValue", void 0);
115
- _defineProperty__default["default"](this, "MeasureUnit", void 0);
116
- _defineProperty__default["default"](this, "isFreeText", void 0);
117
- _defineProperty__default["default"](this, "isMeasureValue", void 0);
118
- //public OPTEAN?: string = ""; // BARCode der Artikel / deprected
119
- //public OPVEAN?: string = "";
120
- //public FirstTime?: string = "";
121
- _defineProperty__default["default"](this, "AddPrice", void 0);
122
- _defineProperty__default["default"](this, "AddPriceFormatted", void 0);
123
- _defineProperty__default["default"](this, "PriceUnit", void 0);
124
- _defineProperty__default["default"](this, "PriceID", void 0);
125
- _defineProperty__default["default"](this, "OCD", void 0);
126
- _defineProperty__default["default"](this, "OptionOCD", void 0);
127
- this.BasketID = json.BasketID;
128
- this.OPT = json.OPTCodex;
129
- this.OPV = json.OPVCodex;
130
- this.OPTName = json.OPTName;
131
- this.OPTName_locales = json.OPTName_locales;
132
- this.TabGroup = json.TabGroup;
133
- this.TabGroup_locales = json.TabGroup_locales;
134
- this.vOPV = json.vOPV;
135
- this.OPVName = json.OPVName;
136
- this.OPVName_locales = json.OPVName_locales;
137
- this.OPVImage = json.OPVImage;
138
- this.OPVHexVal = json.OPVHexVal;
139
- this.FreeText = json.FreeText;
140
- this.SinglePrice = json.SinglePrice;
141
- this.AddPercentage = json.AddPercentage;
142
- this.IsDescribingState = json.IsDescribingState;
143
- this.SendToSAP = json.SendToSAP;
144
- this.ArticlePlaceholder = json.ArticlePlaceholder;
145
- this.HideInOrderText = json.HideInOrderText;
146
- this.Hidden = json.Hidden;
147
- this.ShowOPVAsArticleNr = json.ShowOPVAsArticleNr;
148
- this.AddPrice = json.AddPrice;
149
- if (this.AddPrice) this.AddPriceFormatted = json.AddPriceFormatted;
150
- this.PriceUnit = json.PriceUnit;
151
- this.PriceID = json.PriceID;
152
- this.FreeText = json.FreeText;
153
- this.MeasureValue = json.MeasureValue;
154
- this.MeasureUnit = json.MeasureUnit;
155
- this.isFreeText = json.isFreeText;
156
- this.isMeasureValue = json.isMeasureValue;
157
- this.OCD = json.OCD;
158
- this.OptionOCD = json.OptionOCD;
159
- this.FreeTextLang = json.FreeTextLang;
160
- });
82
+ var VariantItemData = /*#__PURE__*/function () {
83
+ function VariantItemData(json) {
84
+ _classCallCheck__default["default"](this, VariantItemData);
85
+ _defineProperty__default["default"](this, "BasketID", void 0);
86
+ _defineProperty__default["default"](this, "OPT", void 0);
87
+ // OptionCodex
88
+ _defineProperty__default["default"](this, "OPTName", void 0);
89
+ // Name der Option
90
+ _defineProperty__default["default"](this, "OPTName_locales", void 0);
91
+ _defineProperty__default["default"](this, "TabGroup", void 0);
92
+ // TabGroup in welches sich die Option befindet
93
+ _defineProperty__default["default"](this, "TabGroup_locales", void 0);
94
+ _defineProperty__default["default"](this, "OPV", void 0);
95
+ // OptionValue Codex
96
+ _defineProperty__default["default"](this, "vOPV", void 0);
97
+ // Benutzerfreudliche OptionValue Codex (IDM) welcher im Frontend angezeigt werden soll
98
+ _defineProperty__default["default"](this, "OPVName", void 0);
99
+ _defineProperty__default["default"](this, "OPVName_locales", void 0);
100
+ _defineProperty__default["default"](this, "OPVImage", void 0);
101
+ _defineProperty__default["default"](this, "OPVHexVal", void 0);
102
+ _defineProperty__default["default"](this, "SinglePrice", void 0);
103
+ // Aufpreis / Basepreis der option
104
+ _defineProperty__default["default"](this, "AddPercentage", void 0);
105
+ // Prozentueller Aufpreis der Option
106
+ _defineProperty__default["default"](this, "ShowOPVAsArticleNr", void 0);
107
+ _defineProperty__default["default"](this, "SendToSAP", void 0);
108
+ _defineProperty__default["default"](this, "ArticlePlaceholder", void 0);
109
+ _defineProperty__default["default"](this, "HideInOrderText", void 0);
110
+ _defineProperty__default["default"](this, "Hidden", void 0);
111
+ _defineProperty__default["default"](this, "IsDescribingState", void 0);
112
+ // If true it means this option does not change the Product but just the state like if an Ombrella is opened or closed
113
+ _defineProperty__default["default"](this, "FreeText", void 0);
114
+ _defineProperty__default["default"](this, "FreeTextLang", void 0);
115
+ _defineProperty__default["default"](this, "MeasureValue", void 0);
116
+ _defineProperty__default["default"](this, "MeasureUnit", void 0);
117
+ _defineProperty__default["default"](this, "isFreeText", void 0);
118
+ _defineProperty__default["default"](this, "isMeasureValue", void 0);
119
+ //public OPTEAN?: string = ""; // BARCode der Artikel / deprected
120
+ //public OPVEAN?: string = "";
121
+ //public FirstTime?: string = "";
122
+ _defineProperty__default["default"](this, "AddPrice", void 0);
123
+ _defineProperty__default["default"](this, "AddPriceFormatted", void 0);
124
+ _defineProperty__default["default"](this, "PriceUnit", void 0);
125
+ _defineProperty__default["default"](this, "PriceID", void 0);
126
+ _defineProperty__default["default"](this, "OCD", void 0);
127
+ _defineProperty__default["default"](this, "OptionOCD", void 0);
128
+ this.BasketID = json.BasketID;
129
+ this.OPT = json.OPT;
130
+ this.OPV = json.OPV;
131
+ this.OPTName = json.OPTName;
132
+ this.OPTName_locales = json.OPTName_locales;
133
+ this.TabGroup = json.TabGroup;
134
+ this.TabGroup_locales = json.TabGroup_locales;
135
+ this.vOPV = json.vOPV;
136
+ this.OPVName = json.OPVName;
137
+ this.OPVName_locales = json.OPVName_locales;
138
+ this.OPVImage = json.OPVImage;
139
+ this.OPVHexVal = json.OPVHexVal;
140
+ this.FreeText = json.FreeText;
141
+ this.SinglePrice = json.SinglePrice;
142
+ this.AddPercentage = json.AddPercentage;
143
+ this.IsDescribingState = json.IsDescribingState;
144
+ this.SendToSAP = json.SendToSAP;
145
+ this.ArticlePlaceholder = json.ArticlePlaceholder;
146
+ this.HideInOrderText = json.HideInOrderText;
147
+ this.Hidden = json.Hidden;
148
+ this.ShowOPVAsArticleNr = json.ShowOPVAsArticleNr;
149
+ this.AddPrice = json.AddPrice;
150
+ if (this.AddPrice) this.AddPriceFormatted = json.AddPriceFormatted;
151
+ this.PriceUnit = json.PriceUnit;
152
+ this.PriceID = json.PriceID;
153
+ this.FreeText = json.FreeText;
154
+ this.MeasureValue = json.MeasureValue;
155
+ this.MeasureUnit = json.MeasureUnit;
156
+ this.isFreeText = json.isFreeText;
157
+ this.isMeasureValue = json.isMeasureValue;
158
+ this.OCD = json.OCD;
159
+ this.OptionOCD = json.OptionOCD;
160
+ this.FreeTextLang = json.FreeTextLang;
161
+ }
162
+ return _createClass__default["default"](VariantItemData, [{
163
+ key: "getStringForHash",
164
+ value: function getStringForHash() {
165
+ return this.OPT + '_' + this.OPV + (this.MeasureValue !== undefined ? '_' + this.MeasureValue : '') + (this.FreeText !== undefined ? '_' + this.FreeText : '');
166
+ }
167
+ }]);
168
+ }();
161
169
 
162
170
  function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
163
171
  function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -245,9 +253,6 @@ var OrderLineData = /*#__PURE__*/function () {
245
253
  // Partlistartikel werden nicht übernommen sondern beim laden von hauptartikel neu berechnet
246
254
  _defineProperty__default["default"](this, "PartlistArticleInvisibility", void 0);
247
255
  _defineProperty__default["default"](this, "HasPartlistArticle", void 0);
248
- _defineProperty__default["default"](this, "IsBoxPlannerArticle", void 0);
249
- // EK Text wird bei diesen Artikeln zusammengefasst falls ArtikelCodex und Description übereinstimmen
250
- //public IsPlannerElement: boolean;
251
256
  _defineProperty__default["default"](this, "NoPrice", void 0);
252
257
  // UseCase Jutzler Kleiderstange darf pro elemen eine gratis sein
253
258
  _defineProperty__default["default"](this, "dontAddToFinalOrderLine", void 0);
@@ -313,15 +318,12 @@ var OrderLineData = /*#__PURE__*/function () {
313
318
  this.RuleDesc = json.RuleDesc;
314
319
  this.Image = json.Image;
315
320
  this.SendToSAP = json.SendToSAP;
316
- if (json.VariantBasketData) {
317
- var variantBasketDatas = JSON.parse(decodeURIComponent(json.VariantBasketData).replace(/@/g, '"'));
318
- this.VariantBasketDatas = [];
319
- for (var i = 0; i < variantBasketDatas.length; i++) {
320
- this.VariantBasketDatas.push(new VariantItemData(variantBasketDatas[i])); //: VariantItemData[] = [];
321
- }
322
- }
323
321
  if (json.VariantBasketDatas) {
324
- this.VariantBasketDatas = json.VariantBasketDatas;
322
+ var newVariants = [];
323
+ for (var i = 0; i < json.VariantBasketDatas.length; i++) {
324
+ newVariants.push(new VariantItemData(json.VariantBasketDatas[i]));
325
+ }
326
+ this.VariantBasketDatas = newVariants;
325
327
  }
326
328
  if (json.ConfigPriceDatas) this.ConfigPriceDatas = json.ConfigPriceDatas;
327
329
  this.ArticlePlaceholder = json.ArticlePlaceholder;
@@ -346,8 +348,6 @@ var OrderLineData = /*#__PURE__*/function () {
346
348
  this.UserDataString = json.UserDataString;
347
349
  this.IsPartlistArticle = json.IsPartlistArticle == true;
348
350
  this.HasPartlistArticle = json.HasPartlistArticle == true;
349
- //this.IsPlannerElement = json.IsPlannerElement;
350
- this.IsBoxPlannerArticle = json.IsBoxPlannerArticle == true;
351
351
  this.NoPrice = json.NoPrice == true;
352
352
  this.ShelfPlandata = json.ShelfPlandata != '%7B%7D' ? json.ShelfPlandata : undefined;
353
353
  this.RetailArticleNr = json.RetailArticleNr;
@@ -413,7 +413,12 @@ var OrderLineData = /*#__PURE__*/function () {
413
413
  var ret = {};
414
414
  if (!this.VariantBasketDatas) this.VariantBasketDatas = [];
415
415
  for (var i = 0; i < this.VariantBasketDatas.length; i++) {
416
- ret['OPT' + this.VariantBasketDatas[i].OPT] = 'OPV' + this.VariantBasketDatas[i].OPV;
416
+ var v = this.VariantBasketDatas[i];
417
+ ret['OPT' + v.OPT] = 'OPV' + v.OPV;
418
+ if (v.MeasureValue || v.FreeText) {
419
+ var _ref;
420
+ ret['OPT' + v.OPT + '_val'] = (_ref = v.MeasureValue || v.FreeText) === null || _ref === void 0 ? void 0 : _ref.toString();
421
+ }
417
422
  }
418
423
  return ret;
419
424
  }
@@ -480,6 +485,41 @@ var OrderLineData = /*#__PURE__*/function () {
480
485
  !config.hideTotalPrices && this.CalcPrice ? t('basket.priceOverview.table.sum') + ': ' + DivaUtils__default["default"].formatPrice(this.CalcPrice, priceFormat) + ' \n' : '')
481
486
  );
482
487
  }
488
+ }, {
489
+ key: "getHash",
490
+ value: function getHash() {
491
+ var _this$VariantBasketDa2, _this$VariantBasketDa3;
492
+ return DivaUtils.md5(this.CatalogCodex + '_' + this.ArticleCodex + '_' + this.Quantity + '_' + ((_this$VariantBasketDa2 = (_this$VariantBasketDa3 = this.VariantBasketDatas) === null || _this$VariantBasketDa3 === void 0 || (_this$VariantBasketDa3 = _this$VariantBasketDa3.filter(function (v) {
493
+ return !v.IsDescribingState;
494
+ })) === null || _this$VariantBasketDa3 === void 0 ? void 0 : _this$VariantBasketDa3.map(function (v) {
495
+ return v.getStringForHash();
496
+ })) !== null && _this$VariantBasketDa2 !== void 0 ? _this$VariantBasketDa2 : []).join());
497
+ }
498
+ }, {
499
+ key: "getTinyVariantConfigurationDatas",
500
+ value: function getTinyVariantConfigurationDatas() {
501
+ var _this$VariantBasketDa4, _this$VariantBasketDa5, _this$VariantBasketDa6, _this$VariantBasketDa7;
502
+ return [].concat(_toConsumableArray__default["default"]((_this$VariantBasketDa4 = (_this$VariantBasketDa5 = this.VariantBasketDatas) === null || _this$VariantBasketDa5 === void 0 ? void 0 : _this$VariantBasketDa5.map(function (v) {
503
+ return {
504
+ OPT: v.OPT,
505
+ OPV: v.OPV,
506
+ OCD: v.OCD,
507
+ OptionOCD: v.OptionOCD,
508
+ IsDescribingState: v.IsDescribingState
509
+ };
510
+ })) !== null && _this$VariantBasketDa4 !== void 0 ? _this$VariantBasketDa4 : []), _toConsumableArray__default["default"]((_this$VariantBasketDa6 = (_this$VariantBasketDa7 = this.VariantBasketDatas) === null || _this$VariantBasketDa7 === void 0 || (_this$VariantBasketDa7 = _this$VariantBasketDa7.filter(function (v) {
511
+ return v.MeasureValue || v.FreeText;
512
+ })) === null || _this$VariantBasketDa7 === void 0 ? void 0 : _this$VariantBasketDa7.map(function (v) {
513
+ var _ref2;
514
+ return {
515
+ OPT: v.OPT + '_val',
516
+ OPV: (_ref2 = v.MeasureValue || v.FreeText) === null || _ref2 === void 0 ? void 0 : _ref2.toString(),
517
+ OCD: v.OCD,
518
+ OptionOCD: v.OptionOCD,
519
+ IsDescribingState: v.IsDescribingState
520
+ };
521
+ })) !== null && _this$VariantBasketDa6 !== void 0 ? _this$VariantBasketDa6 : []));
522
+ }
483
523
  }, {
484
524
  key: "getAsJson",
485
525
  value: function getAsJson() {
@@ -540,8 +580,6 @@ var OrderSetData = /*#__PURE__*/function () {
540
580
  // EK-Text / wird beim Speichern Clientseitig nicht gefüllt
541
581
  _defineProperty__default["default"](this, "SetOrderText_locales", void 0);
542
582
  _defineProperty__default["default"](this, "OrderLines", []);
543
- _defineProperty__default["default"](this, "MainPosNr", void 0);
544
- // PosNr des Sets (Reihungsnummer)
545
583
  _defineProperty__default["default"](this, "Description", void 0);
546
584
  // Checkout
547
585
  _defineProperty__default["default"](this, "UserSetDataString", void 0);
@@ -580,6 +618,7 @@ var OrderSetData = /*#__PURE__*/function () {
580
618
  _defineProperty__default["default"](this, "CatalogListAccountGUID", void 0);
581
619
  // get AccountGUID von der Kollektion
582
620
  _defineProperty__default["default"](this, "ConfigVariants", void 0);
621
+ _defineProperty__default["default"](this, "TinyVariantConfiguration", void 0);
583
622
  _defineProperty__default["default"](this, "Weight", void 0);
584
623
  _defineProperty__default["default"](this, "WeightUnit", void 0);
585
624
  _defineProperty__default["default"](this, "Volume", void 0);
@@ -599,6 +638,7 @@ var OrderSetData = /*#__PURE__*/function () {
599
638
  _defineProperty__default["default"](this, "SupplierILN", void 0);
600
639
  _defineProperty__default["default"](this, "SupplierCatalogName", void 0);
601
640
  _defineProperty__default["default"](this, "Favorites", void 0);
641
+ _defineProperty__default["default"](this, "Variant", void 0);
602
642
  _defineProperty__default["default"](this, "MetaData", void 0);
603
643
  _defineProperty__default["default"](this, "MetaData_locales", void 0);
604
644
  _defineProperty__default["default"](this, "AdditionalCatalogPrice", void 0);
@@ -626,6 +666,7 @@ var OrderSetData = /*#__PURE__*/function () {
626
666
  this.SetOrderText_locales = json.SetOrderText_locales;
627
667
  this.Set2DImage = json.Set2DImage;
628
668
  this.Favorites = json.Favorites;
669
+ this.Variant = json.Variant;
629
670
  this.ConfigVariants = json.ConfigVariants;
630
671
  this.VariantDescription = json.VariantDescription;
631
672
  this.VariantDescription_locales = json.VariantDescription_locales;
@@ -636,7 +677,6 @@ var OrderSetData = /*#__PURE__*/function () {
636
677
  this.OrigZKATNr = json.OrigZKATNr && json.OrigZKATNr != '' ? json.OrigZKATNr : ZKATNr;
637
678
  this.SetArticleNr = json.SetArticleNr && json.SetArticleNr != '' ? json.SetArticleNr : SetArticleNr;
638
679
  this.SetArticleNrPrefix = json.SetArticleNrPrefix && json.SetArticleNrPrefix != '' ? json.SetArticleNrPrefix : SetArticleNrPrefix;
639
- this.MainPosNr = json.MainPosNr;
640
680
  this.Description = json.Description;
641
681
  this.UserSetDataString = json.UserSetDataString;
642
682
  this.BasketModelDesc = json.BasketModelDesc;
@@ -655,6 +695,7 @@ var OrderSetData = /*#__PURE__*/function () {
655
695
  this.BruttoSetPrice = json.BruttoSetPrice;
656
696
  this.CatalogLastUpdate = json.CatalogLastUpdate;
657
697
  this.CatalogValidTo = json.CatalogValidTo;
698
+ this.TinyVariantConfiguration = json.TinyVariantConfiguration;
658
699
  this.ModelCodex = json.ModelCodex;
659
700
  this.ModelCatalogCodex = json.ModelCatalogCodex;
660
701
  this.GroupType = json.GroupType;
@@ -1910,9 +1951,6 @@ var BasketData = /*#__PURE__*/function () {
1910
1951
  key: "concatOrderSets",
1911
1952
  value: function concatOrderSets(orderSets) {
1912
1953
  this.OrderSets = orderSets.concat(this.OrderSets);
1913
- for (var i = 0; i < this.OrderSets.length; i++) {
1914
- this.OrderSets[i].MainPosNr = i + 1;
1915
- }
1916
1954
  }
1917
1955
  }, {
1918
1956
  key: "convertToBaseConfiguration",
@@ -1934,11 +1972,95 @@ var BasketData = /*#__PURE__*/function () {
1934
1972
  value: function getEKText(withoutPrices) {
1935
1973
  return _generateEKTextOfBasket(this, withoutPrices).OrderSets[0].SetOrderText;
1936
1974
  }
1975
+ }, {
1976
+ key: "getProductConfiguration",
1977
+ value: function getProductConfiguration(variantId) {
1978
+ var _this2 = this;
1979
+ var productConfiguration = {
1980
+ SetPlannerInfos: this.SetPlannerInfos,
1981
+ DivaNr: this.DivaNr,
1982
+ VariantID: variantId,
1983
+ OrderSets: this.OrderSets.map(function (set) {
1984
+ return {
1985
+ AccountGUID: set.AccountGUID,
1986
+ CatalogCodex: set.CatalogCodex,
1987
+ CatalogGUID: set.CatalogGUID,
1988
+ SetHash: set.SetHash,
1989
+ SetImage: set.SetImage,
1990
+ SetID: set.SetID,
1991
+ SetPlanData: set.SetPlanData,
1992
+ SupplierGUID: set.SupplierGUID,
1993
+ Favorites: set.Favorites,
1994
+ HQRenderScript: set.HQRenderScript,
1995
+ Diva3DProject: _this2.Diva3DProject,
1996
+ Variant: set.Variant,
1997
+ OrderLines: set.OrderLines.filter(function (ol) {
1998
+ return !ol.IsPartlistArticle;
1999
+ }).map(function (ol) {
2000
+ var _ol$CatalogCodex;
2001
+ return {
2002
+ ArticleCodex: ol.ArticleCodex,
2003
+ BasketID: ol.BasketID,
2004
+ CatalogCodex: (_ol$CatalogCodex = ol.CatalogCodex) !== null && _ol$CatalogCodex !== void 0 ? _ol$CatalogCodex : set.CatalogCodex,
2005
+ ElementID: ol.ElementID,
2006
+ PosNr: ol.PosNr,
2007
+ Quantity: ol.Quantity,
2008
+ NoPrice: ol.NoPrice ? true : undefined,
2009
+ RelatedToBasketID: ol.RelatedToBasketID,
2010
+ ShelfPlandata: ol.ShelfPlandata,
2011
+ ArticleHash: ol.getHash(),
2012
+ VariantBasketDatas: ol.getTinyVariantConfigurationDatas()
2013
+ };
2014
+ })
2015
+ };
2016
+ })
2017
+ };
2018
+ if (variantId !== undefined) {
2019
+ var _this$OrderSets$0$Con, _productConfiguration;
2020
+ var configVariant = (_this$OrderSets$0$Con = this.OrderSets[0].ConfigVariants) === null || _this$OrderSets$0$Con === void 0 ? void 0 : _this$OrderSets$0$Con.find(function (v) {
2021
+ return v.VariantID === variantId;
2022
+ });
2023
+ if (!configVariant) throw new Error('variantId ' + variantId + ' not found in basketData. Something went wrong');
2024
+ productConfiguration.OrderSets[0].Variant = configVariant.Variant;
2025
+ productConfiguration.OrderSets[0].Diva3DProject = configVariant.Diva3DProject;
2026
+ productConfiguration.OrderSets[0].Favorites = {
2027
+ VariantValues: {}
2028
+ };
2029
+ productConfiguration.OrderSets[0].SetHash = configVariant.SetHash;
2030
+ productConfiguration.OrderSets[0].SetPlanData = configVariant.SetPlanData;
2031
+ productConfiguration.OrderSets[0].EkCurrency = configVariant.EkCurrency;
2032
+ productConfiguration.OrderSets[0].EkSetPrice = configVariant.EkSetPrice;
2033
+ productConfiguration.OrderSets[0].HQRenderScript = configVariant.HQRenderScript;
2034
+ var ol = (_productConfiguration = productConfiguration.OrderSets[0].OrderLines) !== null && _productConfiguration !== void 0 ? _productConfiguration : [];
2035
+ ol.forEach(function (variantOrderline) {
2036
+ var _configVariant$SetVar, _olvd$VariantValues;
2037
+ var olvd = (_configVariant$SetVar = configVariant.SetVariantData) === null || _configVariant$SetVar === void 0 ? void 0 : _configVariant$SetVar[variantOrderline.BasketID];
2038
+ if (!olvd) throw new Error('BaksetId: ' + variantOrderline.BasketID + ' of oderlines not fount in configVariants for Variant: ' + variantId);
2039
+ (_olvd$VariantValues = olvd.VariantValues) === null || _olvd$VariantValues === void 0 || _olvd$VariantValues.forEach(function (variant) {
2040
+ var _variantOrderline$Var;
2041
+ var olVariant = (_variantOrderline$Var = variantOrderline.VariantBasketDatas) === null || _variantOrderline$Var === void 0 ? void 0 : _variantOrderline$Var.find(function (vb) {
2042
+ return vb.OPT === variant.OPT;
2043
+ });
2044
+ if (!olVariant && variant.OptionOCD) {
2045
+ var _variantOrderline$Var2;
2046
+ olVariant = (_variantOrderline$Var2 = variantOrderline.VariantBasketDatas) === null || _variantOrderline$Var2 === void 0 ? void 0 : _variantOrderline$Var2.find(function (vb) {
2047
+ return vb.OPT.endsWith(variant.OptionOCD.substring(3));
2048
+ });
2049
+ }
2050
+ if (olVariant) {
2051
+ olVariant.OPT = variant.OPT;
2052
+ olVariant.OPV = variant.OPV;
2053
+ }
2054
+ });
2055
+ });
2056
+ }
2057
+ return productConfiguration;
2058
+ }
1937
2059
  }]);
1938
2060
  }();
1939
2061
 
1940
2062
  //ArtkelVarianten der Favoriten Obsolet? weil sie bereits separat gespeichert werden
1941
- var ConfigVariantData = /*#__PURE__*/_createClass__default["default"](function ConfigVariantData(VariantID, SetName, SetName_locales, SetImage, hqRenderScript, Diva3DProject, VariantDescription, SetArticleNr, SetPrice, SetHash, SetQuantity, VariantBasketData, SetVariantData, Variant, SummaryInfo, SetPlanData, Set2DImage, BBox, BruttoSetPrice, EkSetPrice, EkCurrency, MetaData, MetaData_locales, VariantDescription_locales, SetOrderText, SetOrderText_locales) {
2063
+ var ConfigVariantData = /*#__PURE__*/_createClass__default["default"](function ConfigVariantData(VariantID, SetName, SetName_locales, SetImage, hqRenderScript, Diva3DProject, VariantDescription, SetArticleNr, SetPrice, SetHash, SetQuantity, VariantBasketDatas, SetVariantData, Variant, SummaryInfo, SetPlanData, Set2DImage, BBox, BruttoSetPrice, EkSetPrice, EkCurrency, MetaData, MetaData_locales, VariantDescription_locales, SetOrderText, SetOrderText_locales) {
1942
2064
  _classCallCheck__default["default"](this, ConfigVariantData);
1943
2065
  _defineProperty__default["default"](this, "VariantID", void 0);
1944
2066
  _defineProperty__default["default"](this, "SetName", void 0);
@@ -1978,7 +2100,7 @@ var ConfigVariantData = /*#__PURE__*/_createClass__default["default"](function C
1978
2100
  this.SetPrice = SetPrice;
1979
2101
  this.SetHash = SetHash;
1980
2102
  this.SetQuantity = SetQuantity;
1981
- this.VariantBasketDatas = VariantBasketData;
2103
+ this.VariantBasketDatas = VariantBasketDatas;
1982
2104
  this.SetVariantData = SetVariantData;
1983
2105
  this.Variant = Variant;
1984
2106
  this.SummaryInfo = SummaryInfo;
@@ -2164,8 +2286,8 @@ var Favorites = /*#__PURE__*/_createClass__default["default"](function Favorites
2164
2286
  _classCallCheck__default["default"](this, Favorites);
2165
2287
  _defineProperty__default["default"](this, "VariantValues", {});
2166
2288
  });
2167
- var Favorit = /*#__PURE__*/_createClass__default["default"](function Favorit(optionCodex, optionValueCodex, targetArticles, optionName, optionValueName, optionValueImage) {
2168
- _classCallCheck__default["default"](this, Favorit);
2289
+ var Favorite = /*#__PURE__*/_createClass__default["default"](function Favorite(optionCodex, optionValueCodex, targetArticles, optionName, optionValueName, optionValueImage) {
2290
+ _classCallCheck__default["default"](this, Favorite);
2169
2291
  _defineProperty__default["default"](this, "optionCodex", void 0);
2170
2292
  _defineProperty__default["default"](this, "targetArticles", void 0);
2171
2293
  _defineProperty__default["default"](this, "optionName", void 0);
@@ -2195,7 +2317,7 @@ var ProductOrderLine = /*#__PURE__*/_createClass__default["default"](function Pr
2195
2317
  exports.BasketData = BasketData;
2196
2318
  exports.CompactOrderLineData = CompactOrderLine;
2197
2319
  exports.ConfigVariantData = ConfigVariantData;
2198
- exports.Favorit = Favorit;
2320
+ exports.Favorite = Favorite;
2199
2321
  exports.Favorites = Favorites;
2200
2322
  exports.GroupData = GroupData;
2201
2323
  exports.GroupsData = GroupsData;