Merge pull request #6 from LucasBrazi06/memory-optimization
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 1.6 / Requests.ts
1 import { ChargePointErrorCode } from './ChargePointErrorCode';
2 import { ChargePointStatus } from './ChargePointStatus';
3 import { ChargingProfile } from './ChargingProfile';
4 import { StandardParametersKey } from './Configuration';
5
6 export enum RequestCommand {
7 BOOT_NOTIFICATION = 'BootNotification',
8 HEARTBEAT = 'Heartbeat',
9 STATUS_NOTIFICATION = 'StatusNotification',
10 CHANGE_CONFIGURATION = 'ChangeConfiguration',
11 AUTHORIZE = 'Authorize',
12 START_TRANSACTION = 'StartTransaction',
13 STOP_TRANSACTION = 'StopTransaction',
14 METERVALUES = 'MeterValues'
15 }
16
17 export enum IncomingRequestCommand {
18 RESET = 'Reset',
19 CLEAR_CACHE = 'ClearCache',
20 CHANGE_AVAILABILITY = 'ChangeAvailability',
21 UNLOCK_CONNECTOR = 'UnlockConnector',
22 GET_CONFIGURATION = 'GetConfiguration',
23 CHANGE_CONFIGURATION = 'ChangeConfiguration',
24 SET_CHARGING_PROFILE = 'SetChargingProfile',
25 REMOTE_START_TRANSACTION = 'RemoteStartTransaction',
26 REMOTE_STOP_TRANSACTION = 'RemoteStopTransaction'
27 }
28
29 // eslint-disable-next-line @typescript-eslint/no-empty-interface
30 export interface HeartbeatRequest { }
31
32 export interface BootNotificationRequest {
33 chargeBoxSerialNumber?: string;
34 chargePointModel: string;
35 chargePointSerialNumber?: string;
36 chargePointVendor: string;
37 firmwareVersion?: string;
38 iccid?: string;
39 imsi?: string;
40 meterSerialNumber?: string;
41 meterType?: string;
42 }
43
44 export interface StatusNotificationRequest {
45 connectorId: number;
46 errorCode: ChargePointErrorCode;
47 info?: string;
48 status: ChargePointStatus;
49 timestamp?: string;
50 vendorId?: string;
51 vendorErrorCode?: string;
52 }
53
54 export interface ChangeConfigurationRequest {
55 key: string | StandardParametersKey;
56 value: string;
57 }
58
59 export interface RemoteStartTransactionRequest {
60 connectorId: number;
61 idTag: string;
62 chargingProfile?: ChargingProfile;
63 }
64
65 export interface RemoteStopTransactionRequest {
66 transactionId: number;
67 }
68
69 export interface UnlockConnectorRequest {
70 connectorId: number;
71 }
72
73 export interface GetConfigurationRequest {
74 key?: string | StandardParametersKey[];
75 }
76
77 export enum ResetType {
78 HARD = 'Hard',
79 SOFT = 'Soft'
80 }
81
82 export interface ResetRequest {
83 type: ResetType;
84 }
85
86 export interface SetChargingProfileRequest {
87 connectorId: number;
88 csChargingProfiles: ChargingProfile;
89 }
90
91 export enum AvailabilityType {
92 INOPERATIVE = 'Inoperative',
93 OPERATIVE = 'Operative'
94 }
95
96 export interface ChangeAvailabilityRequest {
97 connectorId: number;
98 type: AvailabilityType;
99 }