Skip to content

feat: compliance pending reviews endpoint#3599

Merged
bernd2022 merged 2 commits intodevelopfrom
feature/compliance-pending-reviews
Apr 27, 2026
Merged

feat: compliance pending reviews endpoint#3599
bernd2022 merged 2 commits intodevelopfrom
feature/compliance-pending-reviews

Conversation

@bernd2022
Copy link
Copy Markdown
Collaborator

Summary

  • Adds GET /support/pending-reviews returning a summary of all kyc_step and bank_data entries in ManualReview or InternalReview, grouped by type and name with per-status counts.
  • Adds GET /support/pending-reviews/items?type=&name=&status= returning the affected users for a given review category.
  • Both endpoints mirror the auth/role guards of the existing pending-onboardings endpoint (Compliance role required).
  • Refactors the existing name-fallback logic in getPendingOnboardings into a reusable helper to avoid drift.

Context

Today the compliance team relies on an external Google Sheet (NutzerMonitoring) to see pending manual checks. The new endpoints expose the same data from the internal database, enabling the services frontend to render a Pending Reviews section on the compliance landing page (see companion PR in the services repo).

The implementation covers a superset of the Google Sheet scope — in addition to all explicitly tracked step types, it includes NameChange, AddressChange, PhoneChange, and any other KycStepName that happens to be in ManualReview/InternalReview.

Test plan

  • /support/pending-reviews returns one entry per (type, name) with manualReview and internalReview counts matching the DB.
  • /support/pending-reviews/items?type=KycStep&name=Ident&status=ManualReview returns the expected users.
  • /support/pending-reviews/items?type=BankData&status=ManualReview returns the expected bank data entries.
  • Unauthenticated requests return 401; non-compliance roles return 403.
  • Merged users are excluded.
  • Existing /support/pending-onboardings endpoint is unaffected.

Adds /support/pending-reviews and /support/pending-reviews/items endpoints
aggregating all kyc_step and bank_data entries in ManualReview or
InternalReview, grouped by type and name. Replaces the external
NutzerMonitoring Google Sheet for manual compliance tasks.
Comment thread src/subdomains/generic/kyc/services/kyc.service.ts Outdated
Comment thread src/subdomains/generic/user/models/bank-data/bank-data.service.ts Outdated
@bernd2022 bernd2022 requested a review from davidleomay April 27, 2026 07:25
@bernd2022 bernd2022 marked this pull request as ready for review April 27, 2026 07:35
@bernd2022 bernd2022 requested a review from TaprootFreak as a code owner April 27, 2026 07:35
@bernd2022 bernd2022 merged commit ecabd38 into develop Apr 27, 2026
7 checks passed
@bernd2022 bernd2022 deleted the feature/compliance-pending-reviews branch April 27, 2026 08:18
bernd2022 added a commit that referenced this pull request Apr 27, 2026
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
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