Context
PR #280 review identified that the membership history endpoint returns a SearchResult wrapper but internally uses a different pattern than other search endpoints. Per ADR-019, all list/search responses should use SearchResult consistently.
Current Behavior
The /Group/{id}/membership-history endpoint:
- Builds history entries from
spp.group.membership records in Python
- Returns a
SearchResult wrapper via create_search_result()
- Each entry is a plain dict, not a typed schema
Desired Behavior
- Define a
MembershipHistoryEntry schema (or similar)
- Ensure the response structure is consistent with ADR-019
SearchResult conventions
- Consider whether
GroupMembershipBundle schema should be replaced with standard SearchResult
Scope
This is a larger refactoring that affects:
spp_api_v2/schemas/ - schema definitions
spp_api_v2/routers/group.py - endpoint response model
spp_api_v2/services/group_service.py - return types
- Tests
Source
Gemini code review finding on PR #280, triaged as valid but deferred to separate PR.
Context
PR #280 review identified that the membership history endpoint returns a
SearchResultwrapper but internally uses a different pattern than other search endpoints. Per ADR-019, all list/search responses should useSearchResultconsistently.Current Behavior
The
/Group/{id}/membership-historyendpoint:spp.group.membershiprecords in PythonSearchResultwrapper viacreate_search_result()Desired Behavior
MembershipHistoryEntryschema (or similar)SearchResultconventionsGroupMembershipBundleschema should be replaced with standardSearchResultScope
This is a larger refactoring that affects:
spp_api_v2/schemas/- schema definitionsspp_api_v2/routers/group.py- endpoint response modelspp_api_v2/services/group_service.py- return typesSource
Gemini code review finding on PR #280, triaged as valid but deferred to separate PR.