Multi-Chapter Membership Handling
Feature Detail
Description
Supports NHF's requirement where a single member or peer mentor can belong to up to 5 local chapters simultaneously. The system must clearly display all affiliations on the contact profile and enforce rules to prevent the same activity from being reported multiple times by coordinators from different chapters. Duplicate activity detection requires comparing submitted activity records across coordinators affiliated with the same contact. A warning is surfaced when a potential duplicate is detected before submission is finalized. This feature is NHF-specific but the underlying data model (many-to-many contact-to-chapter) may benefit other organizations.
Analysis
Directly prevents double-counting in Bufdir reporting, which would compromise NHF's funding eligibility. Reduces administrative overhead for coordinators managing cross-chapter members.
Requires a junction table in Supabase (contact_chapters). Duplicate detection logic should run on activity submission, comparing contact_id + date + activity_type across all chapters the contact belongs to. Surface as a dismissible warning dialog, not a hard block. Bloc/Cubit pattern fits well for the multi-step validation flow.
Components (205)
Shared Components
These components are reused across multiple features
User Interface (59)
Service Layer (52)
Data Layer (33)
Infrastructure (54)
User Stories (14)
As a As a Coordinator
I want to see a visual indicator on contact cards and contact detail screens showing all chapters a peer mentor belongs to
So that I can immediately identify multi-chapter members and understand their organizational context without navigating to a separate screen
- Given a peer mentor belongs to two or more chapters, when the contact card is rendered in the contact list, then a row of multi-chapter affiliation chips is visible below the peer mentor's name
- Given a peer mentor belongs to only one chapter, when the contact card is rendered, then no affiliation chips are shown
- Given affiliation chips are shown on a contact detail screen, when the coordinator taps a chip, then the chapter affiliations panel scrolls into view or is highlighted
- +2 more
As a As a Coordinator
I want to mark a peer mentor's affiliation with a specific chapter as ended without deleting their historical activity records from that chapter
So that past activities remain auditable and included in historical Bufdir reports while the peer mentor no longer appears as active in that chapter going forward
- 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
- +2 more
As a As a Coordinator
I want to view statistics and generate reports that correctly scope activities for peer mentors who belong to multiple chapters, showing only activities attributed to my chapter
So that my chapter's performance data is accurate and I am not seeing or reporting on activities that belong to other chapters
- Given a coordinator views the stats screen for a peer mentor affiliated with multiple chapters, when the screen loads, then only activities attributed to the coordinator's own chapter are included in the counts and charts
- Given the coordinator views their own coordinator stats dashboard, when activities are aggregated, then activities from peer mentors shared with other chapters are counted only once per chapter attribution
- Given the coordinator initiates a Bufdir export, when the export query executes, then only activities attributed to the coordinator's chapter are included in the exported dataset
- +2 more
As a As a Organization Administrator
I want to see a visual indicator on contact cards and contact detail screens showing all chapters a peer mentor belongs to
So that I can immediately identify multi-chapter members and understand their organizational context without navigating to a separate screen
- Given a peer mentor belongs to two or more chapters, when the contact card is rendered in the contact list, then a row of multi-chapter affiliation chips is visible below the peer mentor's name
- Given a peer mentor belongs to only one chapter, when the contact card is rendered, then no affiliation chips are shown
- Given affiliation chips are shown on a contact detail screen, when the coordinator taps a chip, then the chapter affiliations panel scrolls into view or is highlighted
- +2 more
As a As a Organization Administrator
I want to mark a peer mentor's affiliation with a specific chapter as ended without deleting their historical activity records from that chapter
So that past activities remain auditable and included in historical Bufdir reports while the peer mentor no longer appears as active in that chapter going forward
- 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
- +2 more
As a As a Organization Administrator
I want to view statistics and generate reports that correctly scope activities for peer mentors who belong to multiple chapters, showing only activities attributed to my chapter
So that my chapter's performance data is accurate and I am not seeing or reporting on activities that belong to other chapters
- Given a coordinator views the stats screen for a peer mentor affiliated with multiple chapters, when the screen loads, then only activities attributed to the coordinator's own chapter are included in the counts and charts
- Given the coordinator views their own coordinator stats dashboard, when activities are aggregated, then activities from peer mentors shared with other chapters are counted only once per chapter attribution
- Given the coordinator initiates a Bufdir export, when the export query executes, then only activities attributed to the coordinator's chapter are included in the exported dataset
- +2 more
As a As a Coordinator
I want to view a contact's full list of chapter affiliations and manage their membership across multiple chapters
So that I can maintain accurate records of which chapters a peer mentor belongs to and ensure their activity is attributed correctly across the organization
- Given a contact has affiliations in multiple chapters, when a coordinator opens the contact detail screen, then a 'Chapter Affiliations' panel is visible listing every affiliated chapter with name, role, and status
- Given the affiliations panel is visible, when the coordinator taps 'Edit Affiliations', then the chapter assignment editor opens with the current affiliations pre-populated
- Given the chapter assignment editor is open, when the coordinator adds a new chapter affiliation and saves, then the new affiliation is persisted and the panel updates immediately
- +2 more
As a As a Coordinator
I want to assign or confirm the primary chapter attribution when registering an activity for a peer mentor who belongs to multiple chapters
So that each activity is counted against the correct chapter's statistics and reporting quota, even when a peer mentor participates across chapter boundaries
- Given a peer mentor has two or more chapter affiliations, when the coordinator reaches the summary step in the activity wizard, then a chapter attribution selector is displayed showing all affiliated chapters
- Given the chapter attribution selector is displayed, when no explicit selection is made, then the coordinator's own chapter is pre-selected as the default
- Given the coordinator selects a different chapter for attribution, when the activity is saved, then the activity record stores the selected chapter ID and that chapter's statistics reflect the new entry
- +2 more
As a As a Coordinator
I want to add a peer mentor to an additional chapter in a way that preserves all their existing chapter affiliations
So that a peer mentor who expands their volunteering across chapters retains their full history and continues to receive activities and statistics from all affiliated chapters
- Given a peer mentor already has two chapter affiliations, when a coordinator opens the chapter assignment editor and adds a third chapter, then all three affiliations are active after saving
- Given a peer mentor already has five active chapter affiliations (the maximum), when a coordinator attempts to add a sixth, then the save button is disabled and an explanatory message states the maximum has been reached
- Given the chapter assignment editor is open, when the coordinator searches for a chapter by partial name, then matching chapters are shown in a dropdown for selection
- +2 more
As a As a Coordinator
I want to receive a warning when an activity I am about to register may already have been registered by a coordinator in another chapter for the same peer mentor
So that I can avoid double-counting activities and ensure that Bufdir statistics accurately reflect the real number of unique interactions
- Given a peer mentor belongs to at least two chapters, when a coordinator completes the activity wizard and taps submit, then the system queries cross-chapter activity history before persisting
- Given a cross-chapter duplicate is detected (same peer mentor, same date ±1 day, same activity type), when the submit action is triggered, then a duplicate warning dialog is displayed with the conflicting record's details
- Given the duplicate warning dialog is shown, when the coordinator selects 'Proceed Anyway', then the activity is saved and a duplicate-reviewed flag is set on the record
- +3 more
As a As a Organization Administrator
I want to view a contact's full list of chapter affiliations and manage their membership across multiple chapters
So that I can maintain accurate records of which chapters a peer mentor belongs to and ensure their activity is attributed correctly across the organization
- Given a contact has affiliations in multiple chapters, when a coordinator opens the contact detail screen, then a 'Chapter Affiliations' panel is visible listing every affiliated chapter with name, role, and status
- Given the affiliations panel is visible, when the coordinator taps 'Edit Affiliations', then the chapter assignment editor opens with the current affiliations pre-populated
- Given the chapter assignment editor is open, when the coordinator adds a new chapter affiliation and saves, then the new affiliation is persisted and the panel updates immediately
- +2 more
As a As a Organization Administrator
I want to assign or confirm the primary chapter attribution when registering an activity for a peer mentor who belongs to multiple chapters
So that each activity is counted against the correct chapter's statistics and reporting quota, even when a peer mentor participates across chapter boundaries
- Given a peer mentor has two or more chapter affiliations, when the coordinator reaches the summary step in the activity wizard, then a chapter attribution selector is displayed showing all affiliated chapters
- Given the chapter attribution selector is displayed, when no explicit selection is made, then the coordinator's own chapter is pre-selected as the default
- Given the coordinator selects a different chapter for attribution, when the activity is saved, then the activity record stores the selected chapter ID and that chapter's statistics reflect the new entry
- +2 more
As a As a Organization Administrator
I want to add a peer mentor to an additional chapter in a way that preserves all their existing chapter affiliations
So that a peer mentor who expands their volunteering across chapters retains their full history and continues to receive activities and statistics from all affiliated chapters
- Given a peer mentor already has two chapter affiliations, when a coordinator opens the chapter assignment editor and adds a third chapter, then all three affiliations are active after saving
- Given a peer mentor already has five active chapter affiliations (the maximum), when a coordinator attempts to add a sixth, then the save button is disabled and an explanatory message states the maximum has been reached
- Given the chapter assignment editor is open, when the coordinator searches for a chapter by partial name, then matching chapters are shown in a dropdown for selection
- +2 more
As a As a Organization Administrator
I want to receive a warning when an activity I am about to register may already have been registered by a coordinator in another chapter for the same peer mentor
So that I can avoid double-counting activities and ensure that Bufdir statistics accurately reflect the real number of unique interactions
- Given a peer mentor belongs to at least two chapters, when a coordinator completes the activity wizard and taps submit, then the system queries cross-chapter activity history before persisting
- Given a cross-chapter duplicate is detected (same peer mentor, same date ±1 day, same activity type), when the submit action is triggered, then a duplicate warning dialog is displayed with the conflicting record's details
- Given the duplicate warning dialog is shown, when the coordinator selects 'Proceed Anyway', then the activity is saved and a duplicate-reviewed flag is set on the record
- +3 more