X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftypes%2Focpp%2F1.6%2FTransaction.ts;h=f9659f695398822e3932197137b8ee581626d6d2;hb=f2a90135692aac9beaeeb73efcb7e7aa093ec39a;hp=85eb4b2ebab38ab7d64a3052da3624526fc2d760;hpb=29bf6658d0689f5df26575d3b171163fe1d52d04;p=e-mobility-charging-stations-simulator.git diff --git a/src/types/ocpp/1.6/Transaction.ts b/src/types/ocpp/1.6/Transaction.ts index 85eb4b2e..f9659f69 100644 --- a/src/types/ocpp/1.6/Transaction.ts +++ b/src/types/ocpp/1.6/Transaction.ts @@ -1,5 +1,7 @@ -export enum StopTransactionReason { - NONE = '', +import type { JsonObject } from '../../JsonType.js' +import type { OCPP16MeterValue } from './MeterValues.js' + +export enum OCPP16StopTransactionReason { EMERGENCY_STOP = 'EmergencyStop', EV_DISCONNECTED = 'EVDisconnected', HARD_RESET = 'HardReset', @@ -13,25 +15,50 @@ export enum StopTransactionReason { DE_AUTHORIZED = 'DeAuthorized' } -export enum AuthorizationStatus { +export enum OCPP16AuthorizationStatus { ACCEPTED = 'Accepted', BLOCKED = 'Blocked', EXPIRED = 'Expired', INVALID = 'Invalid', - CONCURENT_TX = 'ConcurrentTx' + CONCURRENT_TX = 'ConcurrentTx' +} + +interface IdTagInfo extends JsonObject { + status: OCPP16AuthorizationStatus + parentIdTag?: string + expiryDate?: Date +} + +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 IdTagInfo { - status: AuthorizationStatus; - parentIdTag?: string; - expiryDate?: Date; +export interface OCPP16StartTransactionResponse extends JsonObject { + idTagInfo: IdTagInfo + transactionId: number } -export interface StartTransactionResponse { - idTagInfo: IdTagInfo; - transactionId: number; +export interface OCPP16StopTransactionRequest extends JsonObject { + idTag?: string + meterStop: number + timestamp: Date + transactionId: number + reason?: OCPP16StopTransactionReason + transactionData?: OCPP16MeterValue[] } -export interface StopTransactionResponse { - idTagInfo?: IdTagInfo; +export interface OCPP16StopTransactionResponse extends JsonObject { + idTagInfo?: IdTagInfo }