refactor(ui): order types export
[e-mobility-charging-stations-simulator.git] / src / charging-station / ocpp / 1.6 / OCPP16IncomingRequestService.ts
index cfb6efeacfd99700e14d99004d718ac02f3f5409..a33d0c26a60bb362f449c29d65b2bac57dd23e41 100644 (file)
@@ -8,6 +8,8 @@ import type { JSONSchemaType } from 'ajv';
 import { Client, type FTPResponse } from 'basic-ftp';
 import tar from 'tar';
 
+import { OCPP16Constants } from './OCPP16Constants';
+import { OCPP16ServiceUtils } from './OCPP16ServiceUtils';
 import {
   type ChargingStation,
   ChargingStationConfigurationUtils,
@@ -83,7 +85,7 @@ import {
   type UnlockConnectorResponse,
 } from '../../../types';
 import { Constants, Utils, logger } from '../../../utils';
-import { OCPP16Constants, OCPP16ServiceUtils, OCPPIncomingRequestService } from '../internal';
+import { OCPPIncomingRequestService } from '../OCPPIncomingRequestService';
 
 const moduleName = 'OCPP16IncomingRequestService';
 
@@ -275,7 +277,7 @@ export class OCPP16IncomingRequestService extends OCPPIncomingRequestService {
     let response: JsonType;
     if (
       chargingStation.getOcppStrictCompliance() === true &&
-      chargingStation.isInPendingState() === true &&
+      chargingStation.inPendingState() === true &&
       (commandName === OCPP16IncomingRequestCommand.REMOTE_START_TRANSACTION ||
         commandName === OCPP16IncomingRequestCommand.REMOTE_STOP_TRANSACTION)
     ) {
@@ -293,7 +295,7 @@ export class OCPP16IncomingRequestService extends OCPPIncomingRequestService {
     if (
       chargingStation.isRegistered() === true ||
       (chargingStation.getOcppStrictCompliance() === false &&
-        chargingStation.isInUnknownState() === true)
+        chargingStation.inUnknownState() === true)
     ) {
       if (
         this.incomingRequestHandlers.has(commandName) === true &&
@@ -486,9 +488,9 @@ export class OCPP16IncomingRequestService extends OCPPIncomingRequestService {
     );
     if (!keyToChange) {
       return OCPP16Constants.OCPP_CONFIGURATION_RESPONSE_NOT_SUPPORTED;
-    } else if (keyToChange && keyToChange.readonly) {
+    } else if (keyToChange?.readonly === true) {
       return OCPP16Constants.OCPP_CONFIGURATION_RESPONSE_REJECTED;
-    } else if (keyToChange && !keyToChange.readonly) {
+    } else if (keyToChange?.readonly === false) {
       let valueChanged = false;
       if (keyToChange.value !== commandPayload.value) {
         ChargingStationConfigurationUtils.setConfigurationKeyValue(