Skip to content

AM-1165 boat charging: Add async start-stop logic for boat charging - #234

Merged
jjbeekman merged 2 commits into
mainfrom
boat-charging/AM-1165-async-start-stop-logic
Aug 20, 2026
Merged

AM-1165 boat charging: Add async start-stop logic for boat charging#234
jjbeekman merged 2 commits into
mainfrom
boat-charging/AM-1165-async-start-stop-logic

Conversation

@jjbeekman

@jjbeekman jjbeekman commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

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_error to the session list/detail API response mapping and serializer.
Extend nrg_status enum 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.

Affected services

  • bridge

Definition of done

  • API is backwards compatible (make openapi-diff)
  • Swagger UI up-to-date & tested (make dev)
  • Dependencies updated (make requirements)
  • Infrastructure config updated (aapp_azure_infra)
  • Loadtests for relevant endpoints (aapp_testing_loadtests)

After PR created (and deployed on dev):

  • Manual check on dev (o) e.g. use feature via Swagger or admin panel
  • Sanity check on test app (check that dev environment is selected)

Other notes

GitHub Copilot was used in writing the code

@jjbeekman
jjbeekman requested review from a team and a lite review from Copilot August 18, 2026 12:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_error to the session list/detail API response mapping and serializer.
  • Extend nrg_status enum 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.

Comment thread bridge/boat_charging/tests/mock_data/session_start.py Outdated
Comment thread bridge/boat_charging/views/session_view.py
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@jjbeekman
jjbeekman merged commit 1c80b21 into main Aug 20, 2026
20 of 31 checks passed
@jjbeekman
jjbeekman deleted the boat-charging/AM-1165-async-start-stop-logic branch August 20, 2026 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants