Problem
Downloading a receipt from batch history produces a file with no
recipients, amounts, or transaction hashes — despite the UI presenting it
as a real receipt for a completed batch.
Severity: Medium
Location: lib/batch-history-adapter.ts:64-79, components/dashboard/HistoryExportCenter.tsx:130-146
Description
getBatchHistory converts job summaries fetched from /api/batch-history
into BatchResult objects with results: [] — the code even comments on
this directly: // Summary view doesn't include individual results.
HistoryExportCenter's handleDownloadBatchReceipt and
handleDownloadBatchCsv pass that summary-only object straight into the
HTML/CSV receipt generators with no intermediate fetch of the full job
data. Both generators derive every payment row from results, so the
downloaded file has an empty payment table despite the batch having real,
completed payments on record.
Steps to Reproduce
- Complete a batch and later reload the dashboard's history view.
- The adapter constructs a summary object with
results: [] for that job.
- Click "Receipt" or "CSV" under Recent Batch Receipts.
- The downloaded file contains no recipients, amounts, statuses, or
transaction hashes.
Expected Behavior
A historical receipt download should contain the same recipients, amounts,
assets, statuses, and transaction hashes as the original completed job.
Suggested Fix Approach
Fetch the full, owner-scoped job result (not just the summary) before
enabling the download action, or add a dedicated history-receipt endpoint
that returns the immutable per-payment detail alongside the summary.
Acceptance Criteria
Problem
Downloading a receipt from batch history produces a file with no
recipients, amounts, or transaction hashes — despite the UI presenting it
as a real receipt for a completed batch.
Severity: Medium
Location:
lib/batch-history-adapter.ts:64-79,components/dashboard/HistoryExportCenter.tsx:130-146Description
getBatchHistoryconverts job summaries fetched from/api/batch-historyinto
BatchResultobjects withresults: []— the code even comments onthis directly:
// Summary view doesn't include individual results.HistoryExportCenter'shandleDownloadBatchReceiptandhandleDownloadBatchCsvpass that summary-only object straight into theHTML/CSV receipt generators with no intermediate fetch of the full job
data. Both generators derive every payment row from
results, so thedownloaded file has an empty payment table despite the batch having real,
completed payments on record.
Steps to Reproduce
results: []for that job.transaction hashes.
Expected Behavior
A historical receipt download should contain the same recipients, amounts,
assets, statuses, and transaction hashes as the original completed job.
Suggested Fix Approach
Fetch the full, owner-scoped job result (not just the summary) before
enabling the download action, or add a dedicated history-receipt endpoint
that returns the immutable per-payment detail alongside the summary.
Acceptance Criteria
detail, not an empty results array
list (not the just-completed in-session job)