@bytebrand/export-cars 1.14.1 → 1.14.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.14.1",
3
+ "version": "1.14.3",
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": "44c930384611b8704c361f056636f999d0d2522a"
63
+ "gitHead": "41bb5595531e3955d5b71e10bd6f3166b0278f0d"
64
64
  }
@@ -195,7 +195,7 @@ export interface RubrikkXmlItem {
195
195
  motoring__make: string;
196
196
  motoring__mileage_kilometers: number;
197
197
  motoring__model: string;
198
- motoring__model_year: number;
198
+ motoring__model_year: string;
199
199
  motoring__number_of_doors: number;
200
200
  motoring__number_of_seats: number;
201
201
  motoring__power_kw: number;
@@ -261,7 +261,7 @@ export class FbTransformer {
261
261
  car: DataSchemes.Car,
262
262
  owner: unknown,
263
263
  ): Promise<{
264
- address: { city: string; addr1: unknown; region: string; country: string; postal_code: string };
264
+ address: { city: string; region: string; country: string; postal_code: string };
265
265
  latitude: number;
266
266
  longitude: number;
267
267
  }> {
@@ -271,11 +271,9 @@ export class FbTransformer {
271
271
  }
272
272
  let city: string = get(owner, `${addressPath}.city`, '');
273
273
  let zip: string = get(owner, `${addressPath}.zip`, '');
274
- let addr1 = get(owner, `${addressPath}.street`, '');
275
274
  let locationEntity = await this.getLocationByInfo({ city, zip: toSafeInteger(zip) });
276
275
 
277
276
  if (this.isEmptyLocation(locationEntity)) {
278
- addr1 = DEFAULT_ADDR1;
279
277
  city = DEFAULT_CITY;
280
278
  zip = DEFAULT_ZIP;
281
279
  locationEntity = await this.getLocationByInfo({ city, zip: toSafeInteger(zip) });
@@ -287,7 +285,6 @@ export class FbTransformer {
287
285
  ...coords,
288
286
  address: {
289
287
  city,
290
- addr1,
291
288
  region: get(locationEntity, 'Place Name', ''),
292
289
  country: country || 'Deutschland',
293
290
  postal_code: zip,
@@ -171,12 +171,12 @@ export class RubrikkTransformer {
171
171
  return get(available, transmission);
172
172
  }
173
173
 
174
- private getYear(car: DataSchemes.Car): number {
174
+ private getYear(car: DataSchemes.Car): string {
175
175
  const firstRegistration = get(car, 'mainData.firstRegistration') as number;
176
176
  if (isNumber(firstRegistration)) {
177
- return toSafeInteger(moment(firstRegistration * 1000).format('YYYY'));
177
+ return moment(firstRegistration * 1000).format('YYYY');
178
178
  }
179
- return null;
179
+ return moment().format('YYYY');
180
180
  }
181
181
 
182
182
  private getDriveType(car: DataSchemes.Car): string {