@bytebrand/export-cars 1.21.75 → 1.21.77
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
|
@@ -61,11 +61,15 @@ export class SantanderTransformer {
|
|
|
61
61
|
for (const rule of rules) {
|
|
62
62
|
const importFieldNumber = Number(rule.importField.match(/\d+/)[0]);
|
|
63
63
|
|
|
64
|
-
if (
|
|
65
|
-
console.log(
|
|
64
|
+
if (this.checkFieldsOnlyForNew(importFieldNumber) && !isNew) {
|
|
65
|
+
console.log(`${carData._id} - ${rule.importField} - ${importFieldNumber}`);
|
|
66
66
|
continue;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
if (isNew && this.checkFieldsOnlyForNew(importFieldNumber)) {
|
|
70
|
+
console.log(`NEW - ${rule.importField} - ${importFieldNumber}`);
|
|
71
|
+
}
|
|
72
|
+
|
|
69
73
|
if (rule.custom === 'yes') {
|
|
70
74
|
const transformedField = await this.customTransformers(rule, carData, images);
|
|
71
75
|
if (transformedField) {
|
|
@@ -101,12 +105,12 @@ export class SantanderTransformer {
|
|
|
101
105
|
}
|
|
102
106
|
|
|
103
107
|
private async checkFieldsOnlyForNew(importFieldNumber: number) {
|
|
104
|
-
const fieldsOnlyForNewCar =
|
|
108
|
+
const fieldsOnlyForNewCar = [
|
|
105
109
|
336, 337, 338, 339, 313, 320, 405, 468, 469, 470, 471, 472, 473, 474, 475,
|
|
106
110
|
513, 514, 515, 516, 517, 520, 521, 522, 523, 524, 525, 526, 527
|
|
107
|
-
]
|
|
111
|
+
];
|
|
108
112
|
|
|
109
|
-
return fieldsOnlyForNewCar.
|
|
113
|
+
return fieldsOnlyForNewCar.includes(importFieldNumber);
|
|
110
114
|
}
|
|
111
115
|
|
|
112
116
|
private async transformField(fieldValue: any, rule: MappingRules): Promise<string | void> {
|