Save converter attribute in car create/update
DELETE
src/integration/smart-charging/sap-smart-charging
-Subproject commit 0d0ffb92dff67cb80d2284c0c9be80dbadda446b

MODIFY
src/server/rest/service/CarService.ts
src/server/rest/service/CarService.ts
@@ -48,7 +48,7 @@ export default class CarService {
{ limit: filteredRequest.Limit, skip: filteredRequest.Skip, sort: filteredRequest.Sort, onlyRecordCount: filteredRequest.OnlyRecordCount },
['id', 'vehicleModel', 'vehicleMake', 'vehicleModelVersion', 'batteryCapacityFull', 'fastchargeChargeSpeed', 'performanceTopspeed',
'performanceAcceleration', 'rangeWLTP', 'rangeReal', 'efficiencyReal', 'image', 'chargeStandardChargeSpeed',
- 'chargeStandardPower', 'chargeStandardPhase', 'chargePlug', 'fastChargePlug', 'fastChargePowerMax', 'drivetrainPowerHP']
+ 'chargeStandardPower', 'chargeStandardPhase', 'chargePlug', 'fastChargePlug','chargeStandardTables', 'fastChargePowerMax', 'drivetrainPowerHP']
);
// Filter
CarSecurity.filterCarCatalogsResponse(carCatalogs, req.user);
@@ -252,6 +252,7 @@ export default class CarService {
vin: filteredRequest.vin,
createdBy: { id: req.user.id },
type: filteredRequest.type,
+ converterType: filteredRequest.converterType,
createdOn: new Date()
} as Car;
newCar.id = await CarStorage.saveCar(req.user.tenantID, newCar);
@@ -326,6 +327,7 @@ export default class CarService {
car.vin = filteredRequest.vin;
car.licensePlate = filteredRequest.licensePlate;
car.type = filteredRequest.type;
+ car.converterType = filteredRequest.converterType;
car.lastChangedBy = { 'id': req.user.id };
car.lastChangedOn = new Date();
await CarStorage.saveCar(req.user.tenantID, car);

MODIFY
src/server/rest/service/security/CarSecurity.ts
src/server/rest/service/security/CarSecurity.ts
@@ -142,7 +142,8 @@ export default class CarSecurity {
rangeWLTP: carCatalog.rangeWLTP,
efficiencyReal: carCatalog.efficiencyReal,
image: carCatalog.image,
- chargeStandardChargeSpeed: carCatalog.chargeStandardChargeSpeed
+ chargeStandardChargeSpeed: carCatalog.chargeStandardChargeSpeed,
+ chargeStandardTables: carCatalog.chargeStandardTables
});
}
}
@@ -156,7 +157,8 @@ export default class CarSecurity {
carCatalogID: Utils.convertToInt(sanitize(request.carCatalogID)),
forced: UtilsSecurity.filterBoolean(request.forced),
type: sanitize(request.type),
- isDefault: UtilsSecurity.filterBoolean(request.isDefault)
+ isDefault: UtilsSecurity.filterBoolean(request.isDefault),
+ converterType: sanitize(request.converterType)
};
}
@@ -167,7 +169,8 @@ export default class CarSecurity {
carCatalogID: Utils.convertToInt(sanitize(request.carCatalogID)),
type: sanitize(request.type),
isDefault: UtilsSecurity.filterBoolean(request.isDefault),
- id: sanitize(request.id)
+ id: sanitize(request.id),
+ converterType: sanitize(request.converterType)
};
}

MODIFY
src/storage/mongodb/CarStorage.ts
src/storage/mongodb/CarStorage.ts
@@ -464,7 +464,8 @@ export default class CarStorage {
vin: carToSave.vin,
licensePlate: carToSave.licensePlate,
carCatalogID: Utils.convertToInt(carToSave.carCatalogID),
- type: carToSave.type
+ type: carToSave.type,
+ converterType: carToSave.converterType
};
// Add Last Changed/Created props
DatabaseUtils.addLastChangedCreatedProps(carMDB, carToSave);

MODIFY
src/types/Car.ts
src/types/Car.ts
@@ -137,6 +137,7 @@ export interface Car extends CreatedUpdatedProps {
userIDs?: string;
users?: User[];
type?: CarType;
+ converterType?: string;
}
export interface UserCar extends CreatedUpdatedProps {

MODIFY
src/types/requests/HttpCarRequest.ts
src/types/requests/HttpCarRequest.ts
@@ -31,6 +31,7 @@ export interface HttpCarCreateRequest {
type: CarType;
isDefault: boolean;
id?: string;
+ converterType?: string;
}
export interface HttpUsersAssignRequest {

Save converter attribute in car create/update