AM-1165 boat charging: Add async start-stop logic for boat charging - #234
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the bridge / boat_charging service to better support asynchronous start/stop flows by reflecting additional NRG session states and exposing NRG command failure details in session responses, with corresponding test and Bruno collection updates.
Changes:
- Add
last_command_errorto the session list/detail API response mapping and serializer. - Extend
nrg_statusenum to include the new “Starting” (6) and “Stopping” (7) states. - Update tests and mock responses (including new mock payload for session start) and update/add Bruno requests for external NRG calls.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| bridge/boat_charging/views/session_view.py | Adds last_command_error to the session response mapping. |
| bridge/boat_charging/serializers/session_serializers.py | Extends nrg_status choices and adds last_command_error field to the response serializer. |
| bridge/boat_charging/tests/views/test_session_views.py | Adds assertion coverage for last_command_error in session list responses. |
| bridge/boat_charging/tests/views/test_session_start_stop.py | Updates start-session mocks to return a structured session payload instead of {}. |
| bridge/boat_charging/tests/mock_data/start_session.py | Removes the old empty start-session mock fixture. |
| bridge/boat_charging/tests/mock_data/sessions.py | Adds lastCommandError to relevant mocked session entries. |
| bridge/boat_charging/tests/mock_data/session_start.py | Introduces a new mocked start-session payload. |
| .bruno-workspace/collections/Extern/Boot laden NRG/Session init.yml | Adds Bruno request to initialize a session against NRG. |
| .bruno-workspace/collections/Extern/Boot laden NRG/Session details.yml | Updates Bruno request path parameter example session id. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
fhaver-amsterdam
approved these changes
Aug 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR updates the bridge / boat_charging service to better support asynchronous start/stop flows by reflecting additional NRG session states and exposing NRG command failure details in session responses, with corresponding test and Bruno collection updates.
Changes:
Affected services
Definition of done
make openapi-diff)make dev)make requirements)After PR created (and deployed on dev):
Other notes
GitHub Copilot was used in writing the code