Buffer OCPP message when an error occur at sending it
[e-mobility-charging-stations-simulator.git] / src / types / WorkerBroadcastChannel.ts
index 0ca44adac903f816f6917a60e1587762235b26e9..b7b8580d134e87965c46a69a64bc7c6b02d53a27 100644 (file)
@@ -10,31 +10,27 @@ export type BroadcastChannelResponse = [string, BroadcastChannelResponsePayload]
 export enum BroadcastChannelProcedureName {
   START_CHARGING_STATION = 'startChargingStation',
   STOP_CHARGING_STATION = 'stopChargingStation',
-  START_TRANSACTION = 'startTransaction',
-  STOP_TRANSACTION = 'stopTransaction',
   OPEN_CONNECTION = 'openConnection',
   CLOSE_CONNECTION = 'closeConnection',
+  START_AUTOMATIC_TRANSACTION_GENERATOR = 'startAutomaticTransactionGenerator',
+  STOP_AUTOMATIC_TRANSACTION_GENERATOR = 'stopAutomaticTransactionGenerator',
+  START_TRANSACTION = 'startTransaction',
+  STOP_TRANSACTION = 'stopTransaction',
+  AUTHORIZE = 'authorize',
+  BOOT_NOTIFICATION = 'bootNotification',
+  STATUS_NOTIFICATION = 'statusNotification',
+  HEARTBEAT = 'heartbeat',
+  METER_VALUES = 'meterValues',
+  DATA_TRANSFER = 'dataTransfer',
 }
 
-interface BaseBroadcastChannelRequestPayload extends Omit<RequestPayload, 'hashId' | 'hashIds'> {
+export interface BroadcastChannelRequestPayload extends RequestPayload {
   connectorId?: number;
   transactionId?: number;
-  idTag?: string;
-}
-
-interface HashIdBroadcastChannelRequestPayload extends BaseBroadcastChannelRequestPayload {
-  hashId: string;
 }
 
-interface HashIdsBroadcastChannelRequestPayload extends BaseBroadcastChannelRequestPayload {
-  hashIds: string[];
-}
-
-export type BroadcastChannelRequestPayload =
-  | HashIdBroadcastChannelRequestPayload
-  | HashIdsBroadcastChannelRequestPayload;
-
-export interface BroadcastChannelResponsePayload extends ResponsePayload {
+export interface BroadcastChannelResponsePayload
+  extends Omit<ResponsePayload, 'hashIdsSucceeded' | 'hashIdsFailed' | 'responsesFailed'> {
   hashId: string;
 }