@softwear/latestcollectioncore 1.0.58 → 1.0.59

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.
@@ -5,9 +5,9 @@ const mappingPairs = [
5
5
  { category: 'ColorCode', from: 'colorCodeSupplier', to: 'colorFamily' },
6
6
  { category: 'ColorDescription', from: 'colorSupplier', to: 'colorFamily' },
7
7
  { category: 'ProductGroup', from: 'articleGroupSupplier', to: 'articleGroup' },
8
- { category: 'BTEGroup', from: 'articleGroupSupplier', to: 'BTEGROUP' },
9
- { category: 'DTBGroup', from: 'articleGroupSupplier', to: 'DTBGROUP' },
10
- { category: 'FedasGroup', from: 'articleGroupSupplier', to: 'FEDASGROUP' },
8
+ { category: 'BTEGroup', from: 'articleGroupSupplier', to: 'BTEGROUP', mustMatch: true },
9
+ { category: 'DTBGroup', from: 'articleGroupSupplier', to: 'DTBGROUP', mustMatch: true },
10
+ { category: 'FedasGroup', from: 'articleGroupSupplier', to: 'FEDASGROUP', mustMatch: true },
11
11
  { category: 'Collection', from: 'collectionSupplier', to: 'collection' },
12
12
  { category: 'CustomSize', from: 'sizeSupplier', to: '_customsize' },
13
13
  { category: 'Size', from: 'sizeSupplier', to: 'size' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softwear/latestcollectioncore",
3
- "version": "1.0.58",
3
+ "version": "1.0.59",
4
4
  "description": "Core functions for LatestCollections applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -4,9 +4,9 @@ const mappingPairs = [
4
4
  { category: 'ColorCode', from: 'colorCodeSupplier', to: 'colorFamily' },
5
5
  { category: 'ColorDescription', from: 'colorSupplier', to: 'colorFamily' },
6
6
  { category: 'ProductGroup', from: 'articleGroupSupplier', to: 'articleGroup' },
7
- { category: 'BTEGroup', from: 'articleGroupSupplier', to: 'BTEGROUP' },
8
- { category: 'DTBGroup', from: 'articleGroupSupplier', to: 'DTBGROUP' },
9
- { category: 'FedasGroup', from: 'articleGroupSupplier', to: 'FEDASGROUP' },
7
+ { category: 'BTEGroup', from: 'articleGroupSupplier', to: 'BTEGROUP', mustMatch: true },
8
+ { category: 'DTBGroup', from: 'articleGroupSupplier', to: 'DTBGROUP', mustMatch: true },
9
+ { category: 'FedasGroup', from: 'articleGroupSupplier', to: 'FEDASGROUP', mustMatch: true },
10
10
  { category: 'Collection', from: 'collectionSupplier', to: 'collection' },
11
11
  { category: 'CustomSize', from: 'sizeSupplier', to: '_customsize' },
12
12
  { category: 'Size', from: 'sizeSupplier', to: 'size' },
@@ -165,6 +165,9 @@ const fullMapping = [
165
165
  { category: 'Collection', from: 'SUMMER 2022', to: '22zomer' },
166
166
  { category: 'CustomSize', from: 'M', to: 'medium' },
167
167
  { category: 'Gender', from: '', to: 'uni' },
168
+ { category: 'FedasGroup', from: '12345', to: '12345 - Fedas' },
169
+ { category: 'BTEGroup', from: '12345', to: '12345 - BTE' },
170
+ { category: 'DTBGroup', from: '12345', to: '12345 - DTB' },
168
171
  ],
169
172
  },
170
173
  ]
@@ -293,6 +296,20 @@ describe('applyPropertyMapping', () => {
293
296
 
294
297
  expect(mappedSkus[1]._gender).to.equal(undefined)
295
298
  expect(mappedSkus[7]._gender).to.equal('uni')
299
+
300
+ expect(mappedSkus[0].FEDASGROUP).to.equal(undefined)
301
+ expect(mappedSkus[6].FEDASGROUP).to.equal('12345 - Fedas')
302
+ expect(mappedSkus[6].BTEGROUP).to.equal('12345 - BTE')
303
+ expect(mappedSkus[6].DTBGROUP).to.equal('12345 - DTB')
304
+ expect(mappedSkus[7].FEDASGROUP).to.equal('12345 - Fedas')
305
+ expect(mappedSkus[7].BTEGROUP).to.equal('12345 - BTE')
306
+ expect(mappedSkus[7].DTBGROUP).to.equal('12345 - DTB')
307
+ expect(mappedSkus[8].FEDASGROUP).to.equal('12345 - Fedas')
308
+ expect(mappedSkus[8].BTEGROUP).to.equal('12345 - BTE')
309
+ expect(mappedSkus[8].DTBGROUP).to.equal('12345 - DTB')
310
+ expect(mappedSkus[9].FEDASGROUP).to.equal(undefined)
311
+ expect(mappedSkus[9].BTEGROUP).to.equal(undefined)
312
+ expect(mappedSkus[9].DTBGROUP).to.equal(undefined)
296
313
  })
297
314
 
298
315
  it('returns mapped skus on a default mapping rules', function () {