refactor(simulator): make OCPPIncomingRequestService class inherit from
[e-mobility-charging-stations-simulator.git] / src / charging-station / ocpp / OCPPIncomingRequestService.ts
index ddffa657f2a131df81b11058b786807eea15e0fd..41c0e49bc844ab0c7073a1d254ad38cb50c9ba55 100644 (file)
@@ -17,21 +17,20 @@ import { ChargingStationUtils } from '../ChargingStationUtils';
 
 const moduleName = 'OCPPIncomingRequestService';
 
-export default abstract class OCPPIncomingRequestService {
+export default abstract class OCPPIncomingRequestService extends AsyncResource {
   private static instance: OCPPIncomingRequestService | null = null;
-  protected asyncResource: AsyncResource;
   private readonly version: OCPPVersion;
   private readonly ajv: Ajv;
   protected abstract jsonSchemas: Map<IncomingRequestCommand, JSONSchemaType<JsonObject>>;
 
   protected constructor(version: OCPPVersion) {
+    super(moduleName);
     this.version = version;
     this.ajv = new Ajv({
       keywords: ['javaType'],
       multipleOfPrecision: 2,
     });
     ajvFormats(this.ajv);
-    this.asyncResource = new AsyncResource(moduleName);
     this.incomingRequestHandler.bind(this);
     this.validateIncomingRequestPayload.bind(this);
   }