49cabf2e2e7bb41660c77e4f6dc7273116d71124
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 1.6 / Transaction.ts
1 import type { OCPP16MeterValue } from './MeterValues.js';
2 import type { JsonObject } from '../../JsonType.js';
3
4 export enum OCPP16StopTransactionReason {
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
18 export enum OCPP16AuthorizationStatus {
19 ACCEPTED = 'Accepted',
20 BLOCKED = 'Blocked',
21 EXPIRED = 'Expired',
22 INVALID = 'Invalid',
23 CONCURRENT_TX = 'ConcurrentTx',
24 }
25
26 interface IdTagInfo extends JsonObject {
27 status: OCPP16AuthorizationStatus;
28 parentIdTag?: string;
29 expiryDate?: Date;
30 }
31
32 export interface OCPP16AuthorizeRequest extends JsonObject {
33 idTag: string;
34 }
35
36 export interface OCPP16AuthorizeResponse extends JsonObject {
37 idTagInfo: IdTagInfo;
38 }
39
40 export interface OCPP16StartTransactionRequest extends JsonObject {
41 connectorId: number;
42 idTag: string;
43 meterStart: number;
44 timestamp: Date;
45 reservationId?: number;
46 }
47
48 export interface OCPP16StartTransactionResponse extends JsonObject {
49 idTagInfo: IdTagInfo;
50 transactionId: number;
51 }
52
53 export interface OCPP16StopTransactionRequest extends JsonObject {
54 idTag?: string;
55 meterStop: number;
56 timestamp: Date;
57 transactionId: number;
58 reason?: OCPP16StopTransactionReason;
59 transactionData?: OCPP16MeterValue[];
60 }
61
62 export interface OCPP16StopTransactionResponse extends JsonObject {
63 idTagInfo?: IdTagInfo;
64 }