fix: ensure running transactions are stopped at CS stop
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 1.6 / Transaction.ts
CommitLineData
69074173
JB
1import type { OCPP16MeterValue } from './MeterValues';
2import type { JsonObject } from '../../JsonType';
f738a0e9 3
c0560973 4export enum OCPP16StopTransactionReason {
9ac86a7e
JB
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',
e7aeea18 15 DE_AUTHORIZED = 'DeAuthorized',
9ac86a7e
JB
16}
17
c0560973 18export enum OCPP16AuthorizationStatus {
9ac86a7e
JB
19 ACCEPTED = 'Accepted',
20 BLOCKED = 'Blocked',
21 EXPIRED = 'Expired',
22 INVALID = 'Invalid',
e7aeea18 23 CONCURRENT_TX = 'ConcurrentTx',
9ac86a7e
JB
24}
25
0ac97927 26interface IdTagInfo extends JsonObject {
c0560973 27 status: OCPP16AuthorizationStatus;
9ac86a7e
JB
28 parentIdTag?: string;
29 expiryDate?: Date;
30}
31
e3822d6f 32export interface OCPP16AuthorizeRequest extends JsonObject {
ef6076c1 33 idTag: string;
ef6076c1 34}
163547b1 35
e3822d6f 36export interface OCPP16AuthorizeResponse extends JsonObject {
ef6076c1
J
37 idTagInfo: IdTagInfo;
38}
39
e3822d6f 40export interface OCPP16StartTransactionRequest extends JsonObject {
f738a0e9
JB
41 connectorId: number;
42 idTag: string;
43 meterStart: number;
c38f0ced 44 timestamp: Date;
cf058664 45 reservationId?: number;
f738a0e9
JB
46}
47
e3822d6f 48export interface OCPP16StartTransactionResponse extends JsonObject {
9ac86a7e
JB
49 idTagInfo: IdTagInfo;
50 transactionId: number;
51}
52
e3822d6f 53export interface OCPP16StopTransactionRequest extends JsonObject {
f738a0e9
JB
54 idTag?: string;
55 meterStop: number;
c38f0ced 56 timestamp: Date;
f738a0e9 57 transactionId: number;
c0560973 58 reason?: OCPP16StopTransactionReason;
fd0c36fa 59 transactionData?: OCPP16MeterValue[];
f738a0e9
JB
60}
61
e3822d6f 62export interface OCPP16StopTransactionResponse extends JsonObject {
9ac86a7e
JB
63 idTagInfo?: IdTagInfo;
64}