This implements parts of the locations and commands module of OCPI 2.2 to support triggering charges remotely through an eMSP backend. The feature is yet incomplete, as it takes various shortcuts and only implements starting the charge, but not stopping it, and is not feeding back all potential errors.
Below are further TODOs, that will need to be documented for future backlog creation.
Functionality
implement the full flow for remotely starting and stopping a charge, start by implementing a RemoteStartTransactionResponse handler
make the pattern used to parse the charge station ID from the EVSE ID a configuration option, embed it in a service, currently it is hardcoded in a helper function
turn EVSEs into a subcollection of the Location documents, it is currently stored in the Location document in nested form
Protocol versions
allow the OCPI handlers to send both OCPP 1.6 and OCPP 2.0.1 messages, this requires recording the OCPI version of charge stations the first time they connect
if need arises, allow configuration of all OCPI Location attributes, currently the API only allows passing of a subset and sets the remaining ones to nil
change design to support multiple OCPI versions, currently we're hardwired to OCPI 2.2
Tests and tracing
review newly added tests, are they allowing for enough flexibility (not unnecessarily coupled to implementation details) and testing the right things on the right level
add OpenTelemetry tracing. Also explore whether OpenTelemetry help with X-Correlation-IDs as required by the OCPI specification, currently we're creating/retrieving the correlation IDs on receiving request through middleware (ocpi/correlation.go) and on issuing a request
This implements parts of the locations and commands module of OCPI 2.2 to support triggering charges remotely through an eMSP backend. The feature is yet incomplete, as it takes various shortcuts and only implements starting the charge, but not stopping it, and is not feeding back all potential errors.
Below are further TODOs, that will need to be documented for future backlog creation.
Functionality
Protocol versions
Tests and tracing