User Interface low complexity Shared Component mobile
0
Dependencies
2
Dependents
1
Entities
0
Integrations

Description

Modal dialog displayed when the duplicate detection service identifies a conflicting activity record for the same peer mentor, date, and activity type. Allows coordinators to review the conflict details and choose to cancel or override.

Feature: Proxy & Bulk Activity Registration

duplicate-warning-dialog

Summaries

The Duplicate Activity Warning Dialog is a critical safeguard that protects the accuracy and credibility of program participation data. When a coordinator attempts to log an activity that already exists for the same peer mentor, date, and type, this component surfaces the conflict clearly and puts the decision in the coordinator's hands—cancel to avoid the duplicate, or override with explicit intent. This prevents inflated participation numbers that could misrepresent program outcomes, protecting the organization's reporting integrity with funders and regulatory bodies. As a shared component, it delivers this protection consistently across all registration flows without duplicating logic.

This low-complexity shared modal dialog is reused across single proxy and bulk registration flows, making it a shared dependency whose design must satisfy both contexts. Delivery scope includes conflict detail display (original submitter, timestamp, activity type), explanatory copy for the duplicate detection logic, and two action buttons: Cancel and Override. Testing must validate that the correct conflict details render for each call site, that both action callbacks fire correctly, and that the modal dismisses cleanly without leaving orphaned state. Because this dialog is invoked by service-layer events, end-to-end testing requires coordination with the duplicate detection service integration.

Plan for this to be delivered alongside or just after the duplicate detection service.

A stateless Flutter dialog widget surfaced via `show(BuildContext context, DuplicateConflict conflict)` as a static factory method returning a `Future`. The `DuplicateConflict` model carries the conflicting activity's submitter display name, ISO timestamp, and activity type. The dialog body renders these fields in a structured layout with an explanatory subtitle. Two actions—Cancel and Override—resolve the future with typed enum values consumed by the calling BLoC.

The `onOverrideConfirmed()` and `onCancelRegistration()` callbacks delegate to the future resolution. As a shared component, it must not import feature-specific BLoCs; all coupling flows through the callback interface. Ensure the dialog is dismissed before any async work begins upstream to avoid navigator stack corruption.

Responsibilities

  • Display conflicting activity details (submitter, timestamp, type)
  • Explain duplicate detection logic to the coordinator
  • Offer Cancel and Override confirmation actions

Interfaces

show(BuildContext context, DuplicateConflict conflict)
onOverrideConfirmed()
onCancelRegistration()

Relationships

Dependents (2)

Components that depend on this component

Related Data Entities (1)

Data entities managed by this component