@bytebrand/export-cars 1.17.1 → 1.18.1
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/configs/evium.config.d.ts +5 -0
- package/dist/configs/evium.config.js +18 -0
- package/dist/configs/evium.config.js.map +1 -0
- package/dist/configs/index.d.ts +1 -0
- package/dist/configs/index.js +1 -0
- package/dist/configs/index.js.map +1 -1
- package/dist/export.schema.d.ts +5 -1
- package/dist/export.schema.js +4 -0
- package/dist/export.schema.js.map +1 -1
- package/dist/transformers/meinstadt.transformer.d.ts +3 -2
- package/dist/transformers/meinstadt.transformer.js +13 -10
- package/dist/transformers/meinstadt.transformer.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/configs/evium.config.ts +15 -0
- package/src/configs/index.ts +1 -0
- package/src/export.schema.ts +6 -1
- package/src/transformers/meinstadt.transformer.ts +13 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bytebrand/export-cars",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.18.1",
|
|
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": "
|
|
63
|
+
"gitHead": "235a547ce8b6d19ab722e9d4ab722364f2f935e2"
|
|
64
64
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ExportType, FileType, ImageType } from 'src/enums';
|
|
2
|
+
import { Params } from '../interfaces/params.interface';
|
|
3
|
+
import { Config } from './config';
|
|
4
|
+
|
|
5
|
+
export class EviumConfig extends Config {
|
|
6
|
+
constructor(params: Params) {
|
|
7
|
+
super(params);
|
|
8
|
+
this.campaign = ExportType.EVIUM;
|
|
9
|
+
this.pathesConfig.localConvertedDirectory = `resources/${ExportType.EVIUM}-export`;
|
|
10
|
+
this.imageUrl = `https://images.${this.domain}/carimage`;
|
|
11
|
+
this.mappingSpreadsheetTitle = 'mobile_yescar';
|
|
12
|
+
this.imageType = ImageType.default;
|
|
13
|
+
this.outputFiles = [`${this.pathesConfig.localConvertedDirectory}/10022.${FileType.CSV}`];
|
|
14
|
+
}
|
|
15
|
+
}
|
package/src/configs/index.ts
CHANGED
package/src/export.schema.ts
CHANGED
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
TrovitConfig,
|
|
22
22
|
MitulaConfig,
|
|
23
23
|
AwinConfig,
|
|
24
|
+
EviumConfig,
|
|
24
25
|
} from './configs';
|
|
25
26
|
import {
|
|
26
27
|
As24Exporter,
|
|
@@ -119,5 +120,9 @@ export const exportSchema = {
|
|
|
119
120
|
[ExportType.AWIN]: {
|
|
120
121
|
config: AwinConfig,
|
|
121
122
|
exporter: AwinExporter,
|
|
122
|
-
},
|
|
123
|
+
},
|
|
124
|
+
[ExportType.EVIUM]: {
|
|
125
|
+
config: EviumConfig,
|
|
126
|
+
exporter: MobileExporter,
|
|
127
|
+
},
|
|
123
128
|
};
|
|
@@ -2,16 +2,21 @@ import { get, toString } from 'lodash';
|
|
|
2
2
|
|
|
3
3
|
import { Injectable } from '@nestjs/common';
|
|
4
4
|
|
|
5
|
+
import { CarDescriptionFactory, DescriptionTypeEnum } from '@bytebrand/car-description';
|
|
5
6
|
import { ImboImageResponseInterface } from '@bytebrand/chunkable';
|
|
6
7
|
import { DataSchemes } from '@bytebrand/car-schema';
|
|
7
8
|
import { de } from '@bytebrand/i18n-dictionaries';
|
|
8
9
|
|
|
9
|
-
import { ConfigService, ImagesService } from '../services';
|
|
10
|
+
import { ConfigService, ImagesService, UserService } from '../services';
|
|
10
11
|
import { MeinstadtJsonItem } from '../interfaces';
|
|
11
12
|
|
|
12
13
|
@Injectable()
|
|
13
14
|
export class MeinstadtTransformer {
|
|
14
|
-
constructor(
|
|
15
|
+
constructor(
|
|
16
|
+
private configService: ConfigService,
|
|
17
|
+
private readonly imageService: ImagesService,
|
|
18
|
+
private userService: UserService
|
|
19
|
+
) {}
|
|
15
20
|
|
|
16
21
|
async transform({
|
|
17
22
|
car,
|
|
@@ -42,7 +47,7 @@ export class MeinstadtTransformer {
|
|
|
42
47
|
power: get(car, 'engineData.powerPS', null),
|
|
43
48
|
co2Emissions: get(car, 'environmentEmissions.co2', null),
|
|
44
49
|
fuelConsumptionCombined: get(car, 'consumption.consumptionCombined', null),
|
|
45
|
-
equipment: this.getDescription(car),
|
|
50
|
+
equipment: await this.getDescription(car),
|
|
46
51
|
color: this.translate(get(car, 'exterior.exteriorColor', null)),
|
|
47
52
|
bodyType: this.translate(get(car, 'mainData.category', null)),
|
|
48
53
|
emissionClass: this.translate(get(car, 'environmentEmissions.emissionClass', null)),
|
|
@@ -78,10 +83,10 @@ export class MeinstadtTransformer {
|
|
|
78
83
|
return condition;
|
|
79
84
|
}
|
|
80
85
|
|
|
81
|
-
private getDescription(car: DataSchemes.Car): string {
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
+
private async getDescription(car: DataSchemes.Car): Promise<string> {
|
|
87
|
+
const dealerId = get(car, 'metaData.ownerId');
|
|
88
|
+
const descriptionSchema = await this.userService.getDefaultSummaryByDealerId(dealerId);
|
|
89
|
+
const descriptionBuilder = CarDescriptionFactory.create(DescriptionTypeEnum.Mobile, car);
|
|
90
|
+
return descriptionBuilder.transform(descriptionSchema);
|
|
86
91
|
}
|
|
87
92
|
}
|