Refine sonar-project.properties
[e-mobility-charging-stations-simulator.git] / src / ui / web / src / types / ChargingStationType.ts
index dc485451034efc2efa12a8e0d94674eaf12ea73b..a3f9931c2387cdcee226dcdddfb3d5d6c27dad4a 100644 (file)
@@ -1,14 +1,20 @@
 import type { JsonObject } from './JsonType';
 
 export type ChargingStationData = {
-  hashId: string;
   stationInfo: ChargingStationInfo;
-  stopped: boolean;
+  started: boolean;
+  wsState?:
+    | typeof WebSocket.CONNECTING
+    | typeof WebSocket.OPEN
+    | typeof WebSocket.CLOSING
+    | typeof WebSocket.CLOSED;
   bootNotificationResponse: BootNotificationResponse;
   connectors: ConnectorStatus[];
+  automaticTransactionGeneratorStatuses?: Status[];
 };
 
 export type ChargingStationInfo = {
+  hashId: string;
   chargingStationId?: string;
   chargePointModel: string;
   chargePointVendor: string;
@@ -50,7 +56,7 @@ export type ChargingStationInfo = {
   reconnectExponentialDelay?: boolean;
   registrationMaxRetries?: number;
   enableStatistics?: boolean;
-  mayAuthorizeAtRemoteStart?: boolean;
+  mustAuthorizeAtRemoteStart?: boolean;
   amperageLimitationOcppKey?: string;
   amperageLimitationUnit?: AmpereUnits;
   beginEndMeterValues?: boolean;
@@ -115,10 +121,10 @@ export interface OCPP16BootNotificationResponse extends JsonObject {
   interval: number;
 }
 
-export interface CommandsSupport {
+type CommandsSupport = {
   incomingCommands: Record<IncomingRequestCommand, boolean>;
   outgoingCommands?: Record<RequestCommand, boolean>;
-}
+};
 
 export enum OCPPVersion {
   VERSION_16 = '1.6',
@@ -186,3 +192,22 @@ export enum OCPP16ChargePointStatus {
   UNAVAILABLE = 'Unavailable',
   FAULTED = 'Faulted',
 }
+
+export type Status = {
+  start?: boolean;
+  startDate?: Date;
+  lastRunDate?: Date;
+  stopDate?: Date;
+  stoppedDate?: Date;
+  authorizeRequests?: number;
+  acceptedAuthorizeRequests?: number;
+  rejectedAuthorizeRequests?: number;
+  startTransactionRequests?: number;
+  acceptedStartTransactionRequests?: number;
+  rejectedStartTransactionRequests?: number;
+  stopTransactionRequests?: number;
+  acceptedStopTransactionRequests?: number;
+  rejectedStopTransactionRequests?: number;
+  skippedConsecutiveTransactions?: number;
+  skippedTransactions?: number;
+};