@bytebrand/export-cars 1.21.6 → 1.21.7

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.21.6",
3
+ "version": "1.21.7",
4
4
  "description": "",
5
5
  "author": "bytebrand",
6
6
  "license": "UNLICENSED",
@@ -57,5 +57,5 @@
57
57
  "engines": {
58
58
  "node": ">=14.0.0"
59
59
  },
60
- "gitHead": "3e501f070195d64033e9efbd5bf62cbde7fd8422"
60
+ "gitHead": "8f50de7a1e1f1a2e9cae4650332663d5f2901c76"
61
61
  }
@@ -37,7 +37,9 @@ export class AutouncleExporter implements Exporter {
37
37
 
38
38
  for (const data of chunk.data) {
39
39
  const ownerId = get(data.car, 'metaData.ownerId');
40
- const owner = await this.carService.getOwner(ownerId);
40
+ // NOTES:: it must be temporary solution
41
+ const owner = await this.carService.getOwner(ownerId).catch((error: any) => { console.error(error); return null; });
42
+ if (!owner) { console.log(`Skip car because owner ${ownerId} is not a dealer`); continue; }
41
43
  // console.time(`Transform ${data.car._id}`);
42
44
  const car = await autouncleTransformer.transform({ owner, ...data });
43
45
  // console.timeEnd(`Transform ${data.car._id}`);
@@ -33,11 +33,13 @@ export class FbExporter implements Exporter {
33
33
  const chunkData = chunk.data.filter(car => this.carService.filterCar(car, this.rulesService.rules));
34
34
  chunk.data = null;
35
35
  for (const data of chunkData) {
36
+ console.time(`Transform ${data.car._id}`);
36
37
  const ownerId = get(data.car, 'metaData.ownerId', null);
37
- const owner = await this.carService.getOwner(ownerId);
38
- // console.time(`Transform ${data.car._id}`);
38
+ // NOTES:: it must be temporary solution
39
+ const owner = await this.carService.getOwner(ownerId).catch((error: any) => { console.error(error); return null; });
40
+ if (!owner) { console.log(`Skip car because owner ${ownerId} is not a dealer`); continue; }
39
41
  const car = await fbTransformer.transform({ owner, ...data });
40
- // console.timeEnd(`Transform ${data.car._id}`);
42
+ console.timeEnd(`Transform ${data.car._id}`);
41
43
 
42
44
  await fbXmlBuilder.addItem(car as FbXmlItem);
43
45
  this.carService.counter.countCar(data.images);