Skip to content

feat(frontend): make quote freshness and currency validation explicit in send flow - #296

Open
woahwhattheheck wants to merge 3 commits into
RemitFlow:mainfrom
woahwhattheheck:goat/remitflow-279-quote-freshness
Open

woahwhattheheck wants to merge 3 commits into
RemitFlow:mainfrom
woahwhattheheck:goat/remitflow-279-quote-freshness

Conversation

@woahwhattheheck

Copy link
Copy Markdown

Closes #279

Summary

Quotes in the send flow now carry an id, source, timestamps, and currency metadata. Confirmation is blocked when a quote is expired or no longer matches the live form inputs, and the bound quote id is written into the transfer payload so displayed and serialized amounts stay reconciled.

What changed

  • quoteBinding helpers validate the currency matrix, fingerprint priced inputs, assert a quote is still signable, and compare canonical amounts.
  • buildQuote mints a content-addressed quote id + fx.table source + input fingerprint.
  • QuoteCard surfaces source, quote id, priced-at / expires, currency precision, and a refresh affordance when expired.
  • SendMoney invalidates a pending confirmation on field or network changes, disables confirm while expired, and passes quoteId through createTransfer.
  • Optional id / source on the Quote contract and quoteId on Transfer (forward-compatible).

Tradeoffs

  • Quote ids are deterministic for the same inputs + clock so rebuilds under test stay stable; a later refresh (new clock) mints a new id.
  • Network drops clear a pending confirmation rather than silently holding a stale price.

Compatibility

  • Additive contract fields only; legacy fixtures without id / quoteId still parse.
  • Pre-existing main failures (some send-flow precision assertions) are untouched.

Test evidence

npx vitest run \
  test/unit/quote-binding.test.js \
  test/unit/quote-contract.test.js \
  test/integration/send-money-quote-freshness.test.jsx
# Test Files  3 passed | Tests  45 passed

Coverage includes expiry, currency matrix, changed-input binding, amount reconcile, and quote-id payload binding.

Out of scope

  • Broad rewrites, unrelated services, or cosmetic-only changes.

Ready for review

Show quote source, timestamps, expiry, and currency metadata on the card.
Invalidate pending quotes on field or network changes, refuse to confirm
expired or mismatched prices, and bind the quote id into the transfer
payload so displayed and serialized amounts stay reconciled.

Closes RemitFlow#279
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(frontend): make quote freshness and currency validation explicit in send flow

1 participant