@bytebrand/export-cars 1.22.1 → 1.22.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytebrand/export-cars",
3
- "version": "1.22.1",
3
+ "version": "1.22.3",
4
4
  "description": "",
5
5
  "author": "bytebrand",
6
6
  "license": "UNLICENSED",
@@ -15,13 +15,13 @@
15
15
  "dependencies": {
16
16
  "@bytebrand/autode-request": "^1.19.2",
17
17
  "@bytebrand/car-basic-data-scope": "^9.11.24",
18
- "@bytebrand/car-description": "^1.17.19",
18
+ "@bytebrand/car-description": "^1.17.20",
19
19
  "@bytebrand/car-schema": "^3.14.15",
20
20
  "@bytebrand/chunkable": "^5.19.8",
21
21
  "@bytebrand/cronicle-helper": "^1.21.8",
22
- "@bytebrand/i18n-dictionaries": "^1.5.2",
22
+ "@bytebrand/i18n-dictionaries": "^1.5.0",
23
23
  "@bytebrand/import-helper": "^0.45.0",
24
- "@bytebrand/schema-tools": "^3.22.19",
24
+ "@bytebrand/schema-tools": "^3.18.8",
25
25
  "@bytebrand/zipper": "^2.2.0",
26
26
  "@nestjs/cache-manager": "^2.1.0",
27
27
  "@nestjs/common": "^10.2.7",
@@ -51,9 +51,11 @@ export class MobileTransformer {
51
51
  }
52
52
  }
53
53
  }
54
+ const rateMonthlyInstallment = toString(get(carData, 'rate.monthlyInstallment', '0'))
55
+ const leasingMonthlyInstallment = toString(get(carData, 'leasing.monthlyInstallment', '0'))
54
56
 
55
- set(transformedCarData, 150, toString(get(carData, 'rate.monthlyInstallment', '')));
56
- set(transformedCarData, 293, toString(get(carData, 'leasing.monthlyInstallment', '')));
57
+ set(transformedCarData, 150, rateMonthlyInstallment || '0');
58
+ set(transformedCarData, 293, leasingMonthlyInstallment || '0');
57
59
  set(transformedCarData, 1, get(carData, 'metaData.vehicleId', null));
58
60
 
59
61
  if (this.configService.config.campaign === 'eauto' && carData.offer.ftpFolder === 'auto_de_eautos') {
@@ -73,9 +75,9 @@ export class MobileTransformer {
73
75
  }
74
76
  return this.stringToString(fieldValue);
75
77
  }
76
- case 'integerToString': {
77
- return this.numberToString(fieldValue);
78
- }
78
+ case 'stringToInteger':
79
+ case 'integerToString':
80
+ case 'numberToNumber':
79
81
  case 'numberToString': {
80
82
  return this.numberToString(fieldValue);
81
83
  }
@@ -85,6 +87,7 @@ export class MobileTransformer {
85
87
  case 'selectorToSelector': {
86
88
  return this.selectorToSelector(fieldValue, rule);
87
89
  }
90
+ case 'selectorToText':
88
91
  case 'selectorToString': {
89
92
  return this.selectorToString(fieldValue, rule);
90
93
  }
@@ -240,16 +243,16 @@ export class MobileTransformer {
240
243
  return '6';
241
244
  }
242
245
  case 'selector_emissionClass_euro6b': {
243
- return '6b';
246
+ return '6';
244
247
  }
245
248
  case 'selector_emissionClass_euro6c': {
246
- return '6c';
249
+ return '6';
247
250
  }
248
251
  case 'selector_emissionClass_euro6d': {
249
- return '6d';
252
+ return '6';
250
253
  }
251
254
  case 'selector_emissionClass_euro6d_temp': {
252
- return '6d-TEMP';
255
+ return '6';
253
256
  }
254
257
  }
255
258
  }
@@ -381,12 +384,21 @@ export class MobileTransformer {
381
384
 
382
385
  private selectorToSelector(fieldValue: string, rule: MappingRules): string | void {
383
386
  if (fieldValue === 'selector_unknown' && rule.autodeField === 'heatingCooling.climatisation') {
384
- return '';
387
+ return '0';
388
+ }
389
+
390
+ if (fieldValue === 'selector_unknown' && rule.autodeField === 'driveSuspension.wheelFormula') {
391
+ return '0';
385
392
  }
386
393
 
387
- if (fieldValue === 'selector_unknown' || fieldValue === 'selector_interiorColor_rainbow') {
394
+ if (fieldValue === 'selector_interiorColor_rainbow') {
395
+ return '5';
396
+ }
397
+
398
+ if (fieldValue === 'selector_unknown') {
388
399
  return '';
389
400
  }
401
+
390
402
  const pairs = rule.selectors.map(p => p.split(':').reverse());
391
403
  const [match] = pairs.filter(p => p[0] === fieldValue);
392
404
  // consider adding values not mapped in table