fix(simulator): detect string emptyness properly
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / Responses.ts
index 90c5f1ea99272c09caefa093cd91f4bc036fe090..df4bdf90fe084c0f7ea88207ebb0e081f404e5f4 100644 (file)
@@ -1,5 +1,3 @@
-import type ChargingStation from '../../charging-station/ChargingStation';
-import type { JsonType } from '../JsonType';
 import type { OCPP16MeterValuesResponse } from './1.6/MeterValues';
 import {
   OCPP16AvailabilityStatus,
@@ -16,9 +14,15 @@ import {
   OCPP16TriggerMessageStatus,
   OCPP16UnlockStatus,
 } from './1.6/Responses';
-import type { OCPP20BootNotificationResponse, OCPP20ClearCacheResponse } from './2.0/Responses';
+import type {
+  OCPP20BootNotificationResponse,
+  OCPP20ClearCacheResponse,
+  OCPP20StatusNotificationResponse,
+} from './2.0/Responses';
 import type { ErrorType } from './ErrorType';
 import type { MessageType } from './MessageType';
+import type ChargingStation from '../../charging-station/ChargingStation';
+import type { JsonType } from '../JsonType';
 
 export type Response = [MessageType.CALL_RESULT_MESSAGE, string, JsonType];
 
@@ -36,9 +40,11 @@ export type BootNotificationResponse =
 
 export type HeartbeatResponse = OCPP16HeartbeatResponse;
 
-export type ClearCacheResponse = DefaultResponse | OCPP20ClearCacheResponse;
+export type ClearCacheResponse = GenericResponse | OCPP20ClearCacheResponse;
 
-export type StatusNotificationResponse = OCPP16StatusNotificationResponse;
+export type StatusNotificationResponse =
+  | OCPP16StatusNotificationResponse
+  | OCPP20StatusNotificationResponse;
 
 export type MeterValuesResponse = OCPP16MeterValuesResponse;
 
@@ -48,13 +54,13 @@ export type DiagnosticsStatusNotificationResponse = OCPP16DiagnosticsStatusNotif
 
 export type FirmwareStatusNotificationResponse = OCPP16FirmwareStatusNotificationResponse;
 
-export enum DefaultStatus {
+export enum GenericStatus {
   ACCEPTED = 'Accepted',
   REJECTED = 'Rejected',
 }
 
-export type DefaultResponse = {
-  status: DefaultStatus;
+export type GenericResponse = {
+  status: GenericStatus;
 };
 
 export enum RegistrationStatusEnumType {