build(simulator): features for reserve-now and cancel-reservation support added
[e-mobility-charging-stations-simulator.git] / src / types / ChargingStationTemplate.ts
1 import type { ClientRequestArgs } from 'node:http';
2
3 import type { ClientOptions } from 'ws';
4
5 import type { AutomaticTransactionGeneratorConfiguration } from './AutomaticTransactionGenerator';
6 import type { ChargingStationOcppConfiguration } from './ChargingStationOcppConfiguration';
7 import type { ConnectorStatus } from './ConnectorStatus';
8 import type { EvseTemplate } from './Evse';
9 import type { OCPPProtocol } from './ocpp/OCPPProtocol';
10 import type { OCPPVersion } from './ocpp/OCPPVersion';
11 import type {
12 FirmwareStatus,
13 IncomingRequestCommand,
14 MessageTrigger,
15 RequestCommand,
16 } from './ocpp/Requests';
17 import type { Reservation } from './ocpp/Reservation';
18
19 export enum CurrentType {
20 AC = 'AC',
21 DC = 'DC',
22 }
23
24 export enum PowerUnits {
25 WATT = 'W',
26 KILO_WATT = 'kW',
27 }
28
29 export enum AmpereUnits {
30 MILLI_AMPERE = 'mA',
31 CENTI_AMPERE = 'cA',
32 DECI_AMPERE = 'dA',
33 AMPERE = 'A',
34 }
35
36 export enum Voltage {
37 VOLTAGE_110 = 110,
38 VOLTAGE_230 = 230,
39 VOLTAGE_400 = 400,
40 VOLTAGE_800 = 800,
41 }
42
43 export type WsOptions = ClientOptions & ClientRequestArgs;
44
45 export type FirmwareUpgrade = {
46 versionUpgrade?: {
47 patternGroup?: number;
48 step?: number;
49 };
50 reset?: boolean;
51 failureStatus?: FirmwareStatus;
52 };
53
54 type CommandsSupport = {
55 incomingCommands: Record<IncomingRequestCommand, boolean>;
56 outgoingCommands?: Record<RequestCommand, boolean>;
57 };
58
59 export type ChargingStationTemplate = {
60 templateHash?: string;
61 supervisionUrls?: string | string[];
62 supervisionUrlOcppConfiguration?: boolean;
63 supervisionUrlOcppKey?: string;
64 supervisionUser?: string;
65 supervisionPassword?: string;
66 ocppVersion?: OCPPVersion;
67 ocppProtocol?: OCPPProtocol;
68 ocppStrictCompliance?: boolean;
69 ocppPersistentConfiguration?: boolean;
70 stationInfoPersistentConfiguration?: boolean;
71 wsOptions?: WsOptions;
72 idTagsFile?: string;
73 baseName: string;
74 nameSuffix?: string;
75 fixedName?: boolean;
76 chargePointModel: string;
77 chargePointVendor: string;
78 chargePointSerialNumberPrefix?: string;
79 chargeBoxSerialNumberPrefix?: string;
80 firmwareVersionPattern?: string;
81 firmwareVersion?: string;
82 firmwareUpgrade?: FirmwareUpgrade;
83 iccid?: string;
84 imsi?: string;
85 meterSerialNumberPrefix?: string;
86 meterType?: string;
87 power: number | number[];
88 powerSharedByConnectors?: boolean;
89 powerUnit: PowerUnits;
90 currentOutType?: CurrentType;
91 voltageOut?: Voltage;
92 numberOfPhases?: number;
93 numberOfConnectors?: number | number[];
94 useConnectorId0?: boolean;
95 randomConnectors?: boolean;
96 resetTime?: number;
97 autoRegister?: boolean;
98 autoReconnectMaxRetries?: number;
99 reconnectExponentialDelay?: boolean;
100 registrationMaxRetries?: number;
101 enableStatistics?: boolean;
102 mustAuthorizeAtRemoteStart?: boolean;
103 payloadSchemaValidation?: boolean;
104 amperageLimitationOcppKey?: string;
105 amperageLimitationUnit?: AmpereUnits;
106 beginEndMeterValues?: boolean;
107 outOfOrderEndMeterValues?: boolean;
108 meteringPerTransaction?: boolean;
109 transactionDataMeterValues?: boolean;
110 mainVoltageMeterValues?: boolean;
111 phaseLineToLineVoltageMeterValues?: boolean;
112 customValueLimitationMeterValues?: boolean;
113 commandsSupport?: CommandsSupport;
114 messageTriggerSupport?: Record<MessageTrigger, boolean>;
115 Configuration?: ChargingStationOcppConfiguration;
116 AutomaticTransactionGenerator?: AutomaticTransactionGeneratorConfiguration;
117 Evses?: Record<string, EvseTemplate>;
118 Connectors?: Record<string, ConnectorStatus>;
119 reservation?: Reservation[];
120 };