refactor: more coding style fixes
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 1.6 / Transaction.ts
index 41bd344ec4da1b2cf27e2051636044df443bab08..58f7e96c0f8ce8863bfd5e81f5e9b0a1f05774f7 100644 (file)
@@ -1,7 +1,7 @@
-import { OCPP16MeterValue } from './MeterValues';
+import type { OCPP16MeterValue } from './MeterValues.js'
+import type { JsonObject } from '../../JsonType.js'
 
 export enum OCPP16StopTransactionReason {
-  NONE = '',
   EMERGENCY_STOP = 'EmergencyStop',
   EV_DISCONNECTED = 'EVDisconnected',
   HARD_RESET = 'HardReset',
@@ -12,7 +12,7 @@ export enum OCPP16StopTransactionReason {
   REMOTE = 'Remote',
   SOFT_RESET = 'SoftReset',
   UNLOCK_COMMAND = 'UnlockCommand',
-  DE_AUTHORIZED = 'DeAuthorized'
+  DE_AUTHORIZED = 'DeAuthorized',
 }
 
 export enum OCPP16AuthorizationStatus {
@@ -20,45 +20,45 @@ export enum OCPP16AuthorizationStatus {
   BLOCKED = 'Blocked',
   EXPIRED = 'Expired',
   INVALID = 'Invalid',
-  CONCURRENT_TX = 'ConcurrentTx'
+  CONCURRENT_TX = 'ConcurrentTx',
 }
 
-export interface IdTagInfo {
-  status: OCPP16AuthorizationStatus;
-  parentIdTag?: string;
-  expiryDate?: Date;
+interface IdTagInfo extends JsonObject {
+  status: OCPP16AuthorizationStatus
+  parentIdTag?: string
+  expiryDate?: Date
 }
 
-export interface AuthorizeRequest {
-  idTag: string;
+export interface OCPP16AuthorizeRequest extends JsonObject {
+  idTag: string
 }
 
-export interface OCPP16AuthorizeResponse {
-  idTagInfo: IdTagInfo;
+export interface OCPP16AuthorizeResponse extends JsonObject {
+  idTagInfo: IdTagInfo
 }
 
-export interface StartTransactionRequest {
-  connectorId: number;
-  idTag: string;
-  meterStart: number;
-  reservationId?: number;
-  timestamp: string;
+export interface OCPP16StartTransactionRequest extends JsonObject {
+  connectorId: number
+  idTag: string
+  meterStart: number
+  timestamp: Date
+  reservationId?: number
 }
 
-export interface OCPP16StartTransactionResponse {
-  idTagInfo: IdTagInfo;
-  transactionId: number;
+export interface OCPP16StartTransactionResponse extends JsonObject {
+  idTagInfo: IdTagInfo
+  transactionId: number
 }
 
-export interface StopTransactionRequest {
-  idTag?: string;
-  meterStop: number;
-  timestamp: string;
-  transactionId: number;
-  reason?: OCPP16StopTransactionReason;
-  transactionData?: OCPP16MeterValue[];
+export interface OCPP16StopTransactionRequest extends JsonObject {
+  idTag?: string
+  meterStop: number
+  timestamp: Date
+  transactionId: number
+  reason?: OCPP16StopTransactionReason
+  transactionData?: OCPP16MeterValue[]
 }
 
-export interface OCPP16StopTransactionResponse {
-  idTagInfo?: IdTagInfo;
+export interface OCPP16StopTransactionResponse extends JsonObject {
+  idTagInfo?: IdTagInfo
 }