End a Chapter Affiliation While Preserving Historical Activity Data
The chapter assignment editor must support a soft-delete (end-date) operation for affiliations. Setting an affiliation to 'ended' removes the peer mentor from active lists and assignment workflows in that chapter, but all activity records attributed to that chapter during the active period remain intact and queryable. The coordinator must confirm the end date and optionally add a note. Ended affiliations are shown in a collapsed 'History' section of the affiliations panel.
User Story
Acceptance Criteria
- Given a peer mentor has an active affiliation in a chapter, when a coordinator selects 'End Affiliation' in the chapter assignment editor, then a confirmation dialog requests an end date and optional note
- Given the coordinator confirms ending an affiliation, when saved, then the affiliation record is updated with an end_date and status changes to 'ended'
- Given an affiliation has been ended, when the affiliations panel loads, then the ended affiliation is hidden by default but visible when the coordinator expands the 'History' section
- Given an affiliation has been ended, when the coordinator views stats for that chapter's period overlapping the active period, then activities from that peer mentor are still counted in historical reports
- Given an affiliation has been ended, when the coordinator opens the proxy activity registration screen to register on behalf of this peer mentor, then the ended chapter is not available as an attribution option
Business Value
Peer mentors periodically leave chapters due to relocation, health, or personal choice. If ending an affiliation deleted historical activities, the organization would lose auditable records required for Bufdir grant accountability. Soft-delete with end-dating ensures compliance with grant reporting requirements (which may reference periods up to 3 years prior), while keeping active views clean and preventing coordinators from accidentally attributing new activities to a chapter the peer mentor has left.
Components
- Chapter Assignment Editor ui
- Multi-Chapter Membership Service service
- Chapter Membership Cubit service
- Contact Chapter Repository data
- Supabase Contact Chapter Adapter infrastructure
- Cross-Chapter Activity Query data