Skip to content

AM-1078 boat charging: add socket status endpoint#213

Open
fhaver-amsterdam wants to merge 5 commits into
mainfrom
boat-charging/am-1078-socket-status
Open

AM-1078 boat charging: add socket status endpoint#213
fhaver-amsterdam wants to merge 5 commits into
mainfrom
boat-charging/am-1078-socket-status

Conversation

@fhaver-amsterdam

@fhaver-amsterdam fhaver-amsterdam commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Adds a new “socket status” read endpoint to the bridge/boat_charging API, while refactoring shared status constants and improving OpenAPI header documentation to support “optional access token” endpoints.

Changes:

  • Added GET /boat-charging/api/v1/sessions/{session_id}/socket-status endpoint with mapping/validation of external status values.
  • Centralized operation-state constants/mapping into bridge.boat_charging.constants and updated imports accordingly.
  • Updated OpenAPI decorator usage to distinguish between “accepts” vs “requires” access-token headers, and added test coverage + mock data for the new endpoint.

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

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

Adds a new “socket status” read endpoint to the bridge/boat_charging API, while refactoring shared status constants and improving OpenAPI header documentation to support “optional access token” endpoints.

Changes:

  • Added GET /boat-charging/api/v1/sessions/{session_id}/socket-status endpoint with mapping/validation of external status values.
  • Centralized operation-state constants/mapping into bridge.boat_charging.constants and updated imports accordingly.
  • Updated OpenAPI decorator usage to distinguish between “accepts” vs “requires” access-token headers, and added test coverage + mock data for the new endpoint.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
bridge/settings/base.py Adds config key for the external socket-status session endpoint base URL.
bridge/boat_charging/views/terms_view.py Updates OpenAPI decorator usage to indicate the access token header is not accepted.
bridge/boat_charging/views/session_view.py Adds the new SessionSocketStatusView and updates schema decorator args for session endpoints.
bridge/boat_charging/views/login_view.py Updates OpenAPI decorator usage to indicate the access token header is not accepted.
bridge/boat_charging/views/location_view.py Switches status mapping import to the new constants module and updates schema decorator args.
bridge/boat_charging/views/base_view.py Extends the OpenAPI decorator with accepts_access_token support and optional header requirement behavior.
bridge/boat_charging/urls.py Registers the new socket-status route.
bridge/boat_charging/tests/views/test_session_views.py Adds tests covering the new socket-status endpoint behavior.
bridge/boat_charging/tests/mock_data/socket_status.py Adds mock payloads used by the new socket-status tests.
bridge/boat_charging/serializers/session_serializers.py Adds SessionSocketStatusResponseSerializer and uses centralized constants for choices.
bridge/boat_charging/serializers/location_serializers.py Removes duplicated operation-state constants, importing choices from the new constants module.
bridge/boat_charging/constants.py New module containing operation-state choices, mapping, and occupied substatus choices.

Comment thread bridge/boat_charging/views/base_view.py Outdated
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.

2 participants