@bytebrand/export-cars 1.21.44 → 1.21.46

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.44",
3
+ "version": "1.21.46",
4
4
  "description": "",
5
5
  "author": "bytebrand",
6
6
  "license": "UNLICENSED",
@@ -15,6 +15,10 @@ export class GoogleXmlBuilder extends XMLBuilderBase {
15
15
  return this.getInstallmentElement(key, data);
16
16
  }
17
17
 
18
+ if (key === 'vehicle_fulfillment') {
19
+ return this.getVehicleFulfillmentElement(key, data);
20
+ }
21
+
18
22
  if (['additional_image_link', 'vehicle_option'].includes(key)) {
19
23
  return data.map((value: string) => this.getElement(`g:${key}`, this.escapeXML(value))).join('');
20
24
  } else {
@@ -31,6 +35,16 @@ export class GoogleXmlBuilder extends XMLBuilderBase {
31
35
  await this.end();
32
36
  }
33
37
 
38
+ private getVehicleFulfillmentElement(rootTag: string, data: {
39
+ option: string;
40
+ store_code: string;
41
+ }): string {
42
+ return `<g:${rootTag}>
43
+ <g:option>${data.option}</g:option>
44
+ <g:store_code>${data.store_code} EUR</g:store_code>
45
+ </g:${rootTag}>`;
46
+ }
47
+
34
48
  private getInstallmentElement(rootTag: string, data: { paybackPeriod: string; monthlyInstallment: string }): string {
35
49
  return `<g:${rootTag}>
36
50
  <g:months>${data.paybackPeriod}</g:months>
@@ -174,8 +174,10 @@ export interface GoogleXmlItem {
174
174
  energy_efficiency_class?: string;
175
175
  installment?: { paybackPeriod: any; monthlyInstallment: any };
176
176
 
177
- vehicle_fulfillment: string;
178
- store_code: string;
177
+ vehicle_fulfillment: {
178
+ option: string;
179
+ store_code: string;
180
+ };
179
181
  link_template: string;
180
182
  additional_image_link: string[];
181
183
  model: string;
@@ -40,8 +40,10 @@ export class GoogleTransformer {
40
40
 
41
41
  return {
42
42
  google_product_category: '916',
43
- vehicle_fulfillment: 'online',
44
- store_code: 'Online_shop',
43
+ vehicle_fulfillment: {
44
+ option: 'online',
45
+ store_code: 'Online_shop'
46
+ },
45
47
  title: this.getTitle(car),
46
48
  product_type: this.getCategory(car),
47
49
  VIN: this.transformService.vinCode(car),
@@ -50,7 +52,7 @@ export class GoogleTransformer {
50
52
  additional_image_link: transformedImages.slice(1, 10),
51
53
  ads_redirect: this.getLink(car),
52
54
  link: this.getLink(car),
53
- link_template: `${this.getLink(car)}?store=Online_shop`,
55
+ link_template: `${this.getLink(car)}?store={store_code}`,
54
56
  condition: this.mapState(car),
55
57
  price: this.getPrice(car),
56
58
  // certified_pre-owned: '',