@colijnit/ioneconnector 1.0.128 → 1.0.132

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.
@@ -27,6 +27,7 @@ import { Concept } from "./model/concept";
27
27
  import { ArticleGroup } from "./model/article-group";
28
28
  import { ArticleExtendedDto } from "./model/article-extended-dto";
29
29
  import { InternalParam } from "./enum/internal-param.enum";
30
+ import { ConfiguratorStatisticsEnvironment } from "./model/configurator-statistics-environment";
30
31
  export declare class ConnectorAuth implements IoneApiConnection {
31
32
  readonly showLoader: Subject<boolean>;
32
33
  readonly connectionResetInactivity: Subject<void>;
@@ -68,7 +69,7 @@ export declare class ConnectorAuth implements IoneApiConnection {
68
69
  navigateTo(params: any): Promise<DataServiceResponseRoot>;
69
70
  getStockForArtNode(branchNo: string, selNodeId: number): Promise<number>;
70
71
  getMatchTable(): Promise<any>;
71
- getFrozenArticle(): Promise<any>;
72
+ getFrozenArticle(configuratorStatistics?: ConfiguratorStatisticsEnvironment): Promise<any>;
72
73
  getJsonArticleFlatTree(goodId: number): Promise<any>;
73
74
  getSkipButtonImageAndText(goodId?: number): Promise<SkipButtonInfo>;
74
75
  getArticlesForCatalog(params: GetArticlesForCatalogRequest, paging: PagingParameters, showLoader: boolean): Promise<ArticleListObjectExtended[] | ArticleExtendedDto[]>;
@@ -125,8 +125,8 @@ class ConnectorAuth {
125
125
  getMatchTable() {
126
126
  return this.dataRepository.getMatchTable();
127
127
  }
128
- getFrozenArticle() {
129
- return this.dataRepository.getFrozenArticle();
128
+ getFrozenArticle(configuratorStatistics) {
129
+ return this.dataRepository.getFrozenArticle(configuratorStatistics);
130
130
  }
131
131
  getJsonArticleFlatTree(goodId) {
132
132
  return this.dataRepository.getJsonArticleFlatTree(goodId);
@@ -25,6 +25,7 @@ import { Concept } from "./model/concept";
25
25
  import { ArticleGroup } from "./model/article-group";
26
26
  import { ArticleExtendedDto } from "./model/article-extended-dto";
27
27
  import { InternalParam } from "./enum/internal-param.enum";
28
+ import { ConfiguratorStatisticsEnvironment } from "./model/configurator-statistics-environment";
28
29
  export declare class ConnectorPublic implements IoneApiConnection {
29
30
  readonly showLoader: Subject<boolean>;
30
31
  readonly connectionResetInactivity: Subject<void>;
@@ -63,7 +64,7 @@ export declare class ConnectorPublic implements IoneApiConnection {
63
64
  navigateTo(params: any): Promise<DataServiceResponseRoot>;
64
65
  getStockForArtNode(branchNo: string, selNodeId: number): Promise<number>;
65
66
  getMatchTable(): Promise<any>;
66
- getFrozenArticle(): Promise<any>;
67
+ getFrozenArticle(configuratorStatistics?: ConfiguratorStatisticsEnvironment): Promise<any>;
67
68
  getJsonArticleFlatTree(goodId: number): Promise<any>;
68
69
  getSkipButtonImageAndText(goodId?: number): Promise<SkipButtonInfo>;
69
70
  getArticlesForCatalog(params: GetArticlesForCatalogRequest, paging: PagingParameters, showLoader: boolean): Promise<ArticleListObjectExtended[] | ArticleExtendedDto[]>;
@@ -120,8 +120,8 @@ class ConnectorPublic {
120
120
  getMatchTable() {
121
121
  return this.dataService.getMatchTable();
122
122
  }
123
- getFrozenArticle() {
124
- return this.dataService.getFrozenArticle();
123
+ getFrozenArticle(configuratorStatistics) {
124
+ return this.dataService.getFrozenArticle(configuratorStatistics);
125
125
  }
126
126
  getJsonArticleFlatTree(goodId) {
127
127
  return this.dataService.getJsonArticleFlatTree(goodId);
@@ -37,6 +37,7 @@ import { ArticleGroup } from "./model/article-group";
37
37
  import { ArticleExtendedDto } from "./model/article-extended-dto";
38
38
  import { InternalParam } from "./enum/internal-param.enum";
39
39
  import { QuestionAndAnswer } from "./model/question-and-answer";
40
+ import { ConfiguratorStatisticsEnvironment } from "./model/configurator-statistics-environment";
40
41
  export declare class Connector {
41
42
  goodId: number;
42
43
  useWebsocket: boolean;
@@ -100,7 +101,7 @@ export declare class Connector {
100
101
  selectSelection(selection: Selection, forceBackToNode?: boolean, after?: boolean, connector?: string): Promise<DataServiceResponseRoot>;
101
102
  cancelAnswer(): Promise<DataServiceResponseRoot>;
102
103
  getAnswerStock(answer: Answer): Promise<StockStatus>;
103
- getJsonConfiguredArticles(): Promise<any>;
104
+ getJsonConfiguredArticles(configuratorStatistics?: ConfiguratorStatisticsEnvironment): Promise<any>;
104
105
  getJsonArticleFlatTree(goodId: number): Promise<any>;
105
106
  getJsonMatchTableArticles(): Promise<any>;
106
107
  getInternalParameter(parameter: InternalParam): Promise<string>;
@@ -423,14 +423,14 @@ class Connector {
423
423
  }
424
424
  });
425
425
  }
426
- getJsonConfiguredArticles() {
427
- return new Promise((resolve) => {
428
- this.connection.getFrozenArticle()
426
+ getJsonConfiguredArticles(configuratorStatistics) {
427
+ return new Promise((resolve, reject) => {
428
+ this.connection.getFrozenArticle(configuratorStatistics)
429
429
  .then((result) => {
430
- resolve(JSON.stringify(this.getMappedFrozenArticle(result)));
430
+ resolve(JSON.stringify(result));
431
431
  })
432
- .catch((error) => {
433
- console.error(error);
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;
@@ -7,6 +7,9 @@ function MapProperty(propName) {
7
7
  if (!target || !propertyKey) {
8
8
  return;
9
9
  }
10
+ if (!target.hasOwnProperty(propertyKey)) {
11
+ target[propertyKey] = undefined;
12
+ }
10
13
  Reflect.defineMetadata(PROP_META_KEY, propName, target, propertyKey);
11
14
  };
12
15
  }
@@ -23,6 +23,7 @@ import { Concept } from "./model/concept";
23
23
  import { ArticleGroup } from "./model/article-group";
24
24
  import { ArticleExtendedDto } from "./model/article-extended-dto";
25
25
  import { InternalParam } from "./enum/internal-param.enum";
26
+ import { ConfiguratorStatisticsEnvironment } from "./model/configurator-statistics-environment";
26
27
  export interface IoneApiConnection {
27
28
  showLoader: Subject<boolean>;
28
29
  connectionResetInactivity: Subject<void>;
@@ -54,7 +55,7 @@ export interface IoneApiConnection {
54
55
  navigateTo(params: any): Promise<DataServiceResponseRoot>;
55
56
  getStockForArtNode(branchNo: string, selNodeId: number): Promise<number>;
56
57
  getMatchTable(): Promise<any>;
57
- getFrozenArticle(): Promise<any>;
58
+ getFrozenArticle(configuratorStatistics?: ConfiguratorStatisticsEnvironment): Promise<any>;
58
59
  getJsonArticleFlatTree(goodId: number): Promise<any>;
59
60
  getSkipButtonImageAndText(goodId?: number): Promise<SkipButtonInfo>;
60
61
  getArticlesForCatalog(params: GetArticlesForCatalogRequest, paging: PagingParameters, showLoader: boolean): Promise<ArticleListObjectExtended[] | ArticleExtendedDto[]>;
@@ -74,6 +74,7 @@ export declare class Answer extends BusinessObject {
74
74
  parentArticleDecoId: any;
75
75
  useNextCombNode: boolean;
76
76
  treeLevel: any;
77
+ nodeLinkedText: string;
77
78
  isGroupHeader: boolean;
78
79
  imageData: string;
79
80
  instanceId: string;
@@ -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) {
@@ -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;
@@ -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)
@@ -0,0 +1,8 @@
1
+ export declare class ConfiguratorStatisticsEnvironment {
2
+ userType: string;
3
+ transactionType: string;
4
+ actionDomain: string;
5
+ sessionId: string;
6
+ webHost: string;
7
+ bundleHost: string;
8
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class ConfiguratorStatisticsEnvironment {
4
+ }
5
+ exports.ConfiguratorStatisticsEnvironment = ConfiguratorStatisticsEnvironment;
@@ -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;
@@ -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,32 +1,33 @@
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';
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";
27
27
  import { ArticleGroup } from "../model/article-group";
28
28
  import { ArticleExtendedDto } from "../model/article-extended-dto";
29
29
  import { InternalParam } from "../enum/internal-param.enum";
30
+ import { ConfiguratorStatisticsEnvironment } from "../model/configurator-statistics-environment";
30
31
  export declare class DataRepositoryService {
31
32
  readonly showLoader: Subject<boolean>;
32
33
  readonly connectionResetInactivity: Subject<void>;
@@ -43,7 +44,7 @@ export declare class DataRepositoryService {
43
44
  closeSession(): void;
44
45
  getGoodIdFromArticleNr(sku: string): Promise<number>;
45
46
  getMatchTable(): Promise<any>;
46
- getFrozenArticle(): Promise<any>;
47
+ getFrozenArticle(configuratorStatistics?: ConfiguratorStatisticsEnvironment): Promise<any>;
47
48
  getJsonArticleFlatTree(goodId: number): Promise<any>;
48
49
  getSkipButtonImageAndText(goodId?: number): Promise<SkipButtonInfo>;
49
50
  getArticleQuickSel(id: number): Promise<Article>;
@@ -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();
@@ -120,24 +123,33 @@ class DataRepositoryService {
120
123
  });
121
124
  });
122
125
  }
123
- getFrozenArticle() {
126
+ getFrozenArticle(configuratorStatistics) {
124
127
  return new Promise((resolve, reject) => {
125
- return this.callGenerateFrozenArticle()
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((result) => {
129
- if (result.data.validationResult && result.data.validationResult.success === true) {
130
- resolve(result.data.resultObject);
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
- console.error("Error creating article");
134
- reject("Error creating article");
147
+ reject(frozenResult);
135
148
  }
136
149
  });
137
150
  }
138
151
  else {
139
- console.error("Error creating article");
140
- reject("Error creating article");
152
+ return reject(result);
141
153
  }
142
154
  })
143
155
  .catch((e) => {
@@ -809,8 +821,11 @@ class DataRepositoryService {
809
821
  };
810
822
  return this.call(data, undefined, showLoader);
811
823
  }
812
- callGenerateFrozenArticle() {
824
+ callGenerateFrozenArticle(configuratorStatistics) {
813
825
  const params = {};
826
+ if (configuratorStatistics) {
827
+ params.configuratorStatisticsEnvironment = configuratorStatistics;
828
+ }
814
829
  const data = {
815
830
  methodName: article_method_enum_1.ArticleMethod.GenerateFrozenArticle,
816
831
  moduleName: module_name_enum_1.ModuleName.Articles,
@@ -23,6 +23,7 @@ import { ArticleGroup } from "../model/article-group";
23
23
  import { ArticleExtendedDto } from "../model/article-extended-dto";
24
24
  import { Options } from "../model/options";
25
25
  import { InternalParam } from "../enum/internal-param.enum";
26
+ import { ConfiguratorStatisticsEnvironment } from "../model/configurator-statistics-environment";
26
27
  export declare class HdDataService {
27
28
  private _sessionService;
28
29
  private _boFactory;
@@ -43,7 +44,7 @@ export declare class HdDataService {
43
44
  cancelBack2Node(params: any): Promise<DataServiceResponseRoot>;
44
45
  navigateTo(params: any): Promise<DataServiceResponseRoot>;
45
46
  getMatchTable(): Promise<any>;
46
- getFrozenArticle(): Promise<any>;
47
+ getFrozenArticle(configuratorStatistics?: ConfiguratorStatisticsEnvironment): Promise<any>;
47
48
  getJsonArticleFlatTree(goodId: number): Promise<any>;
48
49
  private getLastFrozenArticle;
49
50
  getSkipButtonImageAndText(goodId?: number): Promise<SkipButtonInfo>;
@@ -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;
@@ -107,27 +110,39 @@ class HdDataService {
107
110
  }
108
111
  });
109
112
  }
110
- getFrozenArticle() {
113
+ getFrozenArticle(configuratorStatistics) {
111
114
  return __awaiter(this, void 0, void 0, function* () {
112
115
  const params = { instanceId: this._instanceId };
116
+ if (configuratorStatistics) {
117
+ params.configuratorStatisticsEnvironment = configuratorStatistics;
118
+ }
113
119
  const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
114
120
  const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.GenerateFrozenArticle, data)
115
121
  .catch((e) => {
116
122
  return Promise.reject(e);
117
123
  });
118
- const result = response.data;
119
- if (result.validationResult && result.validationResult.success) {
120
- return this.getLastFrozenArticle();
124
+ if (response && response.data && response.data.validationResult && response.data.validationResult.success) {
125
+ const rawResponse = yield this.getLastFrozenArticle();
126
+ const articles = this._boFactory.makeBOArrayFromRawBackendDataArray(selector_article_1.SelectorArticle, rawResponse);
127
+ const composedArticle = !!articles[0].compositionArticleNo;
128
+ let frozenart;
129
+ if (composedArticle) {
130
+ frozenart = new frozen_article_1.FrozenArticle(articles[0]);
131
+ frozenart.compositions.push(articles);
132
+ }
133
+ else {
134
+ frozenart = new frozen_article_simple_1.FrozenArticleSimple(articles[0]);
135
+ }
136
+ return frozenart;
121
137
  }
122
138
  else {
123
- console.error("Error creating article (" + response.message + ")");
124
- return null;
139
+ return Promise.reject(response);
125
140
  }
126
141
  });
127
142
  }
128
143
  getJsonArticleFlatTree(goodId) {
129
144
  return __awaiter(this, void 0, void 0, function* () {
130
- const params = { instanceId: this._instanceId, goodId: goodId };
145
+ const params = { goodId: goodId };
131
146
  const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
132
147
  const response = yield this._sessionService.call(hd_service_method_1.HdServiceMethod.GetArticleTree, data)
133
148
  .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
- let options = {
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.128",
3
+ "version": "1.0.132",
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": "^27.0.2",
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": "^27.2.4",
39
- "ts-jest": "^27.0.5",
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
  }