@bytebrand/export-cars 1.21.49 → 1.21.51
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/formats/google-xml.builder.d.ts +1 -0
- package/dist/formats/google-xml.builder.js +10 -0
- package/dist/formats/google-xml.builder.js.map +1 -1
- package/dist/interfaces/export-item.interface.d.ts +6 -0
- package/dist/transformers/google.transformer.js +5 -0
- package/dist/transformers/google.transformer.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/formats/google-xml.builder.ts +17 -0
- package/src/interfaces/export-item.interface.ts +6 -0
- package/src/transformers/google.transformer.ts +5 -0
package/package.json
CHANGED
|
@@ -11,6 +11,10 @@ export class GoogleXmlBuilder extends XMLBuilderBase {
|
|
|
11
11
|
async addItem(item: FbXmlItem | GoogleXmlItem | CriteoXmlItem): Promise<void> {
|
|
12
12
|
const listing: string = Object.entries(item)
|
|
13
13
|
.map(([key, data]): string => {
|
|
14
|
+
if (key === 'certification') {
|
|
15
|
+
return this.getCertificationElement(key, data);
|
|
16
|
+
}
|
|
17
|
+
|
|
14
18
|
if (key === 'installment') {
|
|
15
19
|
return this.getInstallmentElement(key, data);
|
|
16
20
|
}
|
|
@@ -45,6 +49,19 @@ export class GoogleXmlBuilder extends XMLBuilderBase {
|
|
|
45
49
|
</g:${rootTag}>`;
|
|
46
50
|
}
|
|
47
51
|
|
|
52
|
+
private getCertificationElement(rootTag: string, data: {
|
|
53
|
+
certification_authority: string;
|
|
54
|
+
certification_name: string;
|
|
55
|
+
certification_code?: string;
|
|
56
|
+
certification_value?: string;
|
|
57
|
+
}): string {
|
|
58
|
+
return `<g:${rootTag}>
|
|
59
|
+
<g:certification_authority>${data.certification_authority}</g:certification_authority>
|
|
60
|
+
<g:certification_name>${data.certification_name}</g:certification_name>
|
|
61
|
+
<g:certification_value>${data.certification_value}</g:certification_value>
|
|
62
|
+
</g:${rootTag}>`;
|
|
63
|
+
}
|
|
64
|
+
|
|
48
65
|
private getInstallmentElement(rootTag: string, data: { paybackPeriod: string; monthlyInstallment: string }): string {
|
|
49
66
|
return `<g:${rootTag}>
|
|
50
67
|
<g:months>${data.paybackPeriod}</g:months>
|
|
@@ -178,6 +178,12 @@ export interface GoogleXmlItem {
|
|
|
178
178
|
option: string;
|
|
179
179
|
store_code: string;
|
|
180
180
|
};
|
|
181
|
+
certification: {
|
|
182
|
+
certification_authority: string;
|
|
183
|
+
certification_name: string;
|
|
184
|
+
certification_code?: string;
|
|
185
|
+
certification_value?: string;
|
|
186
|
+
};
|
|
181
187
|
link_template: string;
|
|
182
188
|
additional_image_link: string[];
|
|
183
189
|
model: string;
|
|
@@ -44,6 +44,11 @@ export class GoogleTransformer {
|
|
|
44
44
|
option: 'online',
|
|
45
45
|
store_code: 'Online_shop'
|
|
46
46
|
},
|
|
47
|
+
certification: {
|
|
48
|
+
certification_authority: 'BMWK',
|
|
49
|
+
certification_name: 'Vehicle_CO2_Class',
|
|
50
|
+
certification_value: `${this.getEnergyClass(car)}`
|
|
51
|
+
},
|
|
47
52
|
title: this.getTitle(car),
|
|
48
53
|
product_type: this.getCategory(car),
|
|
49
54
|
VIN: this.transformService.vinCode(car),
|