X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Ftypes%2Focpp%2F1.6%2FTransaction.ts;h=14f9223c3c0d98188ded3b54f0492e0c849726cf;hb=cf058664a0053a43b9ac08815b6e430179ff5ddf;hp=c7777db20fd721a7f40171b05d1eff8e59304e2b;hpb=f738a0e9257a5bd6d46a79a5845b929c4a06e94f;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 c7777db2..14f9223c 100644 --- a/src/types/ocpp/1.6/Transaction.ts +++ b/src/types/ocpp/1.6/Transaction.ts @@ -1,6 +1,7 @@ -import { MeterValue } from './MeterValues'; +import type { JsonObject } from '../../JsonType'; +import type { OCPP16MeterValue } from './MeterValues'; -export enum StopTransactionReason { +export enum OCPP16StopTransactionReason { NONE = '', EMERGENCY_STOP = 'EmergencyStop', EV_DISCONNECTED = 'EVDisconnected', @@ -12,45 +13,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; +export interface IdTagInfo extends JsonObject { + status: OCPP16AuthorizationStatus; parentIdTag?: string; expiryDate?: Date; } -export interface StartTransactionRequest { +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; - reservationId?: number; timestamp: string; + reservationId?: number; } -export interface StartTransactionResponse { +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?: StopTransactionReason; - transactionData?: MeterValue[]; + reason?: OCPP16StopTransactionReason; + transactionData?: OCPP16MeterValue[]; } -export interface StopTransactionResponse { +export interface OCPP16StopTransactionResponse extends JsonObject { idTagInfo?: IdTagInfo; }