fix(aml): set priceDefinitionAllowedDate on manual amlCheck pass#3845
Merged
TaprootFreak merged 2 commits intoJun 9, 2026
Merged
Conversation
…ssed When compliance staff set amlCheck to Pass via the generic update endpoint (PUT /buyCrypto/:id, PUT /buyFiat/:id), priceDefinitionAllowedDate was only persisted if it was explicitly included in the payload. Unlike the automatic AML pass (AmlHelperService) and manualPassAmlCheck, the update path did not couple the date to the Pass transition, leaving transactions stuck in status Created with amlCheck=Pass and a null priceDefinitionAllowedDate. Couple priceDefinitionAllowedDate to the Pass transition in both BuyCryptoService.update and BuyFiatService.update, mirroring the automatic pass behaviour. An explicit payload value still takes precedence.
davidleomay
approved these changes
Jun 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When
amlCheckis set toPassthrough the generic update endpoints used by the compliance tool (PUT /buyCrypto/:id,PUT /buyFiat/:id),priceDefinitionAllowedDatewas only persisted when it was explicitly present in the request payload.The automatic AML pass (
AmlHelperService.getAmlResult) and the dedicatedmanualPassAmlCheckboth setpriceDefinitionAllowedDatetogether with thePasstransition. The genericupdate()path did not, so a manual pass without that field left the transaction withamlCheck = PassbutpriceDefinitionAllowedDate = null, stuck in statusCreated(price definition never allowed → no further processing).Fix
Couple
priceDefinitionAllowedDateto thePasstransition inside theforceUpdateblock of bothBuyCryptoService.updateandBuyFiatService.update, mirroring the automatic pass:An explicit payload value still takes precedence; an already-set date is preserved; otherwise it defaults to now. Logic stays server-side, independent of the frontend.
Scope
BuyCryptoService.updateBuyFiatService.update(same tool path, same bug — fixed for parity)Test plan
type-check,lint,formatcleanamlCheck = Passvia compliance tool without the date checkbox →priceDefinitionAllowedDatenow populated, transaction proceedsFollow-ups (separate PRs)
amlResponsiblesemantics: use a clear marker (e.g.automatic) for API-driven passes and the processing person'suserData.verifiedNamefor compliance-tool passes, instead of the currentAPI/null.priceDefinitionAllowedDateneed a one-off correction.update()Pass →priceDefinitionAllowedDateinvariant.