fix merge regression
MODIFY
src/integration/smart-charging/sap-smart-charging
src/integration/smart-charging/sap-smart-charging
-Subproject commit 9f5d7bb49edf24240b6e67a408c11509540b84fa
+Subproject commit 879f094b38825db4e1ef871cdbbf052b2c5ecd9b

MODIFY
src/utils/Utils.ts
src/utils/Utils.ts
import { AnalyticsSettingsType, AssetSettingsType, BillingSettingsType, PricingSettingsType, RefundSettingsType, RoamingSettingsType, SettingDBContent, SmartChargingContentType } from '../types/Setting';
+import { Car, CarType } from '../types/Car';
import { ChargePointStatus, OCPPProtocol, OCPPVersion } from '../types/ocpp/OCPPServer';
import ChargingStation, { ChargePoint, Connector, ConnectorCurrentLimitSource, CurrentType, StaticLimitAmps } from '../types/ChargingStation';
import User, { UserRole, UserStatus } from '../types/User';
@@ -8,7 +9,6 @@ import AppError from '../exception/AppError';
import Asset from '../types/Asset';
import Authorizations from '../authorization/Authorizations';
import BackendError from '../exception/BackendError';
-import { Car } from '../types/Car';
import { ChargingProfile } from '../types/ChargingProfile';
import Company from '../types/Company';
import Configuration from './Configuration';
@@ -1761,6 +1761,26 @@ export default class Utils {
user: req.user.id
});
}
+ if (!car.type) {
+ throw new AppError({
+ source: Constants.CENTRAL_SERVER,
+ errorCode: HTTPError.GENERAL_ERROR,
+ message: 'Car type is mandatory',
+ module: MODULE_NAME,
+ method: 'checkIfCarValid',
+ user: req.user.id
+ });
+ }
+ if (Authorizations.isBasic(req.user) && car.type === CarType.POOL_CAR) {
+ throw new AppError({
+ source: Constants.CENTRAL_SERVER,
+ errorCode: HTTPError.GENERAL_ERROR,
+ message: 'Pool cars can only be created by admin',
+ module: MODULE_NAME,
+ method: 'checkIfCarValid',
+ user: req.user.id
+ });
+ }
}
private static _isUserEmailValid(email: string): boolean {

fix merge regression