From: Julian Buecher Date: Wed, 24 May 2023 20:51:52 +0000 (+0200) Subject: build(simulator): constants, requests and responses for reservation scenario added X-Git-Tag: v1.2.16~13^2~14 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=db652e1ea3fbb7ae3902c4b91b857bca44c87ac1;p=e-mobility-charging-stations-simulator.git build(simulator): constants, requests and responses for reservation scenario added --- diff --git a/src/types/ocpp/1.6/Requests.ts b/src/types/ocpp/1.6/Requests.ts index 60c1787f..786ea617 100644 --- a/src/types/ocpp/1.6/Requests.ts +++ b/src/types/ocpp/1.6/Requests.ts @@ -183,3 +183,15 @@ export interface OCPP16DataTransferRequest extends JsonObject { messageId?: string; data?: string; } + +export interface OCPP16ReserveNowRequest { + connectorId: string; + expiryDate: Date; + idTag: string; + parentIdTag?: string; + reservationId: number; +} + +export interface OCPP16CancelReservationRequest { + reservationId: number; +} diff --git a/src/types/ocpp/1.6/Responses.ts b/src/types/ocpp/1.6/Responses.ts index a6683caa..6a5ebfe4 100644 --- a/src/types/ocpp/1.6/Responses.ts +++ b/src/types/ocpp/1.6/Responses.ts @@ -109,3 +109,24 @@ export interface OCPP16DataTransferResponse extends JsonObject { status: OCPP16DataTransferStatus; data?: string; } + +export enum OCPP16ReservationStatus { + ACCEPTED = 'Accepted', + FAULTED = 'Faulted', + OCCUPIED = 'Occupied', + REJECTED = 'Rejected', + UNAVAILABLE = 'Unavailable', +} + +export interface OCPP16ReserveNowResponse { + status: OCPP16ReservationStatus; +} + +export enum OCPP16CancelReservationStatus { + ACCEPTED = 'Accepted', + REJECTED = 'Rejected', +} + +export interface OCPP16CancelReservationResponse { + status: OCPP16CancelReservationStatus; +} diff --git a/src/types/ocpp/Responses.ts b/src/types/ocpp/Responses.ts index 24b8b848..da5948a9 100644 --- a/src/types/ocpp/Responses.ts +++ b/src/types/ocpp/Responses.ts @@ -2,6 +2,7 @@ import type { OCPP16MeterValuesResponse } from './1.6/MeterValues'; import { OCPP16AvailabilityStatus, type OCPP16BootNotificationResponse, + OCPP16CancelReservationStatus, OCPP16ChargingProfileStatus, OCPP16ClearChargingProfileStatus, OCPP16ConfigurationStatus, @@ -10,6 +11,7 @@ import { type OCPP16DiagnosticsStatusNotificationResponse, type OCPP16FirmwareStatusNotificationResponse, type OCPP16HeartbeatResponse, + OCPP16ReservationStatus, type OCPP16StatusNotificationResponse, OCPP16TriggerMessageStatus, OCPP16UnlockStatus, @@ -103,3 +105,15 @@ export const DataTransferStatus = { ...OCPP16DataTransferStatus, } as const; export type DataTransferStatus = OCPP16DataTransferStatus; + +export type ReservationStatus = OCPP16ReservationStatus; + +export const ReservationStatus = { + ...OCPP16ReservationStatus, +}; + +export type CancelReservationStatus = OCPP16CancelReservationStatus; + +export const CancelReservationStatus = { + ...OCPP16CancelReservationStatus, +};