Add enum list for request command name.
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 1.6 / Transaction.ts
CommitLineData
f738a0e9
JB
1import { MeterValue } from './MeterValues';
2
9ac86a7e
JB
3export enum StopTransactionReason {
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
18export enum AuthorizationStatus {
19 ACCEPTED = 'Accepted',
20 BLOCKED = 'Blocked',
21 EXPIRED = 'Expired',
22 INVALID = 'Invalid',
6ad94506 23 CONCURRENT_TX = 'ConcurrentTx'
9ac86a7e
JB
24}
25
26export interface IdTagInfo {
27 status: AuthorizationStatus;
28 parentIdTag?: string;
29 expiryDate?: Date;
30}
31
f738a0e9
JB
32export interface StartTransactionRequest {
33 connectorId: number;
34 idTag: string;
35 meterStart: number;
36 reservationId?: number;
37 timestamp: string;
38}
39
9ac86a7e
JB
40export interface StartTransactionResponse {
41 idTagInfo: IdTagInfo;
42 transactionId: number;
43}
44
f738a0e9
JB
45export interface StopTransactionRequest {
46 idTag?: string;
47 meterStop: number;
48 timestamp: string;
49 transactionId: number;
50 reason?: StopTransactionReason;
51 transactionData?: MeterValue[];
52}
53
9ac86a7e
JB
54export interface StopTransactionResponse {
55 idTagInfo?: IdTagInfo;
56}