CRITICAL story-external-system-integration-configuration-organization-admin-007 8 pts

User Story

As a Organization Administrator
I want the system to track which records have already been exported and prevent the same record from being sent to the external system more than once
So that our accounting system does not contain duplicate expense entries that would require manual correction and could result in double payments

Acceptance Criteria

  • Given a record was successfully exported in a previous sync, When the next scheduled sync runs, Then that record is not included in the new export batch
  • Given an admin clicks 'Sync Now' after a partial failure, When the sync runs, Then only records not previously exported successfully are included, not the entire date range
  • Given an admin needs to re-export a specific record due to a system error on the accounting side, When they click 'Force Re-export', Then they must enter a reason and confirm the action, and the re-export is logged in the audit trail
  • Given I view the export history, When I expand a completed export run, Then I see the list of record IDs exported, the external system's acknowledgement ID, and whether any records were skipped as duplicates
  • Given two admins simultaneously trigger a manual sync, When both syncs run concurrently, Then the system's locking mechanism ensures only one sync runs at a time and the second is queued or rejected with an informative message
  • Given an export run is in progress, When I navigate to the integration dashboard, Then I see a progress indicator showing records processed vs total and an estimated completion time

Business Value

A single duplicate export incident can trigger hours of accounting investigation, correction journal entries, and potential overpayments that require recovery from peer mentors — causing relationship damage and administrative overhead. For HLF, which processes reimbursements monthly at significant volume, duplicate detection is a zero-tolerance requirement. The double-export guard directly prevents financial loss, maintains trust between the organization and its peer mentor network, and satisfies the audit trail requirements of public grant recipients.