Permit to disable persistent configuration storage.
[e-mobility-charging-stations-simulator.git] / src / charging-station / AutomaticTransactionGenerator.ts
index 56e4feaaeec224ba75bf3b2a4949a0c05be2e880..b806d5cf0044dfbd8ea473c7c52267412d39ce49 100644 (file)
@@ -274,7 +274,7 @@ export default class AutomaticTransactionGenerator {
     let startResponse: StartTransactionResponse;
     if (this.chargingStation.hasAuthorizedTags()) {
       const idTag = this.chargingStation.getRandomIdTag();
-      if (this.chargingStation.getAutomaticTransactionGeneratorRequireAuthorize()) {
+      if (this.getRequireAuthorize()) {
         this.chargingStation.getConnectorStatus(connectorId).authorizeIdTag = idTag;
         // Authorize idTag
         const authorizeResponse: AuthorizeResponse =
@@ -375,6 +375,12 @@ export default class AutomaticTransactionGenerator {
     return stopResponse;
   }
 
+  private getRequireAuthorize(): boolean {
+    return (
+      this.chargingStation.stationInfo?.AutomaticTransactionGenerator?.requireAuthorize ?? true
+    );
+  }
+
   private logPrefix(connectorId?: number): string {
     if (connectorId) {
       return Utils.logPrefix(