Skip to content

Charger Reservation [SOFT]

Connect URL

THIS IS A SECRET. MESSAGE A DEV.

Reserving a Charger

  1. The client connects to the websocket.

  2. Upon connecting, the client sends a message with command set to START.

    • If there is an existing reservation within the time limit, an error will be thrown.
    • If there is an existing reservation past the time limit, the reservation will be overwritten.
    • If the client disconnects without sending HOLD prior, the reservation will be cancelled.
    • If the charger is not Preparing, an error will be thrown.
  3. Before paying, the client sends a message with command set to HOLD.

    • If reservation does not exist, an error will be thrown.
    • If a different user email tries to hold the reservation, an error will be thrown.
    • If the reservation is not active, an error will be thrown.
  4. Upon returning, the client sends a message with command set to RESUME.

    • If reservation does not exist, an error will be thrown.
    • If a different user email tries to hold the reservation, an error will be thrown.
    • If the reservation is not on hold, an error will be thrown.
  5. [Optional] Upon returning, the client sends a message with command set to CANCEL.

    • If reservation does not exist, an error will be thrown.
    • If a different user email tries to hold the reservation, an error will be thrown.

ReserveChargerRequestDTO

This should be the message of the request from the client.

Attributes:

Name Type Description
command Annotated[Command, BeforeValidator(get)]

SHOULD BE ONE OF THE ENUM

site_id int

SITE OF CHARGER TO RESERVE

charger_id str

CHARGER TO RESERVE

connector_id int

CONNECTOR TO BE USED WITHIN THE CHARGER

email str

EMAIL OF RESERVER

Command

Attributes:

Name Type Description
START

USED UPON CONNECTING TO THE WEBSOCKET

HOLD

USED JUST BEFORE PAYMENT REDIRECTION

RESUME

USED AFTER PAYING

CANCEL

USED TO CANCEL RESERVATION

Error

Attributes:

Name Type Description
INVALID_COMMAND

INVALID command FIELD

EXISTING_RESERVATION

THERE IS AN EXISTING CHARGER RESERVATION

NON_EXISTING_RESERVATION

THERE IS NO EXISTING CHARGER RESERVATION

DIFFERENT_USER_EMAIL

DIFFERENT USER IS TRYING TO INTERACT WITH THE RESERVATION

CHARGER_NOT_PREPARING

CHARGER IS NOT IN PREPARING STATUS

CHARGER_RESERVATION_NOT_HOLDABLE

CHARGER RESERVATION IS NOT HOLDABLE

CHARGER_RESERVATION_NOT_RESUMEABLE

CHARGER RESERVATION IS NOT RESUMEABLE