@crystaldesign/basket-model 24.12.0-beta.8 → 24.12.0-rc.0
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.
- package/build/cjs/index.js +231 -104
- package/build/esm/index.js +232 -105
- package/build/types/basket-model/src/BasketData.d.ts +5 -3
- package/build/types/basket-model/src/BasketData.d.ts.map +1 -1
- package/build/types/basket-model/src/ConfigVariantData.d.ts +1 -1
- package/build/types/basket-model/src/ConfigVariantData.d.ts.map +1 -1
- package/build/types/basket-model/src/Favorites.d.ts +2 -2
- package/build/types/basket-model/src/Favorites.d.ts.map +1 -1
- package/build/types/basket-model/src/OrderLine/OrderLineData.d.ts +4 -4
- package/build/types/basket-model/src/OrderLine/OrderLineData.d.ts.map +1 -1
- package/build/types/basket-model/src/OrderLine/VariantItemData.d.ts +1 -0
- package/build/types/basket-model/src/OrderLine/VariantItemData.d.ts.map +1 -1
- package/build/types/basket-model/src/OrderSetData.d.ts +5 -2
- package/build/types/basket-model/src/OrderSetData.d.ts.map +1 -1
- package/build/types/basket-model/src/index.d.ts +3 -2
- package/build/types/basket-model/src/index.d.ts.map +1 -1
- package/build/types/basket-model/src/types.d.ts +58 -0
- package/build/types/basket-model/src/types.d.ts.map +1 -0
- package/package.json +4 -7
package/build/cjs/index.js
CHANGED
|
@@ -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__*/
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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,46 @@ 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
|
+
OPTName: v.OPTName,
|
|
508
|
+
OPVName: v.OPVName,
|
|
509
|
+
OPVImage: v.OPVImage,
|
|
510
|
+
OptionOCD: v.OptionOCD,
|
|
511
|
+
IsDescribingState: v.IsDescribingState
|
|
512
|
+
};
|
|
513
|
+
})) !== 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) {
|
|
514
|
+
return v.MeasureValue || v.FreeText;
|
|
515
|
+
})) === null || _this$VariantBasketDa7 === void 0 ? void 0 : _this$VariantBasketDa7.map(function (v) {
|
|
516
|
+
var _ref2;
|
|
517
|
+
return {
|
|
518
|
+
OPT: v.OPT + '_val',
|
|
519
|
+
OPV: (_ref2 = v.MeasureValue || v.FreeText) === null || _ref2 === void 0 ? void 0 : _ref2.toString(),
|
|
520
|
+
OCD: v.OCD,
|
|
521
|
+
OPTName: v.OPTName,
|
|
522
|
+
OPVName: v.OPVName,
|
|
523
|
+
OptionOCD: v.OptionOCD,
|
|
524
|
+
IsDescribingState: v.IsDescribingState
|
|
525
|
+
};
|
|
526
|
+
})) !== null && _this$VariantBasketDa6 !== void 0 ? _this$VariantBasketDa6 : []));
|
|
527
|
+
}
|
|
483
528
|
}, {
|
|
484
529
|
key: "getAsJson",
|
|
485
530
|
value: function getAsJson() {
|
|
@@ -540,8 +585,6 @@ var OrderSetData = /*#__PURE__*/function () {
|
|
|
540
585
|
// EK-Text / wird beim Speichern Clientseitig nicht gefüllt
|
|
541
586
|
_defineProperty__default["default"](this, "SetOrderText_locales", void 0);
|
|
542
587
|
_defineProperty__default["default"](this, "OrderLines", []);
|
|
543
|
-
_defineProperty__default["default"](this, "MainPosNr", void 0);
|
|
544
|
-
// PosNr des Sets (Reihungsnummer)
|
|
545
588
|
_defineProperty__default["default"](this, "Description", void 0);
|
|
546
589
|
// Checkout
|
|
547
590
|
_defineProperty__default["default"](this, "UserSetDataString", void 0);
|
|
@@ -580,6 +623,7 @@ var OrderSetData = /*#__PURE__*/function () {
|
|
|
580
623
|
_defineProperty__default["default"](this, "CatalogListAccountGUID", void 0);
|
|
581
624
|
// get AccountGUID von der Kollektion
|
|
582
625
|
_defineProperty__default["default"](this, "ConfigVariants", void 0);
|
|
626
|
+
_defineProperty__default["default"](this, "TinyVariantConfiguration", void 0);
|
|
583
627
|
_defineProperty__default["default"](this, "Weight", void 0);
|
|
584
628
|
_defineProperty__default["default"](this, "WeightUnit", void 0);
|
|
585
629
|
_defineProperty__default["default"](this, "Volume", void 0);
|
|
@@ -599,6 +643,7 @@ var OrderSetData = /*#__PURE__*/function () {
|
|
|
599
643
|
_defineProperty__default["default"](this, "SupplierILN", void 0);
|
|
600
644
|
_defineProperty__default["default"](this, "SupplierCatalogName", void 0);
|
|
601
645
|
_defineProperty__default["default"](this, "Favorites", void 0);
|
|
646
|
+
_defineProperty__default["default"](this, "Variant", void 0);
|
|
602
647
|
_defineProperty__default["default"](this, "MetaData", void 0);
|
|
603
648
|
_defineProperty__default["default"](this, "MetaData_locales", void 0);
|
|
604
649
|
_defineProperty__default["default"](this, "AdditionalCatalogPrice", void 0);
|
|
@@ -626,6 +671,7 @@ var OrderSetData = /*#__PURE__*/function () {
|
|
|
626
671
|
this.SetOrderText_locales = json.SetOrderText_locales;
|
|
627
672
|
this.Set2DImage = json.Set2DImage;
|
|
628
673
|
this.Favorites = json.Favorites;
|
|
674
|
+
this.Variant = json.Variant;
|
|
629
675
|
this.ConfigVariants = json.ConfigVariants;
|
|
630
676
|
this.VariantDescription = json.VariantDescription;
|
|
631
677
|
this.VariantDescription_locales = json.VariantDescription_locales;
|
|
@@ -636,7 +682,6 @@ var OrderSetData = /*#__PURE__*/function () {
|
|
|
636
682
|
this.OrigZKATNr = json.OrigZKATNr && json.OrigZKATNr != '' ? json.OrigZKATNr : ZKATNr;
|
|
637
683
|
this.SetArticleNr = json.SetArticleNr && json.SetArticleNr != '' ? json.SetArticleNr : SetArticleNr;
|
|
638
684
|
this.SetArticleNrPrefix = json.SetArticleNrPrefix && json.SetArticleNrPrefix != '' ? json.SetArticleNrPrefix : SetArticleNrPrefix;
|
|
639
|
-
this.MainPosNr = json.MainPosNr;
|
|
640
685
|
this.Description = json.Description;
|
|
641
686
|
this.UserSetDataString = json.UserSetDataString;
|
|
642
687
|
this.BasketModelDesc = json.BasketModelDesc;
|
|
@@ -655,6 +700,7 @@ var OrderSetData = /*#__PURE__*/function () {
|
|
|
655
700
|
this.BruttoSetPrice = json.BruttoSetPrice;
|
|
656
701
|
this.CatalogLastUpdate = json.CatalogLastUpdate;
|
|
657
702
|
this.CatalogValidTo = json.CatalogValidTo;
|
|
703
|
+
this.TinyVariantConfiguration = json.TinyVariantConfiguration;
|
|
658
704
|
this.ModelCodex = json.ModelCodex;
|
|
659
705
|
this.ModelCatalogCodex = json.ModelCatalogCodex;
|
|
660
706
|
this.GroupType = json.GroupType;
|
|
@@ -1910,9 +1956,6 @@ var BasketData = /*#__PURE__*/function () {
|
|
|
1910
1956
|
key: "concatOrderSets",
|
|
1911
1957
|
value: function concatOrderSets(orderSets) {
|
|
1912
1958
|
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
1959
|
}
|
|
1917
1960
|
}, {
|
|
1918
1961
|
key: "convertToBaseConfiguration",
|
|
@@ -1934,11 +1977,95 @@ var BasketData = /*#__PURE__*/function () {
|
|
|
1934
1977
|
value: function getEKText(withoutPrices) {
|
|
1935
1978
|
return _generateEKTextOfBasket(this, withoutPrices).OrderSets[0].SetOrderText;
|
|
1936
1979
|
}
|
|
1980
|
+
}, {
|
|
1981
|
+
key: "getProductConfiguration",
|
|
1982
|
+
value: function getProductConfiguration(variantId) {
|
|
1983
|
+
var _this2 = this;
|
|
1984
|
+
var productConfiguration = {
|
|
1985
|
+
SetPlannerInfos: this.SetPlannerInfos,
|
|
1986
|
+
DivaNr: this.DivaNr,
|
|
1987
|
+
VariantID: variantId,
|
|
1988
|
+
OrderSets: this.OrderSets.map(function (set) {
|
|
1989
|
+
return {
|
|
1990
|
+
AccountGUID: set.AccountGUID,
|
|
1991
|
+
CatalogCodex: set.CatalogCodex,
|
|
1992
|
+
CatalogGUID: set.CatalogGUID,
|
|
1993
|
+
SetHash: set.SetHash,
|
|
1994
|
+
SetImage: set.SetImage,
|
|
1995
|
+
SetID: set.SetID,
|
|
1996
|
+
SetPlanData: set.SetPlanData,
|
|
1997
|
+
SupplierGUID: set.SupplierGUID,
|
|
1998
|
+
Favorites: set.Favorites,
|
|
1999
|
+
HQRenderScript: set.HQRenderScript,
|
|
2000
|
+
Diva3DProject: _this2.Diva3DProject,
|
|
2001
|
+
Variant: set.Variant,
|
|
2002
|
+
OrderLines: set.OrderLines.filter(function (ol) {
|
|
2003
|
+
return !ol.IsPartlistArticle;
|
|
2004
|
+
}).map(function (ol) {
|
|
2005
|
+
var _ol$CatalogCodex;
|
|
2006
|
+
return {
|
|
2007
|
+
ArticleCodex: ol.ArticleCodex,
|
|
2008
|
+
BasketID: ol.BasketID,
|
|
2009
|
+
CatalogCodex: (_ol$CatalogCodex = ol.CatalogCodex) !== null && _ol$CatalogCodex !== void 0 ? _ol$CatalogCodex : set.CatalogCodex,
|
|
2010
|
+
ElementID: ol.ElementID,
|
|
2011
|
+
PosNr: ol.PosNr,
|
|
2012
|
+
Quantity: ol.Quantity,
|
|
2013
|
+
NoPrice: ol.NoPrice ? true : undefined,
|
|
2014
|
+
RelatedToBasketID: ol.RelatedToBasketID,
|
|
2015
|
+
ShelfPlandata: ol.ShelfPlandata,
|
|
2016
|
+
ArticleHash: ol.getHash(),
|
|
2017
|
+
VariantBasketDatas: ol.getTinyVariantConfigurationDatas()
|
|
2018
|
+
};
|
|
2019
|
+
})
|
|
2020
|
+
};
|
|
2021
|
+
})
|
|
2022
|
+
};
|
|
2023
|
+
if (variantId !== undefined) {
|
|
2024
|
+
var _this$OrderSets$0$Con, _productConfiguration;
|
|
2025
|
+
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) {
|
|
2026
|
+
return v.VariantID === variantId;
|
|
2027
|
+
});
|
|
2028
|
+
if (!configVariant) throw new Error('variantId ' + variantId + ' not found in basketData. Something went wrong');
|
|
2029
|
+
productConfiguration.OrderSets[0].Variant = configVariant.Variant;
|
|
2030
|
+
productConfiguration.OrderSets[0].Diva3DProject = configVariant.Diva3DProject;
|
|
2031
|
+
productConfiguration.OrderSets[0].Favorites = {
|
|
2032
|
+
VariantValues: {}
|
|
2033
|
+
};
|
|
2034
|
+
productConfiguration.OrderSets[0].SetHash = configVariant.SetHash;
|
|
2035
|
+
productConfiguration.OrderSets[0].SetPlanData = configVariant.SetPlanData;
|
|
2036
|
+
productConfiguration.OrderSets[0].EkCurrency = configVariant.EkCurrency;
|
|
2037
|
+
productConfiguration.OrderSets[0].EkSetPrice = configVariant.EkSetPrice;
|
|
2038
|
+
productConfiguration.OrderSets[0].HQRenderScript = configVariant.HQRenderScript;
|
|
2039
|
+
var ol = (_productConfiguration = productConfiguration.OrderSets[0].OrderLines) !== null && _productConfiguration !== void 0 ? _productConfiguration : [];
|
|
2040
|
+
ol.forEach(function (variantOrderline) {
|
|
2041
|
+
var _configVariant$SetVar, _olvd$VariantValues;
|
|
2042
|
+
var olvd = (_configVariant$SetVar = configVariant.SetVariantData) === null || _configVariant$SetVar === void 0 ? void 0 : _configVariant$SetVar[variantOrderline.BasketID];
|
|
2043
|
+
if (!olvd) throw new Error('BaksetId: ' + variantOrderline.BasketID + ' of oderlines not fount in configVariants for Variant: ' + variantId);
|
|
2044
|
+
(_olvd$VariantValues = olvd.VariantValues) === null || _olvd$VariantValues === void 0 || _olvd$VariantValues.forEach(function (variant) {
|
|
2045
|
+
var _variantOrderline$Var;
|
|
2046
|
+
var olVariant = (_variantOrderline$Var = variantOrderline.VariantBasketDatas) === null || _variantOrderline$Var === void 0 ? void 0 : _variantOrderline$Var.find(function (vb) {
|
|
2047
|
+
return vb.OPT === variant.OPT;
|
|
2048
|
+
});
|
|
2049
|
+
if (!olVariant && variant.OptionOCD) {
|
|
2050
|
+
var _variantOrderline$Var2;
|
|
2051
|
+
olVariant = (_variantOrderline$Var2 = variantOrderline.VariantBasketDatas) === null || _variantOrderline$Var2 === void 0 ? void 0 : _variantOrderline$Var2.find(function (vb) {
|
|
2052
|
+
return vb.OPT.endsWith(variant.OptionOCD.substring(3));
|
|
2053
|
+
});
|
|
2054
|
+
}
|
|
2055
|
+
if (olVariant) {
|
|
2056
|
+
olVariant.OPT = variant.OPT;
|
|
2057
|
+
olVariant.OPV = variant.OPV;
|
|
2058
|
+
}
|
|
2059
|
+
});
|
|
2060
|
+
});
|
|
2061
|
+
}
|
|
2062
|
+
return productConfiguration;
|
|
2063
|
+
}
|
|
1937
2064
|
}]);
|
|
1938
2065
|
}();
|
|
1939
2066
|
|
|
1940
2067
|
//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,
|
|
2068
|
+
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
2069
|
_classCallCheck__default["default"](this, ConfigVariantData);
|
|
1943
2070
|
_defineProperty__default["default"](this, "VariantID", void 0);
|
|
1944
2071
|
_defineProperty__default["default"](this, "SetName", void 0);
|
|
@@ -1978,7 +2105,7 @@ var ConfigVariantData = /*#__PURE__*/_createClass__default["default"](function C
|
|
|
1978
2105
|
this.SetPrice = SetPrice;
|
|
1979
2106
|
this.SetHash = SetHash;
|
|
1980
2107
|
this.SetQuantity = SetQuantity;
|
|
1981
|
-
this.VariantBasketDatas =
|
|
2108
|
+
this.VariantBasketDatas = VariantBasketDatas;
|
|
1982
2109
|
this.SetVariantData = SetVariantData;
|
|
1983
2110
|
this.Variant = Variant;
|
|
1984
2111
|
this.SummaryInfo = SummaryInfo;
|
|
@@ -2164,8 +2291,8 @@ var Favorites = /*#__PURE__*/_createClass__default["default"](function Favorites
|
|
|
2164
2291
|
_classCallCheck__default["default"](this, Favorites);
|
|
2165
2292
|
_defineProperty__default["default"](this, "VariantValues", {});
|
|
2166
2293
|
});
|
|
2167
|
-
var
|
|
2168
|
-
_classCallCheck__default["default"](this,
|
|
2294
|
+
var Favorite = /*#__PURE__*/_createClass__default["default"](function Favorite(optionCodex, optionValueCodex, targetArticles, optionName, optionValueName, optionValueImage) {
|
|
2295
|
+
_classCallCheck__default["default"](this, Favorite);
|
|
2169
2296
|
_defineProperty__default["default"](this, "optionCodex", void 0);
|
|
2170
2297
|
_defineProperty__default["default"](this, "targetArticles", void 0);
|
|
2171
2298
|
_defineProperty__default["default"](this, "optionName", void 0);
|
|
@@ -2195,7 +2322,7 @@ var ProductOrderLine = /*#__PURE__*/_createClass__default["default"](function Pr
|
|
|
2195
2322
|
exports.BasketData = BasketData;
|
|
2196
2323
|
exports.CompactOrderLineData = CompactOrderLine;
|
|
2197
2324
|
exports.ConfigVariantData = ConfigVariantData;
|
|
2198
|
-
exports.
|
|
2325
|
+
exports.Favorite = Favorite;
|
|
2199
2326
|
exports.Favorites = Favorites;
|
|
2200
2327
|
exports.GroupData = GroupData;
|
|
2201
2328
|
exports.GroupsData = GroupsData;
|