Skip to content

fix: load chargebackOutput relation in resetAmlCheck#3463

Merged
TaprootFreak merged 1 commit intodevelopfrom
fix/buy-crypto-reset-aml-load-relations
Mar 19, 2026
Merged

fix: load chargebackOutput relation in resetAmlCheck#3463
TaprootFreak merged 1 commit intodevelopfrom
fix/buy-crypto-reset-aml-load-relations

Conversation

@TaprootFreak
Copy link
Collaborator

Summary

  • resetAmlCheck used findOneBy({ id }) which does not load relations
  • chargebackOutput was always undefined, so the linked fiat_output was never deleted
  • Changed to findOne() with explicit relations: { chargebackOutput: true }

Note

There is an orphaned fiat_output (ID 79958, originEntityId 116175) from before this fix that needs manual cleanup.

Test plan

  • Call DELETE /buyCrypto/:id/amlCheck on a BuyCrypto with a linked FiatOutput
  • Verify the FiatOutput is deleted after the reset

findOneBy did not load the chargebackOutput relation, so the
fiatOutput was never deleted when resetting the AML check.
@TaprootFreak TaprootFreak marked this pull request as ready for review March 19, 2026 09:11
@TaprootFreak TaprootFreak merged commit d82931c into develop Mar 19, 2026
8 checks passed
@TaprootFreak TaprootFreak deleted the fix/buy-crypto-reset-aml-load-relations branch March 19, 2026 09:12
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.

2 participants