Ensure start transaction payload is always compliant with OCA specs
[e-mobility-charging-stations-simulator.git] / src / charging-station / ChargingStationUtils.ts
index daf48ac3475de0b918de6e653fce5c14ce6aadad..4cf1b386fde85cd580e7b1a6f159bd7aafe4d125 100644 (file)
@@ -49,7 +49,7 @@ export class ChargingStationUtils {
   }
 
   public static getHashId(index: number, stationTemplate: ChargingStationTemplate): string {
-    const hashBootNotificationRequest = {
+    const chargingStationInfo = {
       chargePointModel: stationTemplate.chargePointModel,
       chargePointVendor: stationTemplate.chargePointVendor,
       ...(!Utils.isUndefined(stationTemplate.chargeBoxSerialNumberPrefix) && {
@@ -74,7 +74,7 @@ export class ChargingStationUtils {
     return crypto
       .createHash(Constants.DEFAULT_HASH_ALGORITHM)
       .update(
-        JSON.stringify(hashBootNotificationRequest) +
+        JSON.stringify(chargingStationInfo) +
           ChargingStationUtils.getChargingStationId(index, stationTemplate)
       )
       .digest('hex');
@@ -244,7 +244,7 @@ export class ChargingStationUtils {
 
   public static createSerialNumber(
     stationTemplate: ChargingStationTemplate,
-    stationInfo: ChargingStationInfo = {} as ChargingStationInfo,
+    stationInfo: ChargingStationInfo,
     params: {
       randomSerialNumberUpperCase?: boolean;
       randomSerialNumber?: boolean;
@@ -275,7 +275,7 @@ export class ChargingStationUtils {
   public static propagateSerialNumber(
     stationTemplate: ChargingStationTemplate,
     stationInfoSrc: ChargingStationInfo,
-    stationInfoDst: ChargingStationInfo = {} as ChargingStationInfo
+    stationInfoDst: ChargingStationInfo
   ) {
     if (!stationInfoSrc || !stationTemplate) {
       throw new BaseError(