@bytebrand/export-cars 1.13.1 → 1.14.0

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.13.1",
3
+ "version": "1.14.0",
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": "9a45a4d8483e92f07736178bb0c23ec95a4a2cd8"
63
+ "gitHead": "ac380c329847df0be03df194e40ce6a8d1e6f6ed"
64
64
  }
@@ -39,7 +39,7 @@ export class GoogleTransformer {
39
39
  image_link: transformedImages[0],
40
40
  condition: this.mapState(car),
41
41
  availability: this.getAvailability(car),
42
- brand: get(car, 'mainData.make', ''),
42
+ brand: this.getBrand(car),
43
43
  price: this.getRetailPrice(car),
44
44
  sales_price: this.getPrice(car),
45
45
  energy_efficiency_class: this.getEnergyClass(car),
@@ -145,12 +145,25 @@ export class GoogleTransformer {
145
145
  }
146
146
 
147
147
  private getInstallment(car: DataSchemes.Car) {
148
- const monthlyInstallment = round(get(car, 'financing.monthlyInstallment', null));
149
- const paybackPeriod = round(get(car, 'financing.paybackPeriod', null));
148
+ const monthlyInstallment = round(get(car, 'rate.monthlyInstallment', null));
149
+ const paybackPeriod = round(get(car, 'rate.paybackPeriod', null));
150
150
 
151
151
  return {
152
152
  paybackPeriod,
153
153
  monthlyInstallment,
154
154
  };
155
155
  }
156
+
157
+ private getBrand(car: DataSchemes.Car): string {
158
+ const make = get(car, 'mainData.make', '');
159
+
160
+ switch (make) {
161
+ case 'Mercedes-Benz':
162
+ return 'Mercedes';
163
+ case 'Volkswagen':
164
+ return 'VW';
165
+ default:
166
+ return make;
167
+ }
168
+ }
156
169
  }