@bytebrand/export-cars 1.16.0 → 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.0",
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": "5680df3275c11c1d0140bc4b1e43b829388153bc"
63
+ "gitHead": "8c947934f2ea40b0bf888e704d076d0487d50836"
64
64
  }
@@ -10,7 +10,7 @@ export const VehicleClassList: IModixItemsList = {
10
10
  selector_vehicleClass_motorBike: { value: 'Motorbike', atributes: { id: 5 } },
11
11
  selector_vehicleClass_forklift: { value: 'Forklift', atributes: { id: 13 } },
12
12
  selector_vehicleClass_camperVan: { value: 'Caravan', atributes: { id: 4 } },
13
- selector_vehicleClass_car: { value: 'Passenger car', atributes: { id: 2 } },
13
+ selector_vehicleClass_car: { value: 'Passenger car', atributes: { id: 1 } },
14
14
  selector_vehicleClass_trailer: { value: 'Trailer', atributes: { id: 8 } },
15
15
  selector_vehicleClass_bus: { value: 'Bus', atributes: { id: 11 } },
16
16
  selector_unknown: { value: 'Passenger car', atributes: { id: 1 } },
@@ -28,4 +28,5 @@ export enum ExportType {
28
28
  TROVIT = 'trovit',
29
29
  MITULA = 'mitula',
30
30
  AWIN = 'awin',
31
+ EVIUM = 'evium',
31
32
  }
@@ -136,16 +136,10 @@ export class ModixXmlBuilder extends XMLBuilderBase {
136
136
  }
137
137
 
138
138
  mapImages(imageData: imageItem) {
139
- let item = `\n<media>\n<images url="${imageData.url}">\n`;
139
+ let item = `\n<media>\n<images url="${imageData.url}/">\n`;
140
140
 
141
- item += '\n<meta>\n';
142
141
  imageData.imageList.forEach(image => {
143
- item += `<media name="${image.atributes?.name}" position="${image.atributes?.position}" />`;
144
- });
145
- item += '\n</meta>\n';
146
-
147
- imageData.imageList.forEach(image => {
148
- item += `<media name="${image.atributes?.name}" position="${image.atributes?.position}" />\n`;
142
+ item += `<image name="${image.atributes?.name}" />\n`;
149
143
  });
150
144
 
151
145
  item += '\n</images>\n</media>';
@@ -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