Accounting System Export and Integration
Feature Detail
Description
Provides export of approved expense claims in formats compatible with Xledger (Blindeforbundet) and the Dynamics portal (HLF). At minimum, this includes a structured CSV/JSON export that maps claim fields to the target system's chart of accounts. The long-term target is a direct API integration where approved claims are pushed automatically to the accounting system without manual file transfer. The export covers all approved claims in a configurable date range, grouped by peer mentor and expense type. The export record is marked in the database to prevent double-export. Coordinators and org admins can trigger exports from the admin interface; the system confirms how many claims were included and flags any that were skipped due to missing required fields.
Analysis
Eliminates manual re-keying of approved claims into accounting systems, which is currently a significant source of errors and coordinator time. A reliable export path is a prerequisite for organizations to trust the app as their system of record for reimbursements.
Abstract the export format behind an `AccountingExporter` interface with org-specific implementations (XledgerExporter, DynamicsExporter). For MVP, file-based export (CSV download) is acceptable; API push can follow. Use Supabase Edge Functions for server-side export generation to avoid exposing accounting credentials to the mobile client. Store export run metadata (timestamp, claim IDs included, org, triggered by) for audit.
Components (210)
Shared Components
These components are reused across multiple features
User Interface (59)
Service Layer (52)
Data Layer (33)
Infrastructure (54)
User Stories (16)
As a As a Coordinator
I want to specify which expense categories or activity types should be excluded from accounting exports
So that internal honoraria or non-reimbursable items are not incorrectly submitted to the accounting system and cause reconciliation errors
- Given a coordinator opens the exclusions configuration panel, when the page loads, then all expense types and activity categories are listed with toggle switches
- Given a coordinator marks an expense type as excluded, when they save and later run an export, then claims of that type are not included in the export count or file regardless of their approval status
- Given an excluded expense type has pending claims, when the coordinator views the export preview, then a summary shows how many records are being excluded and why
- +2 more
As a As a Coordinator
I want to download a CSV or JSON export file of approved claims when direct API integration is not available or temporarily unavailable
So that I can manually upload reimbursement data to our accounting system and maintain continuity during integration outages or onboarding periods
- Given a coordinator selects a date range and chooses Download as CSV, when they confirm, then a correctly formatted CSV file is generated and downloaded containing all approved claims for that period
- Given a coordinator chooses Download as JSON, when they confirm, then a structured JSON file with the same data is downloaded with field names matching the organization's configured field mappings
- Given the CSV is opened in a spreadsheet application, when the coordinator reviews it, then column headers correspond to the target accounting system's expected import field names
- +2 more
As a As a Organization Administrator
I want to specify which expense categories or activity types should be excluded from accounting exports
So that internal honoraria or non-reimbursable items are not incorrectly submitted to the accounting system and cause reconciliation errors
- Given a coordinator opens the exclusions configuration panel, when the page loads, then all expense types and activity categories are listed with toggle switches
- Given a coordinator marks an expense type as excluded, when they save and later run an export, then claims of that type are not included in the export count or file regardless of their approval status
- Given an excluded expense type has pending claims, when the coordinator views the export preview, then a summary shows how many records are being excluded and why
- +2 more
As a As a Organization Administrator
I want to download a CSV or JSON export file of approved claims when direct API integration is not available or temporarily unavailable
So that I can manually upload reimbursement data to our accounting system and maintain continuity during integration outages or onboarding periods
- Given a coordinator selects a date range and chooses Download as CSV, when they confirm, then a correctly formatted CSV file is generated and downloaded containing all approved claims for that period
- Given a coordinator chooses Download as JSON, when they confirm, then a structured JSON file with the same data is downloaded with field names matching the organization's configured field mappings
- Given the CSV is opened in a spreadsheet application, when the coordinator reviews it, then column headers correspond to the target accounting system's expected import field names
- +2 more
As a As a Coordinator
I want to view a full history of past accounting exports including date, period covered, record count, and outcome
So that I can confirm which periods have been submitted, identify failed exports that need retrying, and provide audit evidence when finance queries arise
- Given a coordinator opens the export history panel, when the page loads, then all past export runs for their organization are listed in reverse chronological order
- Given an export run is displayed, when the coordinator taps it, then they see the covered period, record count, target system, initiating user, and individual claim references
- Given a failed export run exists, when the coordinator views it, then a Retry button is visible and re-triggers the export edge function for that run
- +2 more
As a As a Coordinator
I want to see the current health status of the accounting system integration and receive alerts when the connection breaks or an export fails
So that I am not left unaware of silent failures that could result in missed reimbursements going unnoticed for weeks
- Given the accounting integration is configured, when the coordinator opens the integration dashboard, then they see a health indicator showing Connected, Degraded, or Error with a last-checked timestamp
- Given the accounting system returns an authentication error during a scheduled health check, when the error is detected, then the coordinator receives an in-app notification and the dashboard shows an Error state with guidance to check credentials
- Given an export edge function call fails due to a network timeout, when the failure is logged, then the export run is marked as failed in the export-run-repository and the coordinator is notified
- +2 more
As a As a Coordinator
I want to define how expense types and cost categories in the app correspond to account codes in our accounting system
So that exported data is correctly classified in our chart of accounts without requiring the finance team to manually recode entries after import
- Given a coordinator opens the field mapping editor, when the page loads, then all expense types and activity categories defined in the app are listed with empty mapping fields for the target system
- Given the coordinator assigns an account code to an expense type, when they save, then the chart-of-accounts-mapper uses this mapping for all future exports
- Given an expense type has no mapping defined, when a coordinator triggers an export that includes claims of that type, then the system warns about unmapped categories and prevents export until resolved
- +2 more
As a As a Organization Administrator
I want to view a full history of past accounting exports including date, period covered, record count, and outcome
So that I can confirm which periods have been submitted, identify failed exports that need retrying, and provide audit evidence when finance queries arise
- Given a coordinator opens the export history panel, when the page loads, then all past export runs for their organization are listed in reverse chronological order
- Given an export run is displayed, when the coordinator taps it, then they see the covered period, record count, target system, initiating user, and individual claim references
- Given a failed export run exists, when the coordinator views it, then a Retry button is visible and re-triggers the export edge function for that run
- +2 more
As a As a Organization Administrator
I want to see the current health status of the accounting system integration and receive alerts when the connection breaks or an export fails
So that I am not left unaware of silent failures that could result in missed reimbursements going unnoticed for weeks
- Given the accounting integration is configured, when the coordinator opens the integration dashboard, then they see a health indicator showing Connected, Degraded, or Error with a last-checked timestamp
- Given the accounting system returns an authentication error during a scheduled health check, when the error is detected, then the coordinator receives an in-app notification and the dashboard shows an Error state with guidance to check credentials
- Given an export edge function call fails due to a network timeout, when the failure is logged, then the export run is marked as failed in the export-run-repository and the coordinator is notified
- +2 more
As a As a Organization Administrator
I want to define how expense types and cost categories in the app correspond to account codes in our accounting system
So that exported data is correctly classified in our chart of accounts without requiring the finance team to manually recode entries after import
- Given a coordinator opens the field mapping editor, when the page loads, then all expense types and activity categories defined in the app are listed with empty mapping fields for the target system
- Given the coordinator assigns an account code to an expense type, when they save, then the chart-of-accounts-mapper uses this mapping for all future exports
- Given an expense type has no mapping defined, when a coordinator triggers an export that includes claims of that type, then the system warns about unmapped categories and prevents export until resolved
- +2 more
As a As a Coordinator
I want to be warned and blocked when I attempt to export a period that has already been submitted to the accounting system
So that we avoid duplicate entries in our accounting ledger that would require manual correction and create financial discrepancies
- Given a period has been successfully exported, when a coordinator selects the same date range and triggers export, then the double-export guard intercepts before any claims are queried and shows a warning with the original export run details
- Given the coordinator sees the duplicate warning, when they tap Cancel, then no export is executed and the screen returns to the date range picker
- Given the coordinator sees the duplicate warning, when they tap Override and Confirm, then the export proceeds and the new run is logged as a deliberate re-export with the override noted
- +2 more
As a As a Coordinator
I want to securely configure and test the connection between the app and our organization's accounting system
So that exported claims reach the correct Xledger or Dynamics environment without manual IT involvement for each export
- Given a coordinator opens the integration setup wizard, when they select an integration type (Xledger or Dynamics), then the wizard presents the appropriate credential fields for that system
- Given credentials are entered, when the coordinator taps Test Connection, then the system performs a lightweight authenticated call to the accounting system and reports success or failure with a human-readable message
- Given a successful test, when the coordinator saves the configuration, then credentials are encrypted and stored in the accounting-credentials-vault and are never displayed in plaintext again
- +2 more
As a As a Coordinator
I want to export all approved expense claims for a selected date range directly to our connected accounting system (Xledger or Dynamics)
So that the finance team receives accurate, structured reimbursement data without manual re-entry or risk of transcription errors
- Given a coordinator opens the accounting export screen, when they select a date range and tap Export, then the system queries all approved claims in that period and displays a count before confirmation
- Given a coordinator confirms the export, when the export runs, then approved claims are mapped to the correct accounts via chart-of-accounts-mapper and sent to the configured system (Xledger or Dynamics)
- Given a period has already been exported, when a coordinator attempts to re-export the same period, then the double-export guard warns them and requires explicit override before proceeding
- +2 more
As a As a Organization Administrator
I want to be warned and blocked when I attempt to export a period that has already been submitted to the accounting system
So that we avoid duplicate entries in our accounting ledger that would require manual correction and create financial discrepancies
- Given a period has been successfully exported, when a coordinator selects the same date range and triggers export, then the double-export guard intercepts before any claims are queried and shows a warning with the original export run details
- Given the coordinator sees the duplicate warning, when they tap Cancel, then no export is executed and the screen returns to the date range picker
- Given the coordinator sees the duplicate warning, when they tap Override and Confirm, then the export proceeds and the new run is logged as a deliberate re-export with the override noted
- +2 more
As a As a Organization Administrator
I want to securely configure and test the connection between the app and our organization's accounting system
So that exported claims reach the correct Xledger or Dynamics environment without manual IT involvement for each export
- Given a coordinator opens the integration setup wizard, when they select an integration type (Xledger or Dynamics), then the wizard presents the appropriate credential fields for that system
- Given credentials are entered, when the coordinator taps Test Connection, then the system performs a lightweight authenticated call to the accounting system and reports success or failure with a human-readable message
- Given a successful test, when the coordinator saves the configuration, then credentials are encrypted and stored in the accounting-credentials-vault and are never displayed in plaintext again
- +2 more
As a As a Organization Administrator
I want to export all approved expense claims for a selected date range directly to our connected accounting system (Xledger or Dynamics)
So that the finance team receives accurate, structured reimbursement data without manual re-entry or risk of transcription errors
- Given a coordinator opens the accounting export screen, when they select a date range and tap Export, then the system queries all approved claims in that period and displays a count before confirmation
- Given a coordinator confirms the export, when the export runs, then approved claims are mapped to the correct accounts via chart-of-accounts-mapper and sent to the configured system (Xledger or Dynamics)
- Given a period has already been exported, when a coordinator attempts to re-export the same period, then the double-export guard warns them and requires explicit override before proceeding
- +2 more