- public abstract handleResponse(commandName: RequestCommand, payload: Record<string, unknown> | string, requestPayload: Record<string, unknown>): Promise<void>;
+ public static getInstance<T extends OCPPResponseService>(this: new () => T): T {
+ if (!OCPPResponseService.instance) {
+ OCPPResponseService.instance = new this();
+ }
+ return OCPPResponseService.instance as T;
+ }
+
+ public abstract responseHandler(
+ chargingStation: ChargingStation,
+ commandName: RequestCommand,
+ payload: JsonType,
+ requestPayload: JsonType
+ ): Promise<void>;