External System Integration Configuration
Feature Detail
Description
Each organization connects to different external systems for accounting and member management: Blindeforbundet uses Xledger for accounting with API integration needs; HLF integrates with a Dynamics-based portal ('min side') that must not overlap with the app's functionality; NHF references Cornerstone and Consio. This feature provides a per-organization configuration layer for external integration endpoints, API credentials (stored as Supabase secrets), field mappings, and sync schedules. The configuration is managed through the admin portal and determines how the app formats export payloads, which fields to include in API calls, and how to handle authentication with the external system. It also covers the Bufdir reporting export format, which while common to all organizations may require per-org field mappings to match their specific grant agreements and reporting templates.
Analysis
Integration with existing accounting and member systems is a hard prerequisite for replacing manual Excel/Word workflows, particularly for reimbursement processing (HLF, Blindeforbundet) and Bufdir reporting (all organizations). Without this configuration layer, each integration would require a separate code deployment per organization, making the platform unscalable.
Store integration configs in an `organization_integrations` table with `integration_type` (xledger, dynamics, cornerstone, consio, bufdir), encrypted credential fields (use Supabase Vault), and a JSONB `field_mappings` column. Implement a REST API adapter pattern in the backend (Supabase Edge Functions) so each integration type has a standard interface. For HLF's Dynamics coordination specifically, include an 'excluded features' config to prevent the app from duplicating portal functionality — surfaced as a subset of the feature flags system.
Components (214)
Shared Components
These components are reused across multiple features
User Interface (59)
Service Layer (52)
Data Layer (33)
Infrastructure (54)
User Stories (7)
As a As an Organization Administrator
I want to define when and how often data is automatically synchronized to external systems
So that our accounting team receives timely data exports without requiring manual intervention each time
- Given I am editing an integration, When I navigate to 'Sync Schedule', Then I see options for Manual Only, Daily, Weekly, Monthly, and Custom schedule
- Given I select Daily sync, When I set the time to 02:00 and save, Then the system schedules a nightly sync job and displays the next scheduled run timestamp
- Given I select Custom schedule, When I enter a cron expression, Then the system validates the expression syntax and shows a human-readable description of when syncs will occur
- +3 more
As a As an Organization Administrator
I want to specify which data categories and feature areas are included or excluded from external system synchronization
So that only relevant, approved data reaches our external systems and sensitive or incomplete records are not inadvertently exported
- Given I am configuring an integration, When I open 'Included Data', Then I see a checklist of data categories: expense claims, mileage claims, driver honorariums, activity logs, with toggles for each
- Given I enable 'Expense Claims', When I configure the filter, Then I can specify that only claims with status 'Approved' are exported, excluding 'Pending' and 'Rejected'
- Given I set a date range filter, When I run a sync, Then only records created or approved within the specified date range are included in the export
- +3 more
As a As an Organization Administrator
I want to define how data fields in the app map to fields in our external accounting or reporting system
So that exported records arrive in the correct format and columns expected by our accounting team without requiring manual transformation
- Given an active integration exists, When I open the Field Mapping Editor, Then I see two columns: app fields on the left and external system fields on the right, with drag-and-drop or dropdown matching
- Given I am mapping a date field, When I select the external system's date field, Then I can choose the output format (ISO 8601, DD.MM.YYYY, epoch) required by the target system
- Given I have created a mapping, When I click 'Preview Mapping' with sample data, Then the system shows 3-5 example records transformed according to my mapping so I can visually verify correctness
- +3 more
As a As an Organization Administrator
I want to view real-time integration health status, recent sync history, and detailed error logs
So that I can proactively detect and resolve integration failures before they impact payroll or accounting deadlines
- Given I open the Integration Configuration Dashboard, When integrations are displayed, Then each shows a status indicator: green (last sync successful), yellow (last sync had warnings), red (last sync failed or no sync in 48h)
- Given an integration is in error state, When I click on it, Then I see the error message returned by the external system, the timestamp of failure, and a list of records that failed to export
- Given I view a failed record, When I expand the error detail, Then I see the specific validation message from the external system (e.g., 'Invalid cost center code: 9999') and the field that caused the failure
- +3 more
As a As an Organization Administrator
I want to configure a connection to our accounting system (Xledger or Dynamics) through a guided setup wizard
So that expense claims and reimbursements are automatically exported to our accounting platform without manual data entry
- Given I am an org admin navigating to Settings, When I select 'External Integrations', Then I see a dashboard listing available integration types and their current status (not configured, active, error)
- Given I click 'Add Integration', When the setup wizard opens, Then I can select from supported integration types: Xledger, Dynamics, or Generic REST API
- Given I have selected Xledger as my integration type, When I enter API credentials and click 'Test Connection', Then the system validates the credentials against the Xledger sandbox/production endpoint and shows a success or failure message within 10 seconds
- +3 more
As a As an Organization Administrator
I want to securely store, view the status of, and rotate API credentials for external system integrations
So that our integration credentials remain secure, are not exposed in plain text, and can be updated when keys expire or are compromised without service interruption
- Given I enter API credentials during integration setup, When I save them, Then the credentials are stored encrypted and only a masked representation (e.g., '••••••••abcd') is shown in the UI
- Given I need to update credentials due to a key rotation, When I click 'Update Credentials', Then I can enter new credentials without deleting the integration configuration or sync history
- Given new credentials are entered, When I click 'Validate and Save', Then the system tests the new credentials against the live endpoint before replacing the old credentials, ensuring no downtime
- +3 more
As a As an 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
- 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
- +3 more