Save Force Inactive flag value
MODIFY
src/server/rest/service/ChargingStationService.ts
src/server/rest/service/ChargingStationService.ts
@@ -101,6 +101,9 @@ export default class ChargingStationService {
if (Utils.objectHasProperty(filteredRequest, 'excludeFromSmartCharging')) {
chargingStation.excludeFromSmartCharging = filteredRequest.excludeFromSmartCharging;
}
+ if (Utils.objectHasProperty(filteredRequest, 'forceInactive')) {
+ chargingStation.forceInactive = filteredRequest.forceInactive;
+ }
// Update Site Area
if (siteArea) {
chargingStation.siteAreaID = siteArea.id;

MODIFY
src/server/rest/service/security/ChargingStationSecurity.ts
src/server/rest/service/security/ChargingStationSecurity.ts
@@ -72,6 +72,7 @@ export default class ChargingStationSecurity {
filteredChargingStation.chargePointModel = chargingStation.chargePointModel;
filteredChargingStation.public = chargingStation.public;
filteredChargingStation.excludeFromSmartCharging = chargingStation.excludeFromSmartCharging;
+ filteredChargingStation.forceInactive = chargingStation.forceInactive;
filteredChargingStation.siteAreaID = chargingStation.siteAreaID;
filteredChargingStation.coordinates = chargingStation.coordinates;
if (chargingStation.ocpiData) {
@@ -361,6 +362,9 @@ export default class ChargingStationSecurity {
if (Utils.objectHasProperty(request, 'excludeFromSmartCharging')) {
filteredRequest.excludeFromSmartCharging = UtilsSecurity.filterBoolean(request.excludeFromSmartCharging);
}
+ if (Utils.objectHasProperty(request, 'forceInactive')) {
+ filteredRequest.forceInactive = UtilsSecurity.filterBoolean(request.forceInactive);
+ }
if (Utils.objectHasProperty(request, 'public')) {
filteredRequest.public = UtilsSecurity.filterBoolean(request.public);
}

MODIFY
src/storage/mongodb/ChargingStationStorage.ts
src/storage/mongodb/ChargingStationStorage.ts
@@ -469,6 +469,7 @@ export default class ChargingStationStorage {
chargingStationURL: chargingStationToSave.chargingStationURL,
maximumPower: Utils.convertToInt(chargingStationToSave.maximumPower),
excludeFromSmartCharging: Utils.convertToBoolean(chargingStationToSave.excludeFromSmartCharging),
+ forceInactive: Utils.convertToBoolean(chargingStationToSave.forceInactive),
powerLimitUnit: chargingStationToSave.powerLimitUnit,
voltage: Utils.convertToInt(chargingStationToSave.voltage),
connectors: chargingStationToSave.connectors ? chargingStationToSave.connectors.map(

MODIFY
src/types/ChargingStation.ts
src/types/ChargingStation.ts
@@ -36,6 +36,7 @@ export default interface ChargingStation extends CreatedUpdatedProps {
lastHeartBeat: Date;
deleted: boolean;
inactive: boolean;
+ forceInactive: boolean;
lastReboot: Date;
chargingStationURL: string;
maximumPower: number;

MODIFY
src/types/requests/HttpChargingStationRequest.ts
src/types/requests/HttpChargingStationRequest.ts
@@ -43,6 +43,7 @@ export interface HttpChargingStationParamsUpdateRequest {
maximumPower: number;
public: boolean;
excludeFromSmartCharging: boolean;
+ forceInactive: boolean;
siteAreaID: string;
coordinates: number[];
connectors: {

Save Force Inactive flag value