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