@softwear/latestcollectioncore 1.0.68 → 1.0.69

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.
@@ -2,9 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const index_1 = require("./index");
4
4
  // The order of the following mappingPairs is significant.
5
- // The ERM mapping relies on the Gender and ProductGroup mapping to have been evaluated first
5
+ // - If no mapping is available, we prefer colorFamily to be copied from colorSupplier, not colorCodeSupplier.
6
+ // Hence the order and mustMatch values of the first two lines.
7
+ //
8
+ // - The ERM mapping relies on the Gender and ProductGroup mapping to have been evaluated first
6
9
  const mappingPairs = [
7
- { category: 'ColorCode', from: 'colorCodeSupplier', to: 'colorFamily' },
10
+ { category: 'ColorCode', from: 'colorCodeSupplier', to: 'colorFamily', mustMatch: true },
8
11
  { category: 'ColorDescription', from: 'colorSupplier', to: 'colorFamily' },
9
12
  { category: 'ProductGroup', from: 'articleGroupSupplier', to: 'articleGroup' },
10
13
  { category: 'BTEGroup', from: 'articleGroupSupplier', to: 'BTEGROUP', mustMatch: true },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softwear/latestcollectioncore",
3
- "version": "1.0.68",
3
+ "version": "1.0.69",
4
4
  "description": "Core functions for LatestCollections applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,9 +1,12 @@
1
1
  import { hashBrand, SkuI, BrandSettingI, mappingStrategyE } from './index'
2
2
 
3
3
  // The order of the following mappingPairs is significant.
4
- // The ERM mapping relies on the Gender and ProductGroup mapping to have been evaluated first
4
+ // - If no mapping is available, we prefer colorFamily to be copied from colorSupplier, not colorCodeSupplier.
5
+ // Hence the order and mustMatch values of the first two lines.
6
+ //
7
+ // - The ERM mapping relies on the Gender and ProductGroup mapping to have been evaluated first
5
8
  const mappingPairs = [
6
- { category: 'ColorCode', from: 'colorCodeSupplier', to: 'colorFamily' },
9
+ { category: 'ColorCode', from: 'colorCodeSupplier', to: 'colorFamily', mustMatch: true },
7
10
  { category: 'ColorDescription', from: 'colorSupplier', to: 'colorFamily' },
8
11
  { category: 'ProductGroup', from: 'articleGroupSupplier', to: 'articleGroup' },
9
12
  { category: 'BTEGroup', from: 'articleGroupSupplier', to: 'BTEGROUP', mustMatch: true },
@@ -176,7 +176,6 @@ describe('applyPreferedPropertyMappings', () => {
176
176
  collectionSupplier: 'SUMMER 2022',
177
177
  colorCodeSupplier: '100',
178
178
  size: 'S',
179
- colorFamily: '100',
180
179
  collection: 'User defined value wins',
181
180
  })
182
181
  })
@@ -16,6 +16,7 @@ const skus = [
16
16
  brand: 'levis',
17
17
  collectionSupplier: 'SUMMER 2022',
18
18
  colorCodeSupplier: '100',
19
+ colorSupplier: 'Black',
19
20
  size: 'S',
20
21
  sizeSupplier: 'S',
21
22
  articleGroupSupplier: '10000',
@@ -25,6 +26,7 @@ const skus = [
25
26
  brand: 'levis',
26
27
  collectionSupplier: 'SUMMER 2022',
27
28
  colorCodeSupplier: '100',
29
+ colorSupplier: 'Black',
28
30
  size: 'M',
29
31
  sizeSupplier: 'M',
30
32
  articleGroupSupplier: '10000',
@@ -34,6 +36,7 @@ const skus = [
34
36
  brand: 'levis',
35
37
  collectionSupplier: 'SUMMER 2022',
36
38
  colorCodeSupplier: '100',
39
+ colorSupplier: 'Black',
37
40
  size: 'L',
38
41
  sizeSupplier: 'L',
39
42
  articleGroupSupplier: '10000',
@@ -43,6 +46,7 @@ const skus = [
43
46
  brand: 'levis',
44
47
  collectionSupplier: 'SUMMER 2022',
45
48
  colorCodeSupplier: '200',
49
+ colorSupplier: 'Navy',
46
50
  size: 'S',
47
51
  sizeSupplier: 'S',
48
52
  articleGroupSupplier: '10000',
@@ -52,6 +56,7 @@ const skus = [
52
56
  brand: 'levis',
53
57
  collectionSupplier: 'SUMMER 2022',
54
58
  colorCodeSupplier: '200',
59
+ colorSupplier: 'Navy',
55
60
  size: 'M',
56
61
  sizeSupplier: 'M',
57
62
  articleGroupSupplier: '10000',
@@ -61,6 +66,7 @@ const skus = [
61
66
  brand: 'levis',
62
67
  collectionSupplier: 'SUMMER 2022',
63
68
  colorCodeSupplier: '200',
69
+ colorSupplier: 'Navy',
64
70
  size: 'L',
65
71
  sizeSupplier: 'L',
66
72
  articleGroupSupplier: '10000',
@@ -72,6 +78,7 @@ const skus = [
72
78
  collectionSupplier: 'SUMMER 2022',
73
79
  collection: 'User defined value wins',
74
80
  colorCodeSupplier: '200',
81
+ colorSupplier: 'Navy',
75
82
  colorFamily: 'Blue',
76
83
  size: 'S',
77
84
  sizeSupplier: 'S',
@@ -82,6 +89,7 @@ const skus = [
82
89
  brand: 'gstar',
83
90
  collectionSupplier: 'SUMMER 2022',
84
91
  colorCodeSupplier: '200',
92
+ colorSupplier: 'Navy',
85
93
  colorFamily: 'Blue',
86
94
  size: 'M',
87
95
  sizeSupplier: 'M',
@@ -92,6 +100,7 @@ const skus = [
92
100
  brand: 'gstar',
93
101
  collectionSupplier: 'SUMMER 2022',
94
102
  colorCodeSupplier: '200',
103
+ colorSupplier: 'Navy',
95
104
  colorFamily: 'Blue',
96
105
  size: 'L',
97
106
  sizeSupplier: 'L',
@@ -102,6 +111,7 @@ const skus = [
102
111
  brand: 'gstar',
103
112
  collectionSupplier: 'SUMMER 2022',
104
113
  colorCodeSupplier: '200',
114
+ colorSupplier: 'Navy',
105
115
  size: 'M',
106
116
  sizeSupplier: 'M',
107
117
  collection: '22zomer',
@@ -113,6 +123,7 @@ const skus = [
113
123
  brand: 'gstar',
114
124
  collectionSupplier: 'SUMMER 2022',
115
125
  colorCodeSupplier: '200',
126
+ colorSupplier: 'Navy',
116
127
  colorFamily: 'Blue',
117
128
  size: 'L',
118
129
  sizeSupplier: 'L',
@@ -244,7 +255,8 @@ describe('applyPropertyMapping', () => {
244
255
  colorCodeSupplier: '100',
245
256
  size: 'S',
246
257
  sizeSupplier: 'S',
247
- colorFamily: '100',
258
+ colorFamily: 'Black',
259
+ colorSupplier: 'Black',
248
260
  collection: 'SUMMER 2022',
249
261
  _customsize: 'S',
250
262
  articleGroup: '10000',
@@ -366,7 +378,7 @@ describe('applyPropertyMapping', () => {
366
378
  expect(mappedSkus[0]['_erm-code']).to.equal('10000 - Women - Dresses')
367
379
  })
368
380
 
369
- it('returns mapped skus on a default mapping rules', function () {
381
+ it('returns mapped skus on default mapping rules', function () {
370
382
  const mappedSkus = applyPropertyMapping(deepCopy(skus), fallbackMapping)
371
383
  expect(mappedSkus[0].colorFamily).to.equal('fallbackMapping')
372
384
  expect(mappedSkus[1].colorFamily).to.equal('fallbackMapping')
@@ -391,4 +403,9 @@ describe('applyPropertyMapping', () => {
391
403
  expect(mappedSkus[6].articleGroup).to.equal('TENANT-articleGroupMapping')
392
404
  expect(mappedSkus[10].articleGroup).to.equal('LAT-articleGroupMapping')
393
405
  })
406
+
407
+ it('returns colorFamily copied from colorSupplier on a articlegroup mapping', function () {
408
+ const mappedSkus = applyPropertyMapping(deepCopy(skus), articleGroupMapping)
409
+ expect(mappedSkus[0].colorFamily).to.equal('Black')
410
+ })
394
411
  })