Release 1.0.23
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 1.6 / Transaction.ts
CommitLineData
fd0c36fa 1import { OCPP16MeterValue } from './MeterValues';
f738a0e9 2
c0560973 3export enum OCPP16StopTransactionReason {
9ac86a7e
JB
4 NONE = '',
5 EMERGENCY_STOP = 'EmergencyStop',
6 EV_DISCONNECTED = 'EVDisconnected',
7 HARD_RESET = 'HardReset',
8 LOCAL = 'Local',
9 OTHER = 'Other',
10 POWER_LOSS = 'PowerLoss',
11 REBOOT = 'Reboot',
12 REMOTE = 'Remote',
13 SOFT_RESET = 'SoftReset',
14 UNLOCK_COMMAND = 'UnlockCommand',
15 DE_AUTHORIZED = 'DeAuthorized'
16}
17
c0560973 18export enum OCPP16AuthorizationStatus {
9ac86a7e
JB
19 ACCEPTED = 'Accepted',
20 BLOCKED = 'Blocked',
21 EXPIRED = 'Expired',
22 INVALID = 'Invalid',
6ad94506 23 CONCURRENT_TX = 'ConcurrentTx'
9ac86a7e
JB
24}
25
26export interface IdTagInfo {
c0560973 27 status: OCPP16AuthorizationStatus;
9ac86a7e
JB
28 parentIdTag?: string;
29 expiryDate?: Date;
30}
31
ef6076c1
J
32export interface AuthorizeRequest {
33 idTag: string;
34
35}
c0560973 36export interface OCPP16AuthorizeResponse {
ef6076c1
J
37 idTagInfo: IdTagInfo;
38}
39
f738a0e9
JB
40export interface StartTransactionRequest {
41 connectorId: number;
42 idTag: string;
43 meterStart: number;
44 reservationId?: number;
45 timestamp: string;
46}
47
c0560973 48export interface OCPP16StartTransactionResponse {
9ac86a7e
JB
49 idTagInfo: IdTagInfo;
50 transactionId: number;
51}
52
f738a0e9
JB
53export interface StopTransactionRequest {
54 idTag?: string;
55 meterStop: number;
56 timestamp: string;
57 transactionId: number;
c0560973 58 reason?: OCPP16StopTransactionReason;
fd0c36fa 59 transactionData?: OCPP16MeterValue[];
f738a0e9
JB
60}
61
c0560973 62export interface OCPP16StopTransactionResponse {
9ac86a7e
JB
63 idTagInfo?: IdTagInfo;
64}