feat: compliance call queue endpoints#3630
Merged
Conversation
Add backend support for the new compliance call-queue feature, exposing five queues based on AML pending transactions and unavailable/suspicious phone-call userData. Endpoints (all guarded by COMPLIANCE role): - GET support/call-queues — counts per queue - GET support/call-queues/clerks — clerk list from setting - GET support/call-queues/:queue/items — items per queue (limit 200) Service layer: - BuyCryptoService.getByAmlReason / countByAmlReason - BuyFiatService.getByAmlReason / countByAmlReason - UserDataService.getByPhoneCallStatuses / countByPhoneCallStatuses All use find() with loadEagerRelations:false (consistent with the pending-review query refactor in #3599). Misc: - Register complianceClerks string[] setting - Extend UserDataComplianceUpdateCols with phoneCallStatus and the four phoneCall*CheckDate fields, so they can be set via the existing admin update endpoint - Resolve usedRef -> refUserName in bulk in UserSupportInfo (one extra query, no N+1) - Drop redundant 'name' field from BankDataService.getPendingReviewSummary return type (unused after #3599) - ParseEnumPipe on the queue param to fail-fast on invalid values
davidleomay
approved these changes
Apr 27, 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.
Summary
support/call-queues*endpoints (counts, clerks, items per queue), guarded by COMPLIANCE roleBuyCryptoService.{get,count}ByAmlReason,BuyFiatService.{get,count}ByAmlReason,UserDataService.{get,count}ByPhoneCallStatuses— all usefind()withloadEagerRelations: false, consistent with the pending-review refactor in feat: compliance pending reviews endpoint #3599complianceClerksstring[] setting; extendsUserDataComplianceUpdateColswithphoneCallStatusand the fourphoneCall*CheckDatefieldsnamefield fromBankDataService.getPendingReviewSummaryreturn type (unused after feat: compliance pending reviews endpoint #3599)ParseEnumPipeon the queue path-param to fail fast on invalid valuesTest plan
npm run build && npm run lintcleanGET /v1/support/call-queuesreturns counts for the five queuesGET /v1/support/call-queues/clerksreturns clerks fromsetting:complianceClerks(fallback empty)GET /v1/support/call-queues/ManualCheckPhone/itemsreturns at most 200 items, sorted by date ascGET /v1/support/call-queues/UnavailableSuspicious/itemsreturns userData with phoneCallStatus in (Unavailable, Suspicious)GET /v1/support/call-queues/foo/itemsreturns 400 (ParseEnumPipe)phoneCall*CheckDatevia existing admin userData PUT works (whitelist now includes them)Depends on
CallQueue/CallQueueItem/PhoneCallStatusdefinitions consumed by the matching frontend PR