@bytebrand/export-cars 1.21.32 → 1.21.34
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
|
@@ -27,8 +27,9 @@ export class GoogleTransformer {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
async transform({ car, images }: { car: DataSchemes.Car; images: Array<any> }): Promise<GoogleXmlItem> {
|
|
30
|
-
if (!this.
|
|
31
|
-
|
|
30
|
+
if (!this.configService.config.isCriteo)
|
|
31
|
+
if (!this.checkCarValidity(car, images))
|
|
32
|
+
return null
|
|
32
33
|
|
|
33
34
|
const carId = toString(get(car, '_id', ''));
|
|
34
35
|
const transformedImages = await this.imageService.getImages(
|
|
@@ -39,7 +40,7 @@ export class GoogleTransformer {
|
|
|
39
40
|
);
|
|
40
41
|
|
|
41
42
|
return {
|
|
42
|
-
google_product_category:
|
|
43
|
+
google_product_category: '916',
|
|
43
44
|
title: this.getTitle(car),
|
|
44
45
|
product_type: this.getCategory(car),
|
|
45
46
|
VIN: this.transformService.vinCode(car),
|
|
@@ -76,14 +77,14 @@ export class GoogleTransformer {
|
|
|
76
77
|
// availability: this.getAvailability(car),
|
|
77
78
|
// sale_price: this.getPrice(car),
|
|
78
79
|
// energy_efficiency_class: this.getEnergyClass(car),
|
|
79
|
-
|
|
80
|
+
installment: this.getInstallment(car),
|
|
80
81
|
// custom_label_0: `${this.getInstallment(car)} EUR mtl.`,
|
|
81
82
|
};
|
|
82
83
|
}
|
|
83
84
|
|
|
84
85
|
private checkCarValidity(car: DataSchemes.Car, images: ImboImageResponseInterface[]) {
|
|
85
|
-
if (images.length === 0)
|
|
86
|
-
|
|
86
|
+
// if (images.length === 0)
|
|
87
|
+
// return false
|
|
87
88
|
|
|
88
89
|
if (!this.mapBodyStyle(car))
|
|
89
90
|
return false
|