Skip to content

feat: auto-derive recall user from bank tx#3617

Merged
TaprootFreak merged 1 commit intodevelopfrom
feat/recall-auto-derive-user
Apr 23, 2026
Merged

feat: auto-derive recall user from bank tx#3617
TaprootFreak merged 1 commit intodevelopfrom
feat/recall-auto-derive-user

Conversation

@TaprootFreak
Copy link
Copy Markdown
Collaborator

Summary

  • When POST /recall is called with bankTxId but no explicit userId, derive the user automatically from the bank-tx relation chain (transaction → buyCrypto → buyCryptoChargeback → buyFiats)
  • Load the relations needed by BankTx.user getter so it actually resolves

Why

Lets the services frontend create recalls from contexts (user-data transactions tab) where no userId is available on the client side — the bank tx already knows its owning user via the existing getter, so deriving it server-side keeps the frontend simple.

Backward compatible: existing callers that pass userId explicitly keep the same behavior.

Test plan

  • POST /recall with { bankTxId, sequence, reason, comment, fee } (no userId) → recall created, recall.user matches the bankTx's owning user
  • POST /recall with explicit userId → behaves as before
  • POST /recall with checkoutTxId only → unchanged

When POST /recall is called without an explicit userId, resolve the
user via the BankTx.user getter (transaction → buyCrypto →
buyCryptoChargeback → buyFiats). Load the top-level relations so the
getter can resolve through the eager transaction.user chain.

Backward compatible: callers passing userId explicitly keep their
existing behavior.
@TaprootFreak TaprootFreak force-pushed the feat/recall-auto-derive-user branch from f0f9f61 to 96eb31e Compare April 23, 2026 11:40
@TaprootFreak TaprootFreak merged commit 5e0f6fe into develop Apr 23, 2026
7 checks passed
@TaprootFreak TaprootFreak deleted the feat/recall-auto-derive-user branch April 23, 2026 11:46
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.

1 participant