@contrail/flexplm 1.1.21 → 1.1.22

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.
@@ -133,6 +133,9 @@ class TypeDefaults {
133
133
  if (['LCSProduct', 'LCSSKU'].includes(objectClass)) {
134
134
  entityClass = 'item';
135
135
  }
136
+ else if (['LCSProductSeasonLink', 'LCSSKUSeasonLink'].includes(objectClass)) {
137
+ entityClass = 'project-item';
138
+ }
136
139
  else if ('LCSColor' === objectClass) {
137
140
  entityClass = 'color';
138
141
  }
@@ -152,13 +155,19 @@ class TypeDefaults {
152
155
  switch (objectClass) {
153
156
  case 'LCSProduct':
154
157
  case 'LCSSKU':
158
+ typePath = 'item';
159
+ break;
155
160
  case 'LCSProductSeasonLink':
156
161
  case 'LCSSKUSeasonLink':
157
- typePath = 'item';
162
+ typePath = 'project-item';
158
163
  break;
159
164
  case 'LCSColor':
160
165
  typePath = 'color';
161
166
  break;
167
+ case 'LCSSeason':
168
+ case 'SeasonGroup':
169
+ typePath = 'assortment';
170
+ break;
162
171
  }
163
172
  if (typePath === '')
164
173
  throw Error(TypeDefaults.NO_TYPE_PATH);
@@ -320,6 +320,20 @@ describe('Type Defaults', () => {
320
320
  const entityClass = type_defaults_1.TypeDefaults.getDefaultEntityClass(object);
321
321
  expect(entityClass).toBe('item');
322
322
  });
323
+ it('project-item - LCSProductSeasonLink', () => {
324
+ const object = {
325
+ flexPLMObjectClass: 'LCSProductSeasonLink'
326
+ };
327
+ const entityClass = type_defaults_1.TypeDefaults.getDefaultEntityClass(object);
328
+ expect(entityClass).toBe('project-item');
329
+ });
330
+ it('project-item - LCSSKUSeasonLink', () => {
331
+ const object = {
332
+ flexPLMObjectClass: 'LCSSKUSeasonLink'
333
+ };
334
+ const entityClass = type_defaults_1.TypeDefaults.getDefaultEntityClass(object);
335
+ expect(entityClass).toBe('project-item');
336
+ });
323
337
  it('color - LCSColor', () => {
324
338
  const object = {
325
339
  flexPLMObjectClass: 'LCSColor'
@@ -376,14 +390,14 @@ describe('Type Defaults', () => {
376
390
  flexPLMObjectClass: 'LCSProductSeasonLink'
377
391
  };
378
392
  const typePath = type_defaults_1.TypeDefaults.getDefaultEntityTypePath(object);
379
- expect(typePath).toBe('item');
393
+ expect(typePath).toBe('project-item');
380
394
  });
381
395
  it('LCSSKUSeasonLink', () => {
382
396
  const object = {
383
397
  flexPLMObjectClass: 'LCSSKUSeasonLink'
384
398
  };
385
399
  const typePath = type_defaults_1.TypeDefaults.getDefaultEntityTypePath(object);
386
- expect(typePath).toBe('item');
400
+ expect(typePath).toBe('project-item');
387
401
  });
388
402
  it('LCSColor', () => {
389
403
  const object = {
@@ -392,6 +406,20 @@ describe('Type Defaults', () => {
392
406
  const typePath = type_defaults_1.TypeDefaults.getDefaultEntityTypePath(object);
393
407
  expect(typePath).toBe('color');
394
408
  });
409
+ it('LCSSeason', () => {
410
+ const object = {
411
+ flexPLMObjectClass: 'LCSSeason'
412
+ };
413
+ const typePath = type_defaults_1.TypeDefaults.getDefaultEntityTypePath(object);
414
+ expect(typePath).toBe('assortment');
415
+ });
416
+ it('SeasonGroup', () => {
417
+ const object = {
418
+ flexPLMObjectClass: 'SeasonGroup'
419
+ };
420
+ const typePath = type_defaults_1.TypeDefaults.getDefaultEntityTypePath(object);
421
+ expect(typePath).toBe('assortment');
422
+ });
395
423
  });
396
424
  describe('getDefaultIdentifierPropertiesFromObject', () => {
397
425
  it('LCSProduct', () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/flexplm",
3
- "version": "1.1.21",
3
+ "version": "1.1.22",
4
4
  "description": "Library used for integration with flexplm.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -415,6 +415,26 @@ describe('Type Defaults', () =>{
415
415
  expect(entityClass).toBe('item');
416
416
  });
417
417
 
418
+ it('project-item - LCSProductSeasonLink', () =>{
419
+ const object = {
420
+ flexPLMObjectClass: 'LCSProductSeasonLink'
421
+ };
422
+
423
+ const entityClass = TypeDefaults.getDefaultEntityClass(object);
424
+
425
+ expect(entityClass).toBe('project-item');
426
+ });
427
+
428
+ it('project-item - LCSSKUSeasonLink', () =>{
429
+ const object = {
430
+ flexPLMObjectClass: 'LCSSKUSeasonLink'
431
+ };
432
+
433
+ const entityClass = TypeDefaults.getDefaultEntityClass(object);
434
+
435
+ expect(entityClass).toBe('project-item');
436
+ });
437
+
418
438
  it('color - LCSColor', () =>{
419
439
  const object = {
420
440
  flexPLMObjectClass: 'LCSColor'
@@ -491,7 +511,7 @@ describe('Type Defaults', () =>{
491
511
  };
492
512
 
493
513
  const typePath = TypeDefaults.getDefaultEntityTypePath(object);
494
- expect(typePath).toBe('item');
514
+ expect(typePath).toBe('project-item');
495
515
  });
496
516
 
497
517
  it('LCSSKUSeasonLink', () =>{
@@ -500,7 +520,7 @@ describe('Type Defaults', () =>{
500
520
  };
501
521
 
502
522
  const typePath = TypeDefaults.getDefaultEntityTypePath(object);
503
- expect(typePath).toBe('item');
523
+ expect(typePath).toBe('project-item');
504
524
  });
505
525
 
506
526
  it('LCSColor', () =>{
@@ -512,6 +532,23 @@ describe('Type Defaults', () =>{
512
532
  expect(typePath).toBe('color');
513
533
  });
514
534
 
535
+ it('LCSSeason', () =>{
536
+ const object = {
537
+ flexPLMObjectClass: 'LCSSeason'
538
+ };
539
+
540
+ const typePath = TypeDefaults.getDefaultEntityTypePath(object);
541
+ expect(typePath).toBe('assortment');
542
+ });
543
+
544
+ it('SeasonGroup', () =>{
545
+ const object = {
546
+ flexPLMObjectClass: 'SeasonGroup'
547
+ };
548
+
549
+ const typePath = TypeDefaults.getDefaultEntityTypePath(object);
550
+ expect(typePath).toBe('assortment');
551
+ });
515
552
  });//getDefaultEntityTypePath
516
553
 
517
554
  describe('getDefaultIdentifierPropertiesFromObject', () =>{
@@ -170,6 +170,8 @@ export class TypeDefaults {
170
170
  let objectClass = TypeDefaults.getObjectClass(object);
171
171
  if(['LCSProduct', 'LCSSKU'].includes(objectClass)){
172
172
  entityClass = 'item';
173
+ }else if(['LCSProductSeasonLink', 'LCSSKUSeasonLink'].includes(objectClass)){
174
+ entityClass = 'project-item'
173
175
  } else if('LCSColor' === objectClass){
174
176
  entityClass = 'color';
175
177
  } else if(['LCSSeason', 'SeasonGroup'].includes(objectClass)) {
@@ -197,14 +199,20 @@ export class TypeDefaults {
197
199
  switch (objectClass) {
198
200
  case 'LCSProduct':
199
201
  case 'LCSSKU':
202
+ typePath = 'item';
203
+ break;
200
204
  case 'LCSProductSeasonLink':
201
205
  case 'LCSSKUSeasonLink':
202
- typePath = 'item';
206
+ typePath = 'project-item';
203
207
  break;
204
208
  case 'LCSColor':
205
209
  typePath = 'color';
206
210
  break;
207
- }
211
+ case 'LCSSeason':
212
+ case 'SeasonGroup':
213
+ typePath = 'assortment';
214
+ break;
215
+ }
208
216
 
209
217
  if(typePath === '')
210
218
  throw Error(TypeDefaults.NO_TYPE_PATH);