AM-1078 boat charging: add socket status endpoint#213
Open
fhaver-amsterdam wants to merge 5 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
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-statusendpoint with mapping/validation of external status values. - Centralized operation-state constants/mapping into
bridge.boat_charging.constantsand 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. |
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.
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:
GET /boat-charging/api/v1/sessions/{session_id}/socket-statusendpoint with mapping/validation of external status values.bridge.boat_charging.constantsand updated imports accordingly.Affected services
Definition of done
make openapi-diff)make dev)- [ ] Dependencies updated (make requirements)- [ ] Infrastructure config updated (aapp_azure_infra)After PR created (and deployed on dev):
Other notes
GitHub Copilot was used in writing the code