Simplify stop transaction payload handling
[e-mobility-charging-stations-simulator.git] / src / types / ocpp / 1.6 / Transaction.ts
index 69aff0e0115b3849bbf9e8b1a8ced5fe6536a8f3..14f9223c3c0d98188ded3b54f0492e0c849726cf 100644 (file)
@@ -1,4 +1,5 @@
-import { MeterValue } from './MeterValues';
+import type { JsonObject } from '../../JsonType';
+import type { OCPP16MeterValue } from './MeterValues';
 
 export enum OCPP16StopTransactionReason {
   NONE = '',
@@ -12,7 +13,7 @@ export enum OCPP16StopTransactionReason {
   REMOTE = 'Remote',
   SOFT_RESET = 'SoftReset',
   UNLOCK_COMMAND = 'UnlockCommand',
-  DE_AUTHORIZED = 'DeAuthorized'
+  DE_AUTHORIZED = 'DeAuthorized',
 }
 
 export enum OCPP16AuthorizationStatus {
@@ -20,45 +21,45 @@ export enum OCPP16AuthorizationStatus {
   BLOCKED = 'Blocked',
   EXPIRED = 'Expired',
   INVALID = 'Invalid',
-  CONCURRENT_TX = 'ConcurrentTx'
+  CONCURRENT_TX = 'ConcurrentTx',
 }
 
-export interface IdTagInfo {
+export interface IdTagInfo extends JsonObject {
   status: OCPP16AuthorizationStatus;
   parentIdTag?: string;
   expiryDate?: Date;
 }
 
-export interface AuthorizeRequest {
+export interface OCPP16AuthorizeRequest extends JsonObject {
   idTag: string;
-
 }
-export interface OCPP16AuthorizeResponse {
+
+export interface OCPP16AuthorizeResponse extends JsonObject {
   idTagInfo: IdTagInfo;
 }
 
-export interface StartTransactionRequest {
+export interface OCPP16StartTransactionRequest extends JsonObject {
   connectorId: number;
   idTag: string;
   meterStart: number;
-  reservationId?: number;
   timestamp: string;
+  reservationId?: number;
 }
 
-export interface OCPP16StartTransactionResponse {
+export interface OCPP16StartTransactionResponse extends JsonObject {
   idTagInfo: IdTagInfo;
   transactionId: number;
 }
 
-export interface StopTransactionRequest {
+export interface OCPP16StopTransactionRequest extends JsonObject {
   idTag?: string;
   meterStop: number;
   timestamp: string;
   transactionId: number;
   reason?: OCPP16StopTransactionReason;
-  transactionData?: MeterValue[];
+  transactionData?: OCPP16MeterValue[];
 }
 
-export interface OCPP16StopTransactionResponse {
+export interface OCPP16StopTransactionResponse extends JsonObject {
   idTagInfo?: IdTagInfo;
 }