Receive a Duplicate Activity Warning Before Submitting
Before the final submission, the registration cubit checks the local and remote activity store for a potential duplicate: same activity type, same date, same peer mentor, within a ±15-minute duration window. If a potential duplicate is found, a warning bottom sheet is shown listing the existing similar registration. The peer mentor can choose to proceed with the new registration (with a reason field) or cancel and review the existing entry. NHF specifically flagged cross-coordinator duplicate detection; this story covers self-duplicate detection for the peer mentor.
User Story
Acceptance Criteria
- Given I submit an activity of type 'Phone Call' on today's date for 30 minutes, and I already have a 'Phone Call' registration for today lasting 30 minutes, when I tap Confirm, then the duplicate warning bottom sheet appears before the record is saved
- Given the duplicate warning is shown, when I tap 'Submit Anyway', then a reason selector appears with options (e.g. 'Two separate calls', 'Correcting previous entry') before the submission proceeds
- Given the duplicate warning is shown, when I tap 'Cancel', then the bottom sheet closes and I am returned to the registration form with my data intact
- Given the duplicate check requires a network call and the device is offline, when I submit, then the submission proceeds without a duplicate check and a local flag is set to perform the check when connectivity is restored
- Given I have submitted a registration flagged as a potential duplicate, when the coordinator views the activity list, then both records are marked with a duplicate warning indicator
Business Value
Duplicate registrations directly inflate Bufdir statistics, leading to incorrect grant calculations and potential audit issues. NHF specifically raised this as a concern across coordinators; catching duplicates at the point of entry for the peer mentor is the cheapest place to prevent the problem.
Components
- Registration Confirmation View ui
- Activity Registration Cubit service
- Activity Registration Service service
- Duplicate Warning Bottom Sheet ui
- Duplicate Detection Service service
- Duplicate Check Repository data
- Duplicate Detection BLoC infrastructure
- Duplicate Activity Warning Dialog ui
- Duplicate Activity Detection Service service