Forward UI request UUID to broadcast channel request
[e-mobility-charging-stations-simulator.git] / src / types / WorkerBroadcastChannel.ts
1 import { JsonObject } from './JsonType';
2 import { RequestPayload, ResponsePayload } from './UIProtocol';
3
4 export type BroadcastChannelRequest = [
5 string,
6 BroadcastChannelProcedureName,
7 BroadcastChannelRequestPayload
8 ];
9 export type BroadcastChannelResponse = [string, BroadcastChannelResponsePayload];
10
11 export enum BroadcastChannelProcedureName {
12 START_CHARGING_STATION = 'startChargingStation',
13 STOP_CHARGING_STATION = 'stopChargingStation',
14 START_TRANSACTION = 'startTransaction',
15 STOP_TRANSACTION = 'stopTransaction',
16 }
17
18 interface BroadcastChannelBasePayload extends JsonObject {
19 hashId: string;
20 }
21
22 export interface BroadcastChannelRequestPayload
23 extends BroadcastChannelBasePayload,
24 Omit<RequestPayload, 'hashId'> {
25 connectorId?: number;
26 transactionId?: number;
27 idTag?: string;
28 }
29
30 export type BroadcastChannelResponsePayload = ResponsePayload;