Skip to content

TransactionLinkingModal — show merchant+date instead of raw UUID for matched receipts

Why

The accounting Match Transaction modal's Receipts tab was rendering raw receipt IDs (83e45276-cf15-491a-…) for already-matched receipts. The persisted MatchedReceipt allocation only carries id / amount / audit fields — no display label — so the modal had nothing to render except the UUID. Sibling display fixes shipped recently for vendor invoices (T-090) and the receipt detail drawer (I-004 / T-087); this closes the matched-receipt UUID-in-modal gap in the same surface area.

What changed

  • New API: POST /api/accounting/matched-receipt-summaries — returns { merchant, transactionDate, total, currency } for a batch of receipt ids, scoped to the subsidiary DB.
  • components/accounting/transactions/TransactionLinkingModal.tsx — lazily fetches summaries when opened on a tx with matched receipts. Renders "Merchant — YYYY-MM-DD" in place of the UUID. UUID stays as the title tooltip (hover); short-id fallback shows while loading or if the receipt has since been deleted (no crash).

Decision log

2026-06-23 — opened + landed (cherry-picked from PR #739)

  • Attestation (Records (Infrastructure)): read AGENTS.md; scope-scanned tasks — no covering task. T-090 (vendor-invoice display name) + T-087 (receipt detail drawer) are adjacent display fixes by Accounting (Diagnostics) but on different surfaces (transaction display / drawer, respectively). This task closes the matched-receipt-in-linking-modal gap.
  • Source: Records (Infrastructure) · https://claude.ai/code/session_018RDB37kCqfouHdygVXTAtD
  • Owner directive (verbatim, 2026-06-23):

    "If the task included in the PRs are not tasks created and listed on the Task Board, do that, if they are, but you have not signed to those tasks, sign them according to the instruction on AGENTS.MD, while proceed to work on the still open PRs"

  • What landed (origin/nightly):
  • 35e9efcc (was b4340ab4 in PR #739) — modal fix + new endpoint. Cherry-pick had an Auto-merging of TransactionLinkingModal.tsx (unrelated nightly changes coexist cleanly with the merchant+date display block). New file pages/api/accounting/matched-receipt-summaries.ts landed unmodified.
  • PR #739 closed with a pointer to this SHA.
  • Branch policy: committed straight to nightly per the 🟢 lockstep operational signal; main to be FF'd in the same push.
  • Blast radius: single modal component + one new read-only API endpoint. Doesn't change matching behavior or persisted MatchedReceipt data. Other linking flows (project invoices / coaching invoices) untouched.
  • Verification plan (post-deploy):
  • Open a tx with matched receipts → modal Receipts tab shows "Merchant — 2026-06-15" instead of 83e45276-….
  • Hover the merchant text → tooltip shows the full receipt id.
  • Tx with a matched id no longer in Firestore → short-id fallback, no crash.