| 1 | import type ChargingStation from '../ChargingStation'; |
| 2 | import { JsonType } from '../../types/JsonType'; |
| 3 | import { RequestCommand } from '../../types/ocpp/Requests'; |
| 4 | |
| 5 | export default abstract class OCPPResponseService { |
| 6 | private static instance: OCPPResponseService | null = null; |
| 7 | |
| 8 | protected constructor() { |
| 9 | // This is intentional |
| 10 | } |
| 11 | |
| 12 | public static getInstance<T extends OCPPResponseService>(this: new () => T): T { |
| 13 | if (!OCPPResponseService.instance) { |
| 14 | OCPPResponseService.instance = new this(); |
| 15 | } |
| 16 | return OCPPResponseService.instance as T; |
| 17 | } |
| 18 | |
| 19 | public abstract responseHandler( |
| 20 | chargingStation: ChargingStation, |
| 21 | commandName: RequestCommand, |
| 22 | payload: JsonType, |
| 23 | requestPayload: JsonType |
| 24 | ): Promise<void>; |
| 25 | } |