@bytebrand/export-cars 1.16.1 → 1.16.2

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.16.1",
3
+ "version": "1.16.2",
4
4
  "description": "",
5
5
  "author": "bytebrand",
6
6
  "license": "UNLICENSED",
@@ -60,5 +60,5 @@
60
60
  "engines": {
61
61
  "node": ">=14.0.0"
62
62
  },
63
- "gitHead": "176c968f9007bf8291198d399c82981869307f5b"
63
+ "gitHead": "8c947934f2ea40b0bf888e704d076d0487d50836"
64
64
  }
@@ -28,4 +28,5 @@ export enum ExportType {
28
28
  TROVIT = 'trovit',
29
29
  MITULA = 'mitula',
30
30
  AWIN = 'awin',
31
+ EVIUM = 'evium',
31
32
  }
@@ -11,6 +11,7 @@ import { MappingService, UserService, ImagesService } from '../services';
11
11
  import { MappingRules } from '../interfaces/mapping-rules.interface';
12
12
  import { isNotEmptyArray } from '../utils';
13
13
  import { ConfigService } from '../services';
14
+ import { ExportType } from '../enums';
14
15
 
15
16
  const vinGenerator = require('vin-generator');
16
17
 
@@ -184,7 +185,7 @@ export class MobileTransformer {
184
185
 
185
186
  private async getPersistentId(car: DataSchemes.Car) {
186
187
  switch (this.configService.config.campaign) {
187
- case 'eauto':
188
+ case ExportType.EAUTO:
188
189
  if (car.offer.ftpFolder === 'auto_de_eautos') {
189
190
  const dealers = await this.mappingService.getDealersMapping();
190
191
  const dealerId = dealers.find(dealer => dealer.firebaseUserId === car.metaData.ownerId)?.dealerId;
@@ -193,8 +194,12 @@ export class MobileTransformer {
193
194
  }
194
195
  }
195
196
  return '416';
196
- default:
197
+ case ExportType.MARKTDE:
197
198
  return '04109003';
199
+ case ExportType.EVIUM:
200
+ return '10022';
201
+ default:
202
+ throw new Error(`Wrong export type ${this.configService.config.campaign}`);
198
203
  }
199
204
  }
200
205