Accounting Export
Feature Detail
Description
The Accounting Export feature gives admin users a manual export mechanism that produces accounting-ready files from approved expense and reimbursement records. Administrators select a date range or approval batch and download a file formatted for Xledger, Dynamics, or generic CSV import. This feature complements the Accounting API by providing a fallback for organizations not yet using live API connectivity and serving as an independent audit artifact for finance and compliance staff.
Sources & reasoning
Both source passages confirm Phase 3 / Fase 3 as the delivery window for accounting integration, normalizing to v1.1. The blueprint defines Accounting API and Accounting Export as distinct features; this spec preserves that split because the export path serves a materially different purpose - admin-initiated manual download and audit artifact - rather than duplicating the automated push logic of the API adapter.
No source references — this artifact was included based on reasoning alone (see above).
Analysis
Manual export capability provides an immediate, low-risk path to accounting workflow automation that does not require configuring live API credentials or establishing network connectivity between Meander and an external accounting system. This lowers the adoption barrier for new tenants and provides a safety net during API downtime or credential rotation. For organizations receiving Bufdir grants, clean and traceable expense records are essential for audit readiness, and a downloadable export provides that evidence in a format that finance staff and external auditors already understand without requiring access to the live system or additional tooling to interpret the data.
Implement as a Next.js API route accepting query parameters for date range, organization ID, and output format. Apply an org-specific field mapping configuration to rename columns and populate vendor-required fields such as cost-center codes and account numbers. Support CsvWriter, XlsxWriter, and JsonWriter implementations behind a shared FormatWriter abstraction. Stream the HTTP response to avoid memory pressure on large export batches. The Admin Web Portal export UI displays an estimated row count before download and logs every export action to audit_logs with user identity, timestamp, date range, and selected format. Filter strictly on approved expense status - draft, pending, and voided records must not appear in any exported file.
Components (43)
Shared Components
These components are reused across multiple features
Service Layer (11)
Data Layer (23)
Infrastructure (7)
User Stories
No user stories have been generated for this feature yet.