refactor: remove unneeded intermediate variable in id tags cache code
[e-mobility-charging-stations-simulator.git] / src / charging-station / ChargingStation.ts
index cc7177119093e12df8e64d613b0c01e09294950a..61a4d962137ed2946a6755285420b32332a31245 100644 (file)
@@ -164,16 +164,16 @@ export class ChargingStation {
   public logPrefix = (): string => {
     return Utils.logPrefix(
       ` ${
-        (Utils.isNotEmptyString(this?.stationInfo?.chargingStationId) &&
-          this?.stationInfo?.chargingStationId) ??
-        ChargingStationUtils.getChargingStationId(this.index, this.getTemplateFromFile()) ??
-        ''
+        (Utils.isNotEmptyString(this?.stationInfo?.chargingStationId)
+          ? this?.stationInfo?.chargingStationId
+          : ChargingStationUtils.getChargingStationId(this.index, this.getTemplateFromFile())) ??
+        'Error at building log prefix'
       } |`
     );
   };
 
   public hasIdTags(): boolean {
-    const idTagsFile = ChargingStationUtils.getAuthorizationFile(this.stationInfo);
+    const idTagsFile = ChargingStationUtils.getIdTagsFile(this.stationInfo);
     return Utils.isNotEmptyArray(this.idTagsCache.getIdTags(idTagsFile));
   }
 
@@ -866,18 +866,10 @@ export class ChargingStation {
       logger.error(`${this.logPrefix()} ${errorMsg}`);
       throw new BaseError(errorMsg);
     }
-    // Deprecation template keys section
-    ChargingStationUtils.warnDeprecatedTemplateKey(
-      stationTemplate,
-      'supervisionUrl',
+    ChargingStationUtils.warnTemplateKeysDeprecation(
       this.templateFile,
-      this.logPrefix(),
-      "Use 'supervisionUrls' instead"
-    );
-    ChargingStationUtils.convertDeprecatedTemplateKey(
       stationTemplate,
-      'supervisionUrl',
-      'supervisionUrls'
+      this.logPrefix()
     );
     const stationInfo: ChargingStationInfo =
       ChargingStationUtils.stationTemplateToStationInfo(stationTemplate);