User Interface medium complexity mobile
2
Dependencies
0
Dependents
0
Entities
0
Integrations

Description

Modal or bottom-sheet UI allowing coordinators to add or remove chapter affiliations for a contact, enforcing the maximum of 5 simultaneous chapters. Provides a searchable list of available chapters within the organization and prevents duplicate assignments.

Feature: Multi-Chapter Membership Handling

chapter-assignment-editor

Summaries

The Chapter Assignment Editor gives coordinators precise control over which chapters a contact belongs to, with built-in safeguards that prevent over-assignment and data inconsistency. By enforcing the maximum of five simultaneous chapter affiliations directly in the UI, the platform prevents configuration errors that could affect reporting, communications, and eligibility logic downstream. This self-enforcing constraint reduces coordinator mistakes and support requests, lowering operational overhead. The searchable chapter list also speeds up the assignment workflow for organizations with large chapter networks, directly improving staff efficiency during onboarding and reassignment tasks.

This is a medium-complexity mobile UI component with meaningful business rule enforcement that requires careful QA coverage. It depends on both chapter-membership-cubit and multi-chapter-membership-service, making those components prerequisites. The five-chapter maximum enforcement must be tested against all boundary conditions: exactly five selected, attempting to add a sixth, and removing one then re-adding. The searchable chapter list must perform well even with large chapter datasets — confirm with backend whether server-side filtering is needed.

Estimate 5–7 days including the modal/bottom-sheet layout, search implementation, validation logic, and edge-case QA. Accessibility testing for the searchable list (keyboard, screen reader) should be included in the definition of done.

This Flutter modal or bottom-sheet widget receives the contactId and the current List, then allows coordinators to add or remove affiliations before confirming. It depends on chapter-membership-cubit for reading current state and multi-chapter-membership-service for persisting changes. The selectable chapter list should support live search filtering client-side (or server-side if the chapter count is large). Selection state is managed locally within the widget and only committed on onConfirm, keeping Supabase writes transactional.

The showMaxLimitWarning method must trigger visually (e.g., a SnackBar or inline banner) when the user attempts to select a sixth chapter. Duplicate prevention should compare selected chapter IDs against the existing current list before enabling confirmation. Validate all selected IDs in onConfirm before passing to the service. Use WillPopScope or equivalent to prompt unsaved-changes confirmation on dismiss.

Responsibilities

  • Display available chapters as a selectable list
  • Enforce maximum 5 chapter affiliations with user feedback
  • Allow removal of existing chapter affiliations
  • Validate selections before confirming changes

Interfaces

ChapterAssignmentEditor({required String contactId, required List<ContactChapter> current})
onConfirm(List<String> selectedChapterIds)
onDismiss()
build(BuildContext context)
showMaxLimitWarning()

Relationships

Dependencies (2)

Components this component depends on