Unify supervision urls setup and distribution to charging stations
[e-mobility-charging-stations-simulator.git] / src / types / ConfigurationData.ts
index d218e08a3067917daa1a321e11281eef9c4affbd..56ee0354510cca07327b6a6ce48973f1a8ab9dcd 100644 (file)
@@ -2,8 +2,15 @@ import { ServerOptions } from 'ws';
 import { StorageType } from './Storage';
 import type { WorkerChoiceStrategy } from 'poolifier';
 import { WorkerProcessType } from './Worker';
+import { level } from 'winston';
 
-export interface StationTemplateURL {
+export enum SupervisionUrlDistribution {
+  ROUND_ROBIN = 'round-robin',
+  RANDOM = 'random',
+  SEQUENTIAL = 'sequential',
+}
+
+export interface StationTemplateUrl {
   file: string;
   numberOfStations: number;
 }
@@ -16,16 +23,16 @@ export interface UIWebSocketServerConfiguration {
 export interface StorageConfiguration {
   enabled?: boolean;
   type?: StorageType;
-  URI?: string;
+  uri?: string;
 }
 
 export default interface ConfigurationData {
-  supervisionURLs?: string[];
-  stationTemplateURLs: StationTemplateURL[];
+  supervisionUrls?: string | string[];
+  supervisionUrlDistribution?: SupervisionUrlDistribution;
+  stationTemplateUrls: StationTemplateUrl[];
   uiWebSocketServer?: UIWebSocketServerConfiguration;
   performanceStorage?: StorageConfiguration;
   autoReconnectMaxRetries?: number;
-  distributeStationsToTenantsEqually?: boolean;
   workerProcess?: WorkerProcessType;
   workerStartDelay?: number;
   workerPoolMinSize?: number;
@@ -34,7 +41,7 @@ export default interface ConfigurationData {
   chargingStationsPerWorker?: number;
   logStatisticsInterval?: number;
   logFormat?: string;
-  logLevel?: string;
+  logLevel?: level;
   logRotate?: boolean;
   logMaxFiles?: number;
   logFile?: string;