Skip to content

Conversation

@TaprootFreak
Copy link
Collaborator

@TaprootFreak TaprootFreak commented Jan 15, 2026

Summary

  • Add new AML rule RULE_15 (Force Manual Check) for wallet-level transaction monitoring
  • Introduces AmlErrorType.FALLBACK - only applies when transaction would otherwise pass
  • Includes migration to enable RULE_15 for FinanceFarm wallet (ID 42)

Behavior

Scenario Result
Transaction would pass + RULE_15 active Pending + ManualCheck
Other errors exist (USER_BLOCKED, KYC_LEVEL, etc.) Error takes priority, RULE_15 ignored
RULE_15 not active Normal flow (Pass if no errors)

Implementation Details

New enum values:

  • AmlRule.RULE_15 - Force Manual Check
  • AmlError.FORCE_MANUAL_CHECK - Error type for forced review
  • AmlErrorType.FALLBACK - Only applies if no other errors exist

Logic in getAmlResult():

  1. Separate FALLBACK errors from real errors
  2. If no real errors but FALLBACK exists → apply FALLBACK (Pending + ManualCheck)
  3. If real errors exist → process normally, ignore FALLBACK

Migration

Automatically enables RULE_15 for FinanceFarm wallet:

-- Wallet ID 42: '2' → '2;15'
-- RULE_2: KycLevel 30 requirement
-- RULE_15: Force manual check

Files Changed

  • src/subdomains/core/aml/enums/aml-rule.enum.ts
  • src/subdomains/core/aml/enums/aml-error.enum.ts
  • src/subdomains/core/aml/services/aml-helper.service.ts
  • migration/1768503536967-SetFinanceFarmAmlRules.js

Test Plan

  • Wallet with RULE_15 gets Pending + ManualCheck when no other errors
  • Real errors (CRUCIAL, SINGLE, MULTI) take priority over RULE_15
  • Combined rules (e.g., 2;15) work correctly
  • Migration is idempotent (safe to run multiple times)
  • BuyCrypto doesn't check RULE_15 twice

Add new AML rule that forces all transactions to manual review
(amlCheck=Pending, amlReason=ManualCheck) when enabled on a wallet.

Key behavior:
- Only triggers when transaction would otherwise pass
- Real errors (USER_BLOCKED, KYC_LEVEL, etc.) take priority
- FALLBACK error type ensures rule is ignored when other issues exist

Usage: Set wallet.amlRules = '15' or '2;15' for combined rules
TaprootFreak and others added 3 commits January 15, 2026 19:50
Adds RULE_15 (Force Manual Check) to wallet ID 42.
Migration is idempotent and preserves existing amlRules.
@github-actions
Copy link

⚠️ Unverified Commits (1)

The following commits are not signed/verified:

  • a40f7f2 [NOTASK] Refactoring (Yannick1712)
How to sign commits
# SSH signing (recommended)
git config --global gpg.format ssh
git config --global user.signingkey ~/.ssh/id_ed25519.pub
git config --global commit.gpgsign true

# Re-sign last commit
git commit --amend -S --no-edit
git push --force-with-lease

⚠️ Non-Conventional Commits (1)

The following commits don't follow conventional commit format:

  • a40f7f2 [NOTASK] Refactoring

Expected: type(scope): description
Types: feat, fix, refactor, test, ci, docs, chore, perf, style, build, revert

@TaprootFreak TaprootFreak merged commit 1774499 into develop Jan 15, 2026
7 checks passed
@TaprootFreak TaprootFreak deleted the feature/aml-rule-15-force-manual-check branch January 15, 2026 19:16
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.

3 participants