refactor(simulator): explicitly export needed types only
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 1.6 / Transaction.ts
index 85eb4b2ebab38ab7d64a3052da3624526fc2d760..215628f79a650aeaf7069aeb4d2a971f79efe7cf 100644 (file)
@@ -1,4 +1,6 @@
-export enum StopTransactionReason {
+import type { JsonObject, OCPP16MeterValue } from '../../internal';
+
+export enum OCPP16StopTransactionReason {
   NONE = '',
   EMERGENCY_STOP = 'EmergencyStop',
   EV_DISCONNECTED = 'EVDisconnected',
@@ -10,28 +12,53 @@ export enum StopTransactionReason {
   REMOTE = 'Remote',
   SOFT_RESET = 'SoftReset',
   UNLOCK_COMMAND = 'UnlockCommand',
-  DE_AUTHORIZED = 'DeAuthorized'
+  DE_AUTHORIZED = 'DeAuthorized',
 }
 
-export enum AuthorizationStatus {
+export enum OCPP16AuthorizationStatus {
   ACCEPTED = 'Accepted',
   BLOCKED = 'Blocked',
   EXPIRED = 'Expired',
   INVALID = 'Invalid',
-  CONCURENT_TX = 'ConcurrentTx'
+  CONCURRENT_TX = 'ConcurrentTx',
 }
 
-export interface IdTagInfo {
-  status: AuthorizationStatus;
+interface IdTagInfo extends JsonObject {
+  status: OCPP16AuthorizationStatus;
   parentIdTag?: string;
   expiryDate?: Date;
 }
 
-export interface StartTransactionResponse {
+export interface OCPP16AuthorizeRequest extends JsonObject {
+  idTag: string;
+}
+
+export interface OCPP16AuthorizeResponse extends JsonObject {
   idTagInfo: IdTagInfo;
+}
+
+export interface OCPP16StartTransactionRequest extends JsonObject {
+  connectorId: number;
+  idTag: string;
+  meterStart: number;
+  timestamp: Date;
+  reservationId?: number;
+}
+
+export interface OCPP16StartTransactionResponse extends JsonObject {
+  idTagInfo: IdTagInfo;
+  transactionId: number;
+}
+
+export interface OCPP16StopTransactionRequest extends JsonObject {
+  idTag?: string;
+  meterStop: number;
+  timestamp: Date;
   transactionId: number;
+  reason?: OCPP16StopTransactionReason;
+  transactionData?: OCPP16MeterValue[];
 }
 
-export interface StopTransactionResponse {
+export interface OCPP16StopTransactionResponse extends JsonObject {
   idTagInfo?: IdTagInfo;
 }