@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/dist/exporters/autouncle.exporter.js +5 -1
- package/dist/exporters/autouncle.exporter.js.map +1 -1
- package/dist/exporters/fb.exporter.js +7 -1
- package/dist/exporters/fb.exporter.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/exporters/autouncle.exporter.ts +3 -1
- package/src/exporters/fb.exporter.ts +5 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bytebrand/export-cars",
|
|
3
|
-
"version": "1.21.
|
|
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": "
|
|
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
|
-
|
|
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
|
-
|
|
38
|
-
|
|
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
|
-
|
|
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);
|