@bytebrand/export-cars 1.21.28 → 1.21.30

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.28",
3
+ "version": "1.21.30",
4
4
  "description": "",
5
5
  "author": "bytebrand",
6
6
  "license": "UNLICENSED",
@@ -15,10 +15,11 @@ export class GoogleXmlBuilder extends XMLBuilderBase {
15
15
  return this.getInstallmentElement(key, data);
16
16
  }
17
17
 
18
- if (['additional_image_link', 'vehicle_option'].includes(key))
19
- data.map((value: string) => this.getElement(`g:${key}`, this.escapeXML(value)))
20
-
21
- return this.getElement(`g:${key}`, this.escapeXML(data));
18
+ if (['additional_image_link', 'vehicle_option'].includes(key)) {
19
+ return data.map((value: string) => this.getElement(`g:${key}`, this.escapeXML(value))).join('');
20
+ } else {
21
+ return this.getElement(`g:${key}`, this.escapeXML(data));
22
+ }
22
23
  })
23
24
  .join('');
24
25
 
@@ -320,10 +320,11 @@ export class GoogleTransformer {
320
320
  }
321
321
 
322
322
  private getDateFirstRegistered(car: DataSchemes.Car): string {
323
- const timestamp = +get(car, 'mainData.mileage', '')
323
+ let timestamp = +get(car, 'mainData.firstRegistration', '')
324
324
 
325
- if (!timestamp)
326
- return null
325
+ if (!timestamp) {
326
+ timestamp = moment().unix()
327
+ }
327
328
 
328
329
  const date = new Date(timestamp * 1000);
329
330
  const month = date.getUTCMonth() + 1;