refactor: more coding style fixes
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 1.6 / Transaction.ts
CommitLineData
66a7748d
JB
1import type { OCPP16MeterValue } from './MeterValues.js'
2import type { JsonObject } from '../../JsonType.js'
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',
a807045b 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',
a807045b 23 CONCURRENT_TX = 'ConcurrentTx',
9ac86a7e
JB
24}
25
0ac97927 26interface IdTagInfo extends JsonObject {
66a7748d
JB
27 status: OCPP16AuthorizationStatus
28 parentIdTag?: string
29 expiryDate?: Date
9ac86a7e
JB
30}
31
e3822d6f 32export interface OCPP16AuthorizeRequest extends JsonObject {
66a7748d 33 idTag: string
ef6076c1 34}
163547b1 35
e3822d6f 36export interface OCPP16AuthorizeResponse extends JsonObject {
66a7748d 37 idTagInfo: IdTagInfo
ef6076c1
J
38}
39
e3822d6f 40export interface OCPP16StartTransactionRequest extends JsonObject {
66a7748d
JB
41 connectorId: number
42 idTag: string
43 meterStart: number
44 timestamp: Date
45 reservationId?: number
f738a0e9
JB
46}
47
e3822d6f 48export interface OCPP16StartTransactionResponse extends JsonObject {
66a7748d
JB
49 idTagInfo: IdTagInfo
50 transactionId: number
9ac86a7e
JB
51}
52
e3822d6f 53export interface OCPP16StopTransactionRequest extends JsonObject {
66a7748d
JB
54 idTag?: string
55 meterStop: number
56 timestamp: Date
57 transactionId: number
58 reason?: OCPP16StopTransactionReason
59 transactionData?: OCPP16MeterValue[]
f738a0e9
JB
60}
61
e3822d6f 62export interface OCPP16StopTransactionResponse extends JsonObject {
66a7748d 63 idTagInfo?: IdTagInfo
9ac86a7e 64}