Skip to content

Migrate GroupMembershipBundle to SearchResult per ADR-019 #883

@jeremi

Description

@jeremi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions