ADR-0017: Editable currency, time, and export preview in the transaction editor
- Status: Accepted
- Date: 2026-08-12
- Deciders: maintainers
- Related: ADR-0009
Context
The transaction editor could only change amount, merchant, direction,
category, status, and note. occurredAt and currency were fixed to values
the capture pipeline derived (bank timestamp, base currency), which made
manually-entered or imported transactions permanently wrong when the guess
was off. Export format was also invisible until the user ran a full export
from Settings.
Decision
The editor gains three capabilities:
- Currency dropdown — a read-only
ExposedDropdownMenuoverCurrency.supportedCodes(). Selecting a currency re-renders the amount field throughMoneyText.reformat, which preserves the minor-unit value and only changes digit representation (e.g. MYR12.34→ JPY1234). This is a representation change, never a foreign-exchange conversion — theLongminor-unit invariant (ADR-0009) is untouched. Unparseable amount text and same-currency selections pass through unchanged. - Date & time pickers — tapping the date field opens Material 3
DatePickerDialog, then aTimePickerdialog. The combined local date/time replacesoccurredAt(epoch millis), which was already a settable draft field but never wired to the UI. - Export preview — a code icon in the top bar serializes the current
draft the same way a full export would (
TransactionDraft.toExportRowmirrorsExportRepository.rows()), resolves category/account display names, and shows the pretty-printed JSON in a dialog with a copy action. The shared pure mapper is the single source of truth for entity → export row field mapping.
Consequences
- Correcting a mis-parsed transaction is now possible without re-importing.
- Currency edits never silently reinterpret stored minor units; switching between equal-digit currencies keeps the display identical.
- The preview makes export format debuggable from the affected record, and
the pure
toExportRowmapper is JVM unit-tested.
Alternatives considered
- Keep the amount text byte-for-byte when switching currency — rejected:
a
2-digit amount shown in a0-digit currency would silently round on save; reformatting keeps what the user typed meaningful. - Reuse
ExportRepositoryfor the preview — rejected: it reads from the DB; the preview must reflect the unsaved draft.