@colijnit/ioneconnector 1.0.129 → 1.0.133
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/connector.js +4 -4
- package/build/connector.unit.test.js +55 -0
- package/build/factory/decorators/map-property.decorator.js +3 -0
- package/build/model/answer.d.ts +1 -0
- package/build/model/answer.js +1 -0
- package/build/model/article.d.ts +7 -1
- package/build/model/article.js +15 -1
- package/build/model/selection.d.ts +9 -0
- package/build/model/selection.js +5 -0
- package/build/model/selector-article.d.ts +63 -0
- package/build/model/selector-article.js +101 -0
- package/build/provider/data-repository.service.d.ts +23 -23
- package/build/provider/data-repository.service.js +19 -7
- package/build/service/hd-data.service.js +17 -6
- package/build/tests/int/connector-auth.int.test.js +7 -1
- package/package.json +14 -5
package/build/connector.js
CHANGED
|
@@ -424,13 +424,13 @@ class Connector {
|
|
|
424
424
|
});
|
|
425
425
|
}
|
|
426
426
|
getJsonConfiguredArticles(configuratorStatistics) {
|
|
427
|
-
return new Promise((resolve) => {
|
|
427
|
+
return new Promise((resolve, reject) => {
|
|
428
428
|
this.connection.getFrozenArticle(configuratorStatistics)
|
|
429
429
|
.then((result) => {
|
|
430
|
-
resolve(JSON.stringify(
|
|
430
|
+
resolve(JSON.stringify(result));
|
|
431
431
|
})
|
|
432
|
-
.catch((
|
|
433
|
-
|
|
432
|
+
.catch((e) => {
|
|
433
|
+
reject(e);
|
|
434
434
|
});
|
|
435
435
|
});
|
|
436
436
|
}
|
|
@@ -3,6 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const connector_1 = require("./connector");
|
|
4
4
|
const selection_1 = require("./model/selection");
|
|
5
5
|
const node_type_enum_1 = require("./enum/node-type.enum");
|
|
6
|
+
const selector_article_1 = require("./model/selector-article");
|
|
7
|
+
const business_object_factory_1 = require("./service/business-object-factory");
|
|
8
|
+
const map_property_decorator_1 = require("./factory/decorators/map-property.decorator");
|
|
6
9
|
const options = {
|
|
7
10
|
url: 'http'
|
|
8
11
|
};
|
|
@@ -11,6 +14,58 @@ describe("Connector", () => {
|
|
|
11
14
|
beforeEach(() => {
|
|
12
15
|
connector = new connector_1.Connector(options);
|
|
13
16
|
});
|
|
17
|
+
it('checkMapProperty', () => {
|
|
18
|
+
const raw = {
|
|
19
|
+
"compositionGoodId": 28847372,
|
|
20
|
+
"sequence": 1,
|
|
21
|
+
"articleNr": "1000561899",
|
|
22
|
+
"mutationPrice": 0,
|
|
23
|
+
"salesPrice": 719.94,
|
|
24
|
+
"CompositeArticleNo": "1000561898",
|
|
25
|
+
"currencyCodePurchase": "EUR",
|
|
26
|
+
"selectorMaxNodeId": 136,
|
|
27
|
+
"CompositeDescription": "Elixir Modular Sofa",
|
|
28
|
+
"excluded": false,
|
|
29
|
+
"articleNoSupplier": "111",
|
|
30
|
+
"barcode": "1234567893341",
|
|
31
|
+
"freeInputConfigurationText": "Stofkeuze: Stof River, Stof Gr1 River Sand-2;\nGuardsmen 5 Year protection plan: Yes;\nLeft element: Elixir 1 Seater Modular Unit with LHF Arm, ;\nStofkeuze: Stof Bready, Stof Gr1 Bready Antracite;\nRecliner: Overslaan;\nFoot options: Metal;\nGuardsmen 5 Year protection plan: Yes;\nLeft middle element: Elixir 1 Seater Armless Modular Unit, ;\nStofkeuze: Stof Bready, Stof Gr1 Bready Antracite;\nRecliner: Overslaan;\nFoot options: Metal;\nGuardsmen 5 Year protection plan: Yes;\nCorner element: Elixir Corner Unit, ;\nStofkeuze: Stof Bready, Stof Gr1 Bready Antracite;\nRecliner: Overslaan;\nFoot options: Metal;\nGuardsmen 5 Year protection plan: Yes;\nRight middle element: Elixir 1.5 Seater Modular Unit , ;\nStofkeuze: Stof Bready, Stof Gr1 Bready Antracite;\nRecliner: Overslaan;\nFoot options: Metal;\nGuardsmen 5 Year protection plan: Yes;\nRight element: Elixir 1 Seater Modular Unit with RHF Arm, ;\nStofkeuze: Stof Bready, Stof Gr1 Bready Antracite;\nRecliner: Overslaan;\nFoot options: Metal;\nGuardsmen 5 Year protection plan: Yes",
|
|
32
|
+
"standardDeliveryTimePurchase": 12,
|
|
33
|
+
"selectorMinNodeId": 3,
|
|
34
|
+
"representedArticle": true,
|
|
35
|
+
"goodId": 28847377,
|
|
36
|
+
"suggestedPrice": 1500,
|
|
37
|
+
"isFreeCommissionCode": true,
|
|
38
|
+
"purchaseDescription": "Elixir Modular Sofa",
|
|
39
|
+
"pricelistCode": "x106",
|
|
40
|
+
"descriptionEditable": true,
|
|
41
|
+
"isStockArticle": false,
|
|
42
|
+
"configurationText": "Stofkeuze: Stof River, Stof Gr1 River Sand-2;\nGuardsmen 5 Year protection plan: Yes;\nLeft element: Elixir 1 Seater Modular Unit with LHF Arm;\nStofkeuze: Stof Bready, Stof Gr1 Bready Antracite;\nFoot options: Metal;\nGuardsmen 5 Year protection plan: Yes;\nLeft middle element: Elixir 1 Seater Armless Modular Unit;\nStofkeuze: Stof Bready, Stof Gr1 Bready Antracite;\nFoot options: Metal;\nGuardsmen 5 Year protection plan: Yes;\nCorner element: Elixir Corner Unit;\nStofkeuze: Stof Bready, Stof Gr1 Bready Antracite;\nFoot options: Metal;\nGuardsmen 5 Year protection plan: Yes;\nRight middle element: Elixir 1.5 Seater Modular Unit ;\nStofkeuze: Stof Bready, Stof Gr1 Bready Antracite;\nFoot options: Metal;\nGuardsmen 5 Year protection plan: Yes;\nRight element: Elixir 1 Seater Modular Unit with RHF Arm;\nStofkeuze: Stof Bready, Stof Gr1 Bready Antracite;\nFoot options: Metal;\nGuardsmen 5 Year protection plan: Yes",
|
|
43
|
+
"isLocationArticle": true,
|
|
44
|
+
"CompositeSupplementDescription": "Dit is een aanvullende omschrijving",
|
|
45
|
+
"turnOverGroup": "232",
|
|
46
|
+
"amount": 1,
|
|
47
|
+
"articleDescription": "Elixir Modular Sofa",
|
|
48
|
+
"hashCodeID": "FA19520ECA88BB8AEAC1D6CF80EBF9B944CE9F03",
|
|
49
|
+
"hashCodeEAN": "859451B4B79CF782C6CBB8F1B4161B48D9632782",
|
|
50
|
+
"freePrice": true,
|
|
51
|
+
"goodType": "E",
|
|
52
|
+
"vatCodePurchase": 1,
|
|
53
|
+
"inOutCollection": "IN",
|
|
54
|
+
"selectorMinArtSeq": 1,
|
|
55
|
+
"VatCode": 3,
|
|
56
|
+
"articleSupplementDescription": "Dit is een aanvullende omschrijving",
|
|
57
|
+
"combined": true,
|
|
58
|
+
"currencyCode": "EUR",
|
|
59
|
+
"branchNo": "1"
|
|
60
|
+
};
|
|
61
|
+
const boFactory = new business_object_factory_1.BusinessObjectFactory();
|
|
62
|
+
const article = boFactory.makeWithRawBackendData(selector_article_1.SelectorArticle, raw);
|
|
63
|
+
expect(article.compositionArticleNo).toBeDefined();
|
|
64
|
+
});
|
|
65
|
+
it('checkMapDecorator', () => {
|
|
66
|
+
const isMap = map_property_decorator_1.MapPropertyDecorator.IsMapProperty(selector_article_1.SelectorArticle.prototype, 'CompositeArticleNo');
|
|
67
|
+
expect(isMap).toBeTruthy();
|
|
68
|
+
});
|
|
14
69
|
it('getSelectionsToDisplay_shouldHideSelectionIfParentPublicationCodeIsNull', () => {
|
|
15
70
|
const question = new selection_1.Selection();
|
|
16
71
|
question.presentationLevel = 1;
|
package/build/model/answer.d.ts
CHANGED
package/build/model/answer.js
CHANGED
|
@@ -51,6 +51,7 @@ class Answer extends business_object_1.BusinessObject {
|
|
|
51
51
|
this.parentArticleDecoId = null;
|
|
52
52
|
this.useNextCombNode = false;
|
|
53
53
|
this.treeLevel = null;
|
|
54
|
+
this.nodeLinkedText = null;
|
|
54
55
|
this.isGroupHeader = false;
|
|
55
56
|
}
|
|
56
57
|
_customPostProcessSelfFromRawData(rawData, nodeHierarchyLevelOffset = 0) {
|
package/build/model/article.d.ts
CHANGED
|
@@ -4,11 +4,14 @@ import { HdecoPlacement } from "../enum/hdeco-placement.enum";
|
|
|
4
4
|
import { HdecoPositioning } from "../enum/hdeco-positioning.enum";
|
|
5
5
|
export declare class Article extends BusinessObject {
|
|
6
6
|
assetUrl: string;
|
|
7
|
+
connectors: any[];
|
|
8
|
+
contentDeliveryUrl: string;
|
|
7
9
|
description: string;
|
|
8
10
|
extraDescription: string;
|
|
9
|
-
contentDeliveryUrl: string;
|
|
10
11
|
threeDObjectName: string;
|
|
12
|
+
hdObjectName: string;
|
|
11
13
|
id: string;
|
|
14
|
+
fromPrice: number;
|
|
12
15
|
goodType: string;
|
|
13
16
|
distId: string;
|
|
14
17
|
distSchema: string;
|
|
@@ -16,12 +19,15 @@ export declare class Article extends BusinessObject {
|
|
|
16
19
|
composition: boolean;
|
|
17
20
|
name: string;
|
|
18
21
|
price: number;
|
|
22
|
+
recprice: number;
|
|
23
|
+
pdescription: string;
|
|
19
24
|
relatedArticles: any[];
|
|
20
25
|
rendersAvailable: boolean;
|
|
21
26
|
texts: any[];
|
|
22
27
|
defaultHeight: number;
|
|
23
28
|
defaultHeightAdjustable: boolean;
|
|
24
29
|
positioning: HdecoPositioning;
|
|
30
|
+
type: string;
|
|
25
31
|
placement: HdecoPlacement;
|
|
26
32
|
canRotate: number;
|
|
27
33
|
stackable: boolean;
|
package/build/model/article.js
CHANGED
|
@@ -20,11 +20,14 @@ class Article extends business_object_1.BusinessObject {
|
|
|
20
20
|
constructor(rawData = {}) {
|
|
21
21
|
super();
|
|
22
22
|
this.assetUrl = null;
|
|
23
|
+
this.connectors = [];
|
|
24
|
+
this.contentDeliveryUrl = null;
|
|
23
25
|
this.description = null;
|
|
24
26
|
this.extraDescription = null;
|
|
25
|
-
this.contentDeliveryUrl = null;
|
|
26
27
|
this.threeDObjectName = null;
|
|
28
|
+
this.hdObjectName = null;
|
|
27
29
|
this.id = null;
|
|
30
|
+
this.fromPrice = null;
|
|
28
31
|
this.goodType = null;
|
|
29
32
|
this.distId = null;
|
|
30
33
|
this.distSchema = null;
|
|
@@ -32,12 +35,15 @@ class Article extends business_object_1.BusinessObject {
|
|
|
32
35
|
this.composition = null;
|
|
33
36
|
this.name = null;
|
|
34
37
|
this.price = null;
|
|
38
|
+
this.recprice = null;
|
|
39
|
+
this.pdescription = null;
|
|
35
40
|
this.relatedArticles = [];
|
|
36
41
|
this.rendersAvailable = null;
|
|
37
42
|
this.texts = [];
|
|
38
43
|
this.defaultHeight = null;
|
|
39
44
|
this.defaultHeightAdjustable = null;
|
|
40
45
|
this.positioning = null;
|
|
46
|
+
this.type = null;
|
|
41
47
|
this.placement = null;
|
|
42
48
|
this.canRotate = null;
|
|
43
49
|
this.stackable = null;
|
|
@@ -65,6 +71,10 @@ __decorate([
|
|
|
65
71
|
map_property_decorator_1.MapProperty("gameObjectName"),
|
|
66
72
|
__metadata("design:type", String)
|
|
67
73
|
], Article.prototype, "threeDObjectName", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
map_property_decorator_1.MapProperty("hdecoGameObject"),
|
|
76
|
+
__metadata("design:type", String)
|
|
77
|
+
], Article.prototype, "hdObjectName", void 0);
|
|
68
78
|
__decorate([
|
|
69
79
|
map_property_decorator_1.MapProperty("goodId"),
|
|
70
80
|
__metadata("design:type", String)
|
|
@@ -96,6 +106,10 @@ __decorate([
|
|
|
96
106
|
map_property_decorator_1.MapProperty("hdecoPositioning"),
|
|
97
107
|
__metadata("design:type", String)
|
|
98
108
|
], Article.prototype, "positioning", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
map_property_decorator_1.MapProperty("hdecoType"),
|
|
111
|
+
__metadata("design:type", String)
|
|
112
|
+
], Article.prototype, "type", void 0);
|
|
99
113
|
__decorate([
|
|
100
114
|
map_property_decorator_1.MapProperty("homePlacement"),
|
|
101
115
|
__metadata("design:type", Number)
|
|
@@ -9,11 +9,15 @@ export declare class Selection extends BusinessObject {
|
|
|
9
9
|
assetUrl: string;
|
|
10
10
|
amountInComposition: number;
|
|
11
11
|
artSelGoodId: number;
|
|
12
|
+
artCostPrice: number;
|
|
12
13
|
artMountingPrice: number;
|
|
14
|
+
artOptId: number;
|
|
13
15
|
artSelSeq: number;
|
|
14
16
|
brandId: string;
|
|
17
|
+
totalCostPrice: number;
|
|
15
18
|
totalMountingPrice: number;
|
|
16
19
|
articleDescription: string;
|
|
20
|
+
articleNumber: string;
|
|
17
21
|
colorCodeString: string;
|
|
18
22
|
connectorArticle: string;
|
|
19
23
|
defaultNumber: any;
|
|
@@ -25,6 +29,10 @@ export declare class Selection extends BusinessObject {
|
|
|
25
29
|
gameObject: string;
|
|
26
30
|
imgUrl: string;
|
|
27
31
|
inquireNbrMode: string;
|
|
32
|
+
referenceArticle: string;
|
|
33
|
+
referenceNode: string;
|
|
34
|
+
weightArticle: number;
|
|
35
|
+
weightNode: number;
|
|
28
36
|
hashCheck: boolean;
|
|
29
37
|
nodeId: number;
|
|
30
38
|
colors: any[];
|
|
@@ -87,6 +95,7 @@ export declare class Selection extends BusinessObject {
|
|
|
87
95
|
hdecoType: string;
|
|
88
96
|
hdecoPositioning: HdecoPositioning;
|
|
89
97
|
supplierArticleNr: string;
|
|
98
|
+
supplierArticleNrNode: string;
|
|
90
99
|
tagArrayOpt: Tag[];
|
|
91
100
|
optCategory: string;
|
|
92
101
|
opvCategory: string;
|
package/build/model/selection.js
CHANGED
|
@@ -61,6 +61,7 @@ class Selection extends business_object_1.BusinessObject {
|
|
|
61
61
|
this.hdecoType = null;
|
|
62
62
|
this.hdecoPositioning = null;
|
|
63
63
|
this.supplierArticleNr = null;
|
|
64
|
+
this.supplierArticleNrNode = null;
|
|
64
65
|
this.tagArrayOpt = [];
|
|
65
66
|
this.setOwnMappedPropsFromRawData(rawData);
|
|
66
67
|
}
|
|
@@ -180,6 +181,10 @@ __decorate([
|
|
|
180
181
|
map_property_decorator_1.MapProperty("supplierArticleNo"),
|
|
181
182
|
__metadata("design:type", String)
|
|
182
183
|
], Selection.prototype, "supplierArticleNr", void 0);
|
|
184
|
+
__decorate([
|
|
185
|
+
map_property_decorator_1.MapProperty("supplierArticleNoNode"),
|
|
186
|
+
__metadata("design:type", String)
|
|
187
|
+
], Selection.prototype, "supplierArticleNrNode", void 0);
|
|
183
188
|
__decorate([
|
|
184
189
|
json_decorator_1.JsonField(),
|
|
185
190
|
complex_array_decorator_1.ComplexArray(tag_1.Tag),
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { BusinessObject } from "./business-object";
|
|
2
|
+
export declare class SelectorArticle extends BusinessObject {
|
|
3
|
+
compositionGoodId: number;
|
|
4
|
+
compositionArticleNo: string;
|
|
5
|
+
compositionDescription: string;
|
|
6
|
+
compositionSupplementDescription: string;
|
|
7
|
+
compositionArticleName: string;
|
|
8
|
+
sequence: string;
|
|
9
|
+
goodId: number;
|
|
10
|
+
articleNr: string;
|
|
11
|
+
articleDescription: string;
|
|
12
|
+
articleSupplementDescription: string;
|
|
13
|
+
articleName: string;
|
|
14
|
+
amount: number;
|
|
15
|
+
salesPrice: number;
|
|
16
|
+
mutationPrice: number;
|
|
17
|
+
suggestedPrice: number;
|
|
18
|
+
vatCode: number;
|
|
19
|
+
currencyCode: string;
|
|
20
|
+
currencyCodePurchase: string;
|
|
21
|
+
pricelistCode: string;
|
|
22
|
+
branchNo: string;
|
|
23
|
+
configurationText: string;
|
|
24
|
+
partGoodId: number;
|
|
25
|
+
selectorMinNodeId: number;
|
|
26
|
+
selectorMaxNodeId: number;
|
|
27
|
+
selectorMinArtSeq: number;
|
|
28
|
+
representedArticle: boolean;
|
|
29
|
+
excluded: boolean;
|
|
30
|
+
isStockArticle: boolean;
|
|
31
|
+
isLocationArticle: boolean;
|
|
32
|
+
purchaseDescription: string;
|
|
33
|
+
shippingCost: number;
|
|
34
|
+
customsCost: number;
|
|
35
|
+
portCost: number;
|
|
36
|
+
additionalCost: number;
|
|
37
|
+
productionCost: number;
|
|
38
|
+
shippingCurrency: string;
|
|
39
|
+
currencyCodeCustoms: string;
|
|
40
|
+
portCurrency: string;
|
|
41
|
+
additionalCurrency: string;
|
|
42
|
+
productionCurrency: string;
|
|
43
|
+
articleNoSupplier: string;
|
|
44
|
+
barcode: string;
|
|
45
|
+
hashCodeEAN: string;
|
|
46
|
+
standardDeliveryTimeSales: number;
|
|
47
|
+
standardDeliveryTimePurchase: number;
|
|
48
|
+
unitIdSales: string;
|
|
49
|
+
unitIdPurchase: string;
|
|
50
|
+
standardCommissionCode: boolean;
|
|
51
|
+
isFreeCommissionCode: boolean;
|
|
52
|
+
inOutCollection: string;
|
|
53
|
+
superArtId: string;
|
|
54
|
+
turnOverGroup: string;
|
|
55
|
+
freeInputConfigurationText: string;
|
|
56
|
+
freePrice: boolean;
|
|
57
|
+
descriptionEditable: boolean;
|
|
58
|
+
hashCodeID: string;
|
|
59
|
+
vatCodePurchase: number;
|
|
60
|
+
goodType: string;
|
|
61
|
+
combined: boolean;
|
|
62
|
+
weight: number;
|
|
63
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const business_object_1 = require("./business-object");
|
|
13
|
+
const boolean_decorator_1 = require("../factory/decorators/boolean.decorator");
|
|
14
|
+
const map_property_decorator_1 = require("../factory/decorators/map-property.decorator");
|
|
15
|
+
class SelectorArticle extends business_object_1.BusinessObject {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.compositionGoodId = null;
|
|
19
|
+
this.compositionArticleNo = null;
|
|
20
|
+
this.compositionDescription = null;
|
|
21
|
+
this.compositionSupplementDescription = null;
|
|
22
|
+
this.compositionArticleName = null;
|
|
23
|
+
this.sequence = null;
|
|
24
|
+
this.articleNr = null;
|
|
25
|
+
this.mutationPrice = null;
|
|
26
|
+
this.vatCode = null;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
__decorate([
|
|
30
|
+
map_property_decorator_1.MapProperty("CompositeGoodId"),
|
|
31
|
+
__metadata("design:type", Number)
|
|
32
|
+
], SelectorArticle.prototype, "compositionGoodId", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
map_property_decorator_1.MapProperty("CompositeArticleNo"),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], SelectorArticle.prototype, "compositionArticleNo", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
map_property_decorator_1.MapProperty("CompositeDescription"),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], SelectorArticle.prototype, "compositionDescription", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
map_property_decorator_1.MapProperty("CompositeSupplementDescription"),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], SelectorArticle.prototype, "compositionSupplementDescription", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
map_property_decorator_1.MapProperty("CompositeArticleName"),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], SelectorArticle.prototype, "compositionArticleName", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
map_property_decorator_1.MapProperty("CompositeSeqenceNo"),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], SelectorArticle.prototype, "sequence", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
map_property_decorator_1.MapProperty("articleNo"),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], SelectorArticle.prototype, "articleNr", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
map_property_decorator_1.MapProperty("surcharcheReductionPriceSales"),
|
|
59
|
+
__metadata("design:type", Number)
|
|
60
|
+
], SelectorArticle.prototype, "mutationPrice", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
map_property_decorator_1.MapProperty("VatCode"),
|
|
63
|
+
__metadata("design:type", Number)
|
|
64
|
+
], SelectorArticle.prototype, "vatCode", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
boolean_decorator_1.BooleanText('T'),
|
|
67
|
+
__metadata("design:type", Boolean)
|
|
68
|
+
], SelectorArticle.prototype, "representedArticle", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
boolean_decorator_1.BooleanText('T'),
|
|
71
|
+
__metadata("design:type", Boolean)
|
|
72
|
+
], SelectorArticle.prototype, "excluded", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
boolean_decorator_1.BooleanText('T'),
|
|
75
|
+
__metadata("design:type", Boolean)
|
|
76
|
+
], SelectorArticle.prototype, "isStockArticle", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
boolean_decorator_1.BooleanText('T'),
|
|
79
|
+
__metadata("design:type", Boolean)
|
|
80
|
+
], SelectorArticle.prototype, "isLocationArticle", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
boolean_decorator_1.BooleanText('T'),
|
|
83
|
+
__metadata("design:type", Boolean)
|
|
84
|
+
], SelectorArticle.prototype, "standardCommissionCode", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
boolean_decorator_1.BooleanText('T'),
|
|
87
|
+
__metadata("design:type", Boolean)
|
|
88
|
+
], SelectorArticle.prototype, "isFreeCommissionCode", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
boolean_decorator_1.BooleanText('T'),
|
|
91
|
+
__metadata("design:type", Boolean)
|
|
92
|
+
], SelectorArticle.prototype, "freePrice", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
boolean_decorator_1.BooleanText('T'),
|
|
95
|
+
__metadata("design:type", Boolean)
|
|
96
|
+
], SelectorArticle.prototype, "descriptionEditable", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
boolean_decorator_1.BooleanText('T'),
|
|
99
|
+
__metadata("design:type", Boolean)
|
|
100
|
+
], SelectorArticle.prototype, "combined", void 0);
|
|
101
|
+
exports.SelectorArticle = SelectorArticle;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { Article } from
|
|
2
|
-
import { Options } from
|
|
3
|
-
import { ExternalStorage } from
|
|
4
|
-
import { ArticleListObjectExtended } from
|
|
5
|
-
import { GetArticlesForCatalogRequest } from
|
|
6
|
-
import { DataServiceResponseRoot } from
|
|
7
|
-
import { PagingParameters } from
|
|
8
|
-
import { BaseBackendConnectionService } from
|
|
9
|
-
import { Subject } from
|
|
10
|
-
import { ArticleCategory } from
|
|
11
|
-
import { ArticleGroupImage } from
|
|
12
|
-
import { TurnoverGroupImage } from
|
|
13
|
-
import { SuperArticleImage } from
|
|
14
|
-
import { Tag } from
|
|
15
|
-
import { Color } from
|
|
16
|
-
import { Design } from
|
|
17
|
-
import { Material } from
|
|
18
|
-
import { Brand } from
|
|
19
|
-
import { Catalog } from
|
|
20
|
-
import { Atmosphere } from
|
|
21
|
-
import { ArticlePrice } from
|
|
22
|
-
import { ArticleFullObject } from
|
|
23
|
-
import { Session } from
|
|
1
|
+
import { Article } from "../model/article";
|
|
2
|
+
import { Options } from "../model/options";
|
|
3
|
+
import { ExternalStorage } from "../model/external-storage";
|
|
4
|
+
import { ArticleListObjectExtended } from "../model/article-list-object-extended";
|
|
5
|
+
import { GetArticlesForCatalogRequest } from "../model/get-articles-for-catalog";
|
|
6
|
+
import { DataServiceResponseRoot } from "../model/data-service-response-root";
|
|
7
|
+
import { PagingParameters } from "../model/paging-parameters";
|
|
8
|
+
import { BaseBackendConnectionService } from "./base-backend-connection.service";
|
|
9
|
+
import { Subject } from "rxjs";
|
|
10
|
+
import { ArticleCategory } from "../model/article-category";
|
|
11
|
+
import { ArticleGroupImage } from "../model/article-group-image";
|
|
12
|
+
import { TurnoverGroupImage } from "../model/turnover-group-image";
|
|
13
|
+
import { SuperArticleImage } from "../model/super-article-image";
|
|
14
|
+
import { Tag } from "../model/tag";
|
|
15
|
+
import { Color } from "../model/color";
|
|
16
|
+
import { Design } from "../model/design";
|
|
17
|
+
import { Material } from "../model/material";
|
|
18
|
+
import { Brand } from "../model/brand";
|
|
19
|
+
import { Catalog } from "../catalog";
|
|
20
|
+
import { Atmosphere } from "../model/atmosphere";
|
|
21
|
+
import { ArticlePrice } from "../model/article-price";
|
|
22
|
+
import { ArticleFullObject } from "../model/article-full-object";
|
|
23
|
+
import { Session } from "../model/session";
|
|
24
24
|
import { SkipButtonInfo } from "../model/skip-button-info";
|
|
25
25
|
import { SuperArticle } from "../model/super-article";
|
|
26
26
|
import { Concept } from "../model/concept";
|
|
@@ -50,6 +50,9 @@ const skip_button_info_1 = require("../model/skip-button-info");
|
|
|
50
50
|
const super_article_1 = require("../model/super-article");
|
|
51
51
|
const article_group_1 = require("../model/article-group");
|
|
52
52
|
const article_extended_dto_1 = require("../model/article-extended-dto");
|
|
53
|
+
const frozen_article_1 = require("../model/frozen-article");
|
|
54
|
+
const frozen_article_simple_1 = require("../model/frozen-article-simple");
|
|
55
|
+
const selector_article_1 = require("../model/selector-article");
|
|
53
56
|
class DataRepositoryService {
|
|
54
57
|
constructor(url, branchNr, currencyId, useGroups, options, session = undefined, externalStorage = undefined) {
|
|
55
58
|
this.showLoader = new rxjs_1.Subject();
|
|
@@ -125,19 +128,28 @@ class DataRepositoryService {
|
|
|
125
128
|
return this.callGenerateFrozenArticle(configuratorStatistics)
|
|
126
129
|
.then((result) => {
|
|
127
130
|
if (result.data.validationResult && result.data.validationResult.success === true) {
|
|
128
|
-
return this.callGetFrozenArticleArray().then((
|
|
129
|
-
if (
|
|
130
|
-
|
|
131
|
+
return this.callGetFrozenArticleArray().then((frozenResult) => {
|
|
132
|
+
if (frozenResult && frozenResult.data.validationResult && frozenResult.data.validationResult.success) {
|
|
133
|
+
const rawArray = frozenResult.data.resultObject;
|
|
134
|
+
const articles = this.boFactory.makeBOArrayFromRawBackendDataArray(selector_article_1.SelectorArticle, rawArray);
|
|
135
|
+
const composedArticle = !!articles[0].compositionArticleNo;
|
|
136
|
+
let frozenart;
|
|
137
|
+
if (composedArticle) {
|
|
138
|
+
frozenart = new frozen_article_1.FrozenArticle(articles[0]);
|
|
139
|
+
frozenart.compositions.push(articles);
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
frozenart = new frozen_article_simple_1.FrozenArticleSimple(articles[0]);
|
|
143
|
+
}
|
|
144
|
+
resolve(frozenart);
|
|
131
145
|
}
|
|
132
146
|
else {
|
|
133
|
-
|
|
134
|
-
reject("Error creating article");
|
|
147
|
+
reject(frozenResult);
|
|
135
148
|
}
|
|
136
149
|
});
|
|
137
150
|
}
|
|
138
151
|
else {
|
|
139
|
-
|
|
140
|
-
reject("Error creating article");
|
|
152
|
+
return reject(result);
|
|
141
153
|
}
|
|
142
154
|
})
|
|
143
155
|
.catch((e) => {
|
|
@@ -29,6 +29,9 @@ const material_1 = require("../model/material");
|
|
|
29
29
|
const atmosphere_1 = require("../model/atmosphere");
|
|
30
30
|
const article_group_1 = require("../model/article-group");
|
|
31
31
|
const article_extended_dto_1 = require("../model/article-extended-dto");
|
|
32
|
+
const frozen_article_1 = require("../model/frozen-article");
|
|
33
|
+
const frozen_article_simple_1 = require("../model/frozen-article-simple");
|
|
34
|
+
const selector_article_1 = require("../model/selector-article");
|
|
32
35
|
class HdDataService {
|
|
33
36
|
constructor(sessionService, boFactory, options) {
|
|
34
37
|
this._useGroups = false;
|
|
@@ -118,19 +121,27 @@ class HdDataService {
|
|
|
118
121
|
.catch((e) => {
|
|
119
122
|
return Promise.reject(e);
|
|
120
123
|
});
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
+
if (response && response.data && response.data.validationResult && response.data.validationResult.success) {
|
|
125
|
+
const articles = this._boFactory.makeBOArrayFromRawBackendDataArray(selector_article_1.SelectorArticle, response.data.resultObject);
|
|
126
|
+
const composedArticle = !!articles[0].compositionArticleNo;
|
|
127
|
+
let frozenart;
|
|
128
|
+
if (composedArticle) {
|
|
129
|
+
frozenart = new frozen_article_1.FrozenArticle(articles[0]);
|
|
130
|
+
frozenart.compositions.push(articles);
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
frozenart = new frozen_article_simple_1.FrozenArticleSimple(articles[0]);
|
|
134
|
+
}
|
|
135
|
+
return frozenart;
|
|
124
136
|
}
|
|
125
137
|
else {
|
|
126
|
-
|
|
127
|
-
return null;
|
|
138
|
+
return Promise.reject(response);
|
|
128
139
|
}
|
|
129
140
|
});
|
|
130
141
|
}
|
|
131
142
|
getJsonArticleFlatTree(goodId) {
|
|
132
143
|
return __awaiter(this, void 0, void 0, function* () {
|
|
133
|
-
const params = {
|
|
144
|
+
const params = { goodId: goodId };
|
|
134
145
|
const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
|
|
135
146
|
const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.GetArticleTree, data)
|
|
136
147
|
.catch((e) => {
|
|
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
const connector_auth_1 = require("../../connector-auth");
|
|
13
13
|
const paging_parameters_1 = require("../../model/paging-parameters");
|
|
14
14
|
const internal_param_enum_1 = require("../../enum/internal-param.enum");
|
|
15
|
-
|
|
15
|
+
const options = {
|
|
16
16
|
url: 'http://localhost:8080/ione',
|
|
17
17
|
schema: '815',
|
|
18
18
|
version: "251",
|
|
@@ -39,6 +39,12 @@ describe("ConnectorAuth", () => {
|
|
|
39
39
|
expect(article.id).toBe(772);
|
|
40
40
|
});
|
|
41
41
|
});
|
|
42
|
+
it('getFrozenArticle', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
43
|
+
yield connector.initNodeInstance(7497142);
|
|
44
|
+
return connector.getFrozenArticle().then((result) => {
|
|
45
|
+
expect(result.validationResult.succsss).toBeTruthy();
|
|
46
|
+
});
|
|
47
|
+
}));
|
|
42
48
|
it('getSelections', () => {
|
|
43
49
|
return connector.getSelections().then((data) => {
|
|
44
50
|
expect(data).toBe([]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@colijnit/ioneconnector",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.133",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "grunt clean && tsc",
|
|
6
6
|
"browserify": "browserify build/connector.js --s colijn -o dist/out-tsc/bundle.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"ts-node": "^10.2.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@types/jest": "^
|
|
30
|
+
"@types/jest": "^24.0.13",
|
|
31
31
|
"@types/reflect-metadata": "0.1.0",
|
|
32
32
|
"grunt": "^1.0.3",
|
|
33
33
|
"grunt-clean": "^0.4.0",
|
|
@@ -35,13 +35,22 @@
|
|
|
35
35
|
"grunt-contrib-concat": "^1.0.1",
|
|
36
36
|
"grunt-contrib-uglify-es": "git+https://github.com/gruntjs/grunt-contrib-uglify.git#harmony",
|
|
37
37
|
"gulp": "^3.9.1",
|
|
38
|
-
"jest": "^
|
|
39
|
-
"ts-jest": "^
|
|
38
|
+
"jest": "^24.8.0",
|
|
39
|
+
"ts-jest": "^24.0.2",
|
|
40
40
|
"typescript": "3.8.3"
|
|
41
41
|
},
|
|
42
42
|
"files": [
|
|
43
43
|
"build/"
|
|
44
44
|
],
|
|
45
45
|
"main": "build/connector.js",
|
|
46
|
-
"types": "build/connector.d.ts"
|
|
46
|
+
"types": "build/connector.d.ts",
|
|
47
|
+
"jest": {
|
|
48
|
+
"verbose": true,
|
|
49
|
+
"roots": [
|
|
50
|
+
"<rootDir>/src"
|
|
51
|
+
],
|
|
52
|
+
"transform": {
|
|
53
|
+
"^.+\\.tsx?$": "ts-jest"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
47
56
|
}
|