@colijnit/articleapi 254.1.1 → 254.1.3
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/articles-auth.d.ts +1 -0
- package/build/articles-auth.js +14 -0
- package/build/articles-public.d.ts +1 -0
- package/build/articles-public.js +4 -0
- package/build/articles.d.ts +4 -1
- package/build/articles.js +46 -41
- package/build/articles.unit.test.js +2 -2
- package/build/interface/json-article-flat-tree.interface.d.ts +7 -0
- package/build/interface/json-article-flat-tree.interface.js +1 -0
- package/build/ione-api-articles.d.ts +1 -0
- package/build/model/article-flat-tree.bo.d.ts +2 -0
- package/build/model/article-flat-tree.bo.js +5 -0
- package/package.json +1 -1
package/build/articles-auth.d.ts
CHANGED
|
@@ -81,6 +81,7 @@ export declare class ArticlesAuth extends IoneApiArticles {
|
|
|
81
81
|
transferStock(transferStock: TransferStock): Promise<DataServiceResponseData>;
|
|
82
82
|
getWebviewStartupInfo(request: ExternalCatalogStartupInfoRequest): Promise<DataServiceResponseData>;
|
|
83
83
|
storeCatFarmCompositionArticle(catalogId: number, articleFlatTree: ArticleFlatTreeDTO): Promise<DataServiceResponseData>;
|
|
84
|
+
getArticleListWithBarcodeArticleNrEanCode(searchString: string, showLoader?: boolean): Promise<DataServiceResponseData>;
|
|
84
85
|
private _getDomainCollection;
|
|
85
86
|
private _getMultipleDomainCollection;
|
|
86
87
|
private _callGetSingleImage;
|
package/build/articles-auth.js
CHANGED
|
@@ -690,6 +690,20 @@ export class ArticlesAuth extends IoneApiArticles {
|
|
|
690
690
|
};
|
|
691
691
|
return this._call(DataServiceMethod.ExecuteMethod, data);
|
|
692
692
|
}
|
|
693
|
+
getArticleListWithBarcodeArticleNrEanCode(searchString, showLoader) {
|
|
694
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
695
|
+
const params = {
|
|
696
|
+
searchValue: searchString,
|
|
697
|
+
};
|
|
698
|
+
const data = {
|
|
699
|
+
moduleName: ModuleName.Articles,
|
|
700
|
+
methodName: ArticleMethod.GetArticlesByBcArtNrEan,
|
|
701
|
+
refCursorAsArray: true,
|
|
702
|
+
parameterValues: params
|
|
703
|
+
};
|
|
704
|
+
return this._call(DataServiceMethod.ExecuteMethod, data);
|
|
705
|
+
});
|
|
706
|
+
}
|
|
693
707
|
_getDomainCollection(languageCode, domainName) {
|
|
694
708
|
const params = {
|
|
695
709
|
domainName: domainName,
|
|
@@ -81,6 +81,7 @@ export declare class ArticlesPublic extends IoneApiArticles {
|
|
|
81
81
|
getSuperArticleQuickSel(id: string, branch: string): Promise<DataServiceResponseData>;
|
|
82
82
|
getWebviewStartupInfo(): Promise<DataServiceResponseData>;
|
|
83
83
|
storeCatFarmCompositionArticle(): Promise<DataServiceResponseData>;
|
|
84
|
+
getArticleListWithBarcodeArticleNrEanCode(searchString: string, showLoader?: boolean): Promise<DataServiceResponseData>;
|
|
84
85
|
private createServiceRequestData;
|
|
85
86
|
private _getDomainCollection;
|
|
86
87
|
private _getMultipleDomainCollection;
|
package/build/articles-public.js
CHANGED
|
@@ -362,6 +362,10 @@ export class ArticlesPublic extends IoneApiArticles {
|
|
|
362
362
|
console.warn('storeCatFarmCompositionArticle not implemented');
|
|
363
363
|
return Promise.resolve(new DataServiceResponseData());
|
|
364
364
|
}
|
|
365
|
+
getArticleListWithBarcodeArticleNrEanCode(searchString, showLoader) {
|
|
366
|
+
console.warn('getArticleListWithBarcodeArticleNrEanCode not implemented');
|
|
367
|
+
return Promise.resolve(new DataServiceResponseData());
|
|
368
|
+
}
|
|
365
369
|
createServiceRequestData() {
|
|
366
370
|
const data = { languageCode: this.languageCode };
|
|
367
371
|
return data;
|
package/build/articles.d.ts
CHANGED
|
@@ -99,8 +99,11 @@ export declare class Articles {
|
|
|
99
99
|
getDeliveryDate2(goodId: number): Promise<DataServiceResponseData>;
|
|
100
100
|
getWebviewStartupInfo(request: ExternalCatalogStartupInfoRequest): Promise<DataServiceResponseData>;
|
|
101
101
|
storeCatFarmCompositionArticle(catalogId: number, articleFlatTree: ArticleFlatTreeDTO): Promise<DataServiceResponseData>;
|
|
102
|
+
getArticleListWithBarcodeArticleNrEanCode(searchString: string, showLoader?: boolean): Promise<DataServiceResponseData>;
|
|
102
103
|
getJsonConfiguredArticles(configuratorStatistics?: ConfiguratorStatisticsEnvironment, showLoader?: boolean, instanceId?: number): Promise<DataServiceResponseData>;
|
|
103
|
-
getJsonArticleFlatTree(goodId: number, goodType: string, quantity: number, showLoader?: boolean, instanceId?: number, configuratorStatistics?: ConfiguratorStatisticsEnvironment): Promise<string>;
|
|
104
|
+
getJsonArticleFlatTree(goodId: number, goodType: string, quantity: number, externalSource?: boolean, showLoader?: boolean, instanceId?: number, configuratorStatistics?: ConfiguratorStatisticsEnvironment): Promise<string>;
|
|
104
105
|
static createConnector(isPublicSession: boolean, sessionExists: boolean): IoneApiArticles;
|
|
106
|
+
private _getFrozenArticle;
|
|
107
|
+
private _getArticleFlatTree;
|
|
105
108
|
private _handleConnectionReset;
|
|
106
109
|
}
|
package/build/articles.js
CHANGED
|
@@ -13,6 +13,7 @@ import { ArticlesPublic } from './articles-public';
|
|
|
13
13
|
import { Connector } from '@colijnit/ioneconnector/build/connector';
|
|
14
14
|
import { SelectorArticle } from './model/selector-article';
|
|
15
15
|
import { BusinessObjectFactory } from '@colijnit/ioneconnector/build/service/business-object-factory';
|
|
16
|
+
import { ArticleFlatTreeDTO } from "./model/article-flat-tree.bo";
|
|
16
17
|
export class Articles {
|
|
17
18
|
constructor(options) {
|
|
18
19
|
this.showLoader = new Subject();
|
|
@@ -226,57 +227,30 @@ export class Articles {
|
|
|
226
227
|
storeCatFarmCompositionArticle(catalogId, articleFlatTree) {
|
|
227
228
|
return this.articles.storeCatFarmCompositionArticle(catalogId, articleFlatTree);
|
|
228
229
|
}
|
|
230
|
+
getArticleListWithBarcodeArticleNrEanCode(searchString, showLoader) {
|
|
231
|
+
return this.articles.getArticleListWithBarcodeArticleNrEanCode(searchString, showLoader);
|
|
232
|
+
}
|
|
229
233
|
getJsonConfiguredArticles(configuratorStatistics, showLoader = true, instanceId = undefined) {
|
|
230
234
|
return this.articles.getFrozenArticle(configuratorStatistics, showLoader, instanceId);
|
|
231
235
|
}
|
|
232
|
-
getJsonArticleFlatTree(goodId, goodType, quantity, showLoader = true, instanceId = undefined, configuratorStatistics) {
|
|
236
|
+
getJsonArticleFlatTree(goodId, goodType, quantity, externalSource = false, showLoader = true, instanceId = undefined, configuratorStatistics) {
|
|
233
237
|
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
234
|
-
const returnObject = { goodId:
|
|
235
|
-
returnObject.baseGoodId = goodId;
|
|
236
|
-
returnObject.selectorData = {};
|
|
237
|
-
returnObject.quantity = quantity;
|
|
238
|
+
const returnObject = { goodId: goodId, baseGoodId: goodId, selectorData: {}, quantity: quantity, articleTree: {} };
|
|
238
239
|
if (goodType === 'B') {
|
|
239
|
-
const
|
|
240
|
-
if (
|
|
241
|
-
|
|
242
|
-
const articles = this.boFactory.makeBOArrayFromRawBackendDataArray(SelectorArticle, rawArray);
|
|
243
|
-
const composedArticle = !!articles[0].compositionArticleNo;
|
|
244
|
-
let frozenart;
|
|
245
|
-
frozenart = this.boFactory.makeWithRawBackendData(SelectorArticle, articles[0]);
|
|
246
|
-
if (composedArticle) {
|
|
247
|
-
frozenart.compositions = [];
|
|
248
|
-
frozenart.compositions.push(articles);
|
|
249
|
-
}
|
|
250
|
-
const selectorDataObject = frozenart;
|
|
251
|
-
returnObject.goodId = (selectorDataObject.hasOwnProperty('compositionGoodId') &&
|
|
252
|
-
selectorDataObject['compositionGoodId'] !== undefined &&
|
|
253
|
-
selectorDataObject['compositionGoodId'] !== null) ? selectorDataObject['compositionGoodId'] : selectorDataObject.goodId;
|
|
254
|
-
returnObject.selectorData = selectorDataObject;
|
|
255
|
-
const articleFlatTreeResponse = yield this.articles.getJsonArticleFlatTree(returnObject.goodId, showLoader);
|
|
256
|
-
if (articleFlatTreeResponse && articleFlatTreeResponse.validationResult && articleFlatTreeResponse.validationResult.success) {
|
|
257
|
-
if (articleFlatTreeResponse.resultObject) {
|
|
258
|
-
returnObject.articleTree = articleFlatTreeResponse.resultObject;
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
else {
|
|
262
|
-
reject(articleFlatTreeResponse);
|
|
263
|
-
}
|
|
240
|
+
const frozenArt = yield this._getFrozenArticle(instanceId, configuratorStatistics, showLoader);
|
|
241
|
+
if (!frozenArt) {
|
|
242
|
+
reject("");
|
|
264
243
|
}
|
|
265
|
-
|
|
266
|
-
|
|
244
|
+
returnObject.goodId = (frozenArt.hasOwnProperty('compositionGoodId') &&
|
|
245
|
+
frozenArt['compositionGoodId'] !== undefined &&
|
|
246
|
+
frozenArt['compositionGoodId'] !== null) ? frozenArt['compositionGoodId'] : frozenArt.goodId;
|
|
247
|
+
returnObject.selectorData = frozenArt;
|
|
248
|
+
if (externalSource) {
|
|
249
|
+
returnObject.articleTree = yield this._getArticleFlatTree(returnObject.goodId, showLoader);
|
|
267
250
|
}
|
|
268
251
|
}
|
|
269
252
|
else {
|
|
270
253
|
returnObject.goodId = goodId;
|
|
271
|
-
const articleFlatTreeResponse = yield this.articles.getJsonArticleFlatTree(returnObject.goodId, showLoader);
|
|
272
|
-
if (articleFlatTreeResponse && articleFlatTreeResponse.validationResult && articleFlatTreeResponse.validationResult.success) {
|
|
273
|
-
if (articleFlatTreeResponse.resultObject) {
|
|
274
|
-
returnObject.articleTree = articleFlatTreeResponse.resultObject;
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
else {
|
|
278
|
-
reject(articleFlatTreeResponse);
|
|
279
|
-
}
|
|
280
254
|
}
|
|
281
255
|
resolve(JSON.stringify(returnObject));
|
|
282
256
|
}));
|
|
@@ -287,6 +261,37 @@ export class Articles {
|
|
|
287
261
|
}
|
|
288
262
|
return new ArticlesPublic();
|
|
289
263
|
}
|
|
264
|
+
_getFrozenArticle(instanceId, configuratorStatistics, showLoader) {
|
|
265
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
266
|
+
const frozenArticleResponse = yield this.articles.getFrozenArticle(configuratorStatistics, showLoader, instanceId);
|
|
267
|
+
if (frozenArticleResponse && frozenArticleResponse.validationResult && frozenArticleResponse.validationResult.success) {
|
|
268
|
+
const rawArray = frozenArticleResponse.resultObject;
|
|
269
|
+
const articles = this.boFactory.makeBOArrayFromRawBackendDataArray(SelectorArticle, rawArray);
|
|
270
|
+
const composedArticle = !!articles[0].compositionArticleNo;
|
|
271
|
+
let frozenart;
|
|
272
|
+
frozenart = this.boFactory.makeWithRawBackendData(SelectorArticle, articles[0]);
|
|
273
|
+
if (composedArticle) {
|
|
274
|
+
frozenart.compositions = [];
|
|
275
|
+
frozenart.compositions.push(articles);
|
|
276
|
+
}
|
|
277
|
+
return frozenart;
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
return null;
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
_getArticleFlatTree(goodId, showLoader) {
|
|
285
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
286
|
+
const articleFlatTreeResponse = yield this.articles.getJsonArticleFlatTree(goodId, showLoader);
|
|
287
|
+
if (articleFlatTreeResponse && articleFlatTreeResponse.validationResult && articleFlatTreeResponse.validationResult.success) {
|
|
288
|
+
if (articleFlatTreeResponse.resultObject) {
|
|
289
|
+
return this.boFactory.makeWithRawBackendData(ArticleFlatTreeDTO, articleFlatTreeResponse.resultObject);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
return null;
|
|
293
|
+
});
|
|
294
|
+
}
|
|
290
295
|
_handleConnectionReset() {
|
|
291
296
|
this.connectionResetInactivity.next();
|
|
292
297
|
}
|
|
@@ -21,7 +21,7 @@ import { ArticleFlat } from "./model/article-flat.bo";
|
|
|
21
21
|
const localOptions = {
|
|
22
22
|
url: "http://localhost:8080/ione",
|
|
23
23
|
schema: "815",
|
|
24
|
-
version: "
|
|
24
|
+
version: "252",
|
|
25
25
|
useLoginEncryption: true,
|
|
26
26
|
username: "elske",
|
|
27
27
|
password: "elske1"
|
|
@@ -42,7 +42,7 @@ const publicOptions = {
|
|
|
42
42
|
describe("ArticlesAPI", () => {
|
|
43
43
|
let articles;
|
|
44
44
|
const articleExtendedRequest = {
|
|
45
|
-
|
|
45
|
+
general: 'elixir',
|
|
46
46
|
paging: new PagingParameters(1, 20, 20)
|
|
47
47
|
};
|
|
48
48
|
const articleNrArticleExtendedRequest = {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -87,5 +87,6 @@ export declare abstract class IoneApiArticles {
|
|
|
87
87
|
abstract getPriceTagPrintLayouts(): Promise<DataServiceResponseData>;
|
|
88
88
|
abstract getWebviewStartupInfo(request: ExternalCatalogStartupInfoRequest): Promise<DataServiceResponseData>;
|
|
89
89
|
abstract storeCatFarmCompositionArticle(catalogId: number, articleFlatTree: ArticleFlatTreeDTO): Promise<DataServiceResponseData>;
|
|
90
|
+
abstract getArticleListWithBarcodeArticleNrEanCode(searchString: string, showLoader?: boolean): Promise<DataServiceResponseData>;
|
|
90
91
|
protected endPoint: string;
|
|
91
92
|
}
|
|
@@ -5,6 +5,7 @@ import { CompositeGood } from "./composite-good";
|
|
|
5
5
|
import { ArticlePriceList } from "./article-price-list";
|
|
6
6
|
import { PriceListInfo } from "./price-list-info";
|
|
7
7
|
import { CoDocument } from "./co-document.bo";
|
|
8
|
+
import { CoText } from '@colijnit/mainapi/build/model/co-text';
|
|
8
9
|
export declare class ArticleFlatTreeDTO extends BusinessObject {
|
|
9
10
|
article: ArticleFlat;
|
|
10
11
|
subArticles: ArticleFlat[];
|
|
@@ -14,4 +15,5 @@ export declare class ArticleFlatTreeDTO extends BusinessObject {
|
|
|
14
15
|
priceLists: PriceListInfo[];
|
|
15
16
|
supplierIdToNumber: Object;
|
|
16
17
|
documents: CoDocument[];
|
|
18
|
+
articleTexts: CoText[];
|
|
17
19
|
}
|
|
@@ -13,6 +13,7 @@ import { PriceListInfo } from "./price-list-info";
|
|
|
13
13
|
import { CoDocument } from "./co-document.bo";
|
|
14
14
|
import { ComplexField } from "@colijnit/ioneconnector/build/factory/decorators/complex-field.decorator";
|
|
15
15
|
import { ComplexArray } from "@colijnit/ioneconnector/build/factory/decorators/complex-array.decorator";
|
|
16
|
+
import { CoText } from '@colijnit/mainapi/build/model/co-text';
|
|
16
17
|
export class ArticleFlatTreeDTO extends BusinessObject {
|
|
17
18
|
constructor() {
|
|
18
19
|
super(...arguments);
|
|
@@ -23,6 +24,7 @@ export class ArticleFlatTreeDTO extends BusinessObject {
|
|
|
23
24
|
this.priceLists = [];
|
|
24
25
|
this.supplierIdToNumber = {};
|
|
25
26
|
this.documents = [];
|
|
27
|
+
this.articleTexts = [];
|
|
26
28
|
}
|
|
27
29
|
}
|
|
28
30
|
__decorate([
|
|
@@ -46,3 +48,6 @@ __decorate([
|
|
|
46
48
|
__decorate([
|
|
47
49
|
ComplexArray(CoDocument)
|
|
48
50
|
], ArticleFlatTreeDTO.prototype, "documents", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
ComplexArray(CoText)
|
|
53
|
+
], ArticleFlatTreeDTO.prototype, "articleTexts", void 0);
|