feat(backend): Implement KYC/AML integration hook (closes #496) - #508
Closed
graceshaba93 wants to merge 2 commits into
Closed
feat(backend): Implement KYC/AML integration hook (closes #496)#508graceshaba93 wants to merge 2 commits into
graceshaba93 wants to merge 2 commits into
Conversation
|
@graceshaba93 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
@graceshaba93 kindly resolve the error |
Mona-i
added a commit
to Mona-i/Vaultix
that referenced
this pull request
Aug 30, 2026
Follow-up to 661a439. The first fix commit addressed pre-existing lint errors in test files; this commit fixes lint errors inside the KYC module files introduced by PR StayLitCodes#508 itself. Changes: - kyc-provider.interface.ts: change processWebhook(payload: any) to processWebhook(payload: unknown) to satisfy no-explicit-any - mock-kyc.provider.ts: cast payload via typed assertion instead of any; add file-level no-unsafe-assignment/no-unsafe-argument disables (necessary for mock provider that processes dynamic webhook data) - mock-aml.provider.ts: remove redundant async from screenAddress (had no await expression); return Promise.resolve() explicitly to satisfy the interface - kyc.guard.ts: remove unused KycStatus import; fix body.amount check to avoid no-base-to-string by branching on typeof instead of String() coercion - kyc.service.ts: type where clause as { kycStatus?: KycStatus } instead of any; remove redundant 'as KycStatus' cast; add targeted eslint-disable-next-line for findAndCount return tuple Builds on PR StayLitCodes#508 (graceshaba93/implement/kyc) Closes StayLitCodes#496
Mona-i
added a commit
to Mona-i/Vaultix
that referenced
this pull request
Aug 30, 2026
…vider - Remove async from initiateVerification, getVerificationStatus, and processWebhook — none use await; return Promise.resolve/reject instead - Replace _payload/_signature (underscore prefix not honoured by this ESLint config) with explicit eslint-disable-next-line on validateWebhook so the unused-vars rule is suppressed cleanly Builds on PR StayLitCodes#508 (graceshaba93/implement/kyc) Closes StayLitCodes#496
KuchiMercy
pushed a commit
that referenced
this pull request
Aug 30, 2026
The original KYC/AML PR (#508) failed CI due to pre-existing @typescript-eslint lint errors in 9 test files that were already present on upstream/main before the PR was opened. Fixes applied to unblock the 'Build and Test' job: - Add /* eslint-disable @typescript-eslint/unbound-method */ to 6 spec files where Jest's expect(mock.method).toHaveBeenCalled() pattern is flagged (expected pattern in NestJS test suites) - Add /* eslint-disable @typescript-eslint/no-unsafe-assignment */ to 3 spec files with untyped module.get() assignments - Remove unused variable declarations (stellarEventRepo, webhookSender, configService assignment) from 3 spec files - Remove unused 'Inject' import from kyc.service.ts All fixes are minimal and preserve the original test/implementation intent. No production logic was changed. Builds on PR #508 (graceshaba93/implement/kyc) Closes #496
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.
Closes #496
Description
This PR implements a comprehensive KYC (Know Your Customer) and AML (Anti-Money Laundering) integration system for the Vaultix backend. The system uses a pluggable provider pattern to support multiple identity verification providers and sanctions screening services, meeting compliance requirements for a production financial platform.
Changes Made
New Files (13 files)
KYC Module (
apps/backend/src/modules/kyc/)kyc.module.ts- Module definition registering all KYC providers, controllers, services, and exportsentities/kyc-verification.entity.ts- Entity for tracking individual KYC verification sessions with provider metadatainterfaces/kyc-provider.interface.ts- PluggableIKycProviderinterface for KYC provider implementationsinterfaces/aml-provider.interface.ts- PluggableIAmlProviderinterface for AML screening implementationsservices/kyc.service.ts- Core KYC service with provider pattern, webhook processing, and admin managementservices/aml.service.ts- AML screening service with address checking and transaction party screeningcontrollers/kyc.controller.ts- User-facing endpoints:GET /kyc/status,POST /kyc/initiatecontrollers/kyc-webhook.controller.ts- Webhook endpoint:POST /kyc/webhook/:providerfor provider callbackscontrollers/kyc.controller.spec.ts- Unit tests for KYC controllerservices/kyc.service.spec.ts- Unit tests for KYC serviceservices/aml.service.spec.ts- Unit tests for AML serviceproviders/mock-kyc.provider.ts- Mock KYC provider for dev/testingproviders/mock-aml.provider.ts- Mock AML provider for dev/testingdto/kyc.dto.ts- DTOs with class-validator decorators for all KYC endpointsguards/kyc.guard.ts- Guard that gates high-value escrows behind KYC verificationAdmin KYC Management
apps/backend/src/modules/admin/controllers/admin-kyc.controller.ts- Admin endpoints:GET /admin/kyc/users,PATCH /admin/kyc/users/:id/statuswith audit loggingMigration & Documentation
apps/backend/src/migrations/1780700000000-AddKycAndAml.ts- Migration addingkycStatus,kycRejectionReason,kycVerifiedAtto users table and creatingkyc_verificationstableapps/backend/docs/KYC_FLOW.md- Comprehensive documentation covering architecture, API endpoints, provider configuration, AML flow, and testing proceduresModified Files
apps/backend/src/modules/user/entities/user.entity.ts- AddedkycStatus,kycRejectionReason,kycVerifiedAtfields and exportedKycStatusenumapps/backend/src/app.module.ts- RegisteredKycModuleandKycVerificationentityapps/backend/src/data-source.ts- RegisteredKycVerificationentity for CLI migrationsapps/backend/src/modules/auth/controllers/auth.controller.ts- AddedkycStatustoGET /auth/meresponseapps/backend/src/modules/escrow/escrow.module.ts- AddedKycModuleimport forKycGuardDIapps/backend/src/modules/escrow/controllers/escrow.controller.ts- AddedKycGuardto escrow creation endpoint for high-value gatingapps/backend/src/modules/admin/admin.module.ts- AddedKycModuleimport andAdminKycControllerapps/backend/.env.example- Added KYC and AML configuration variablesapps/backend/package.json- AddeduuiddependencyArchitecture
Pluggable Provider Pattern
Both KYC and AML use a strategy pattern allowing different providers to be swapped via configuration:
API Endpoints
GET/v1/kyc/statusPOST/v1/kyc/initiatePOST/v1/kyc/webhook/:providerGET/v1/admin/kyc/usersPATCH/v1/admin/kyc/users/:id/statusKYC Status Flow
High-Value Escrow Gating
Escrows above
KYC_REQUIRED_MIN_ESCROW_AMOUNT(default: 1000 XLM) require KYC verification via theKycGuard, which returns 403 for unverified users.Testing
Configuration
Screenshots / gifs
N/A — backend-only change
How Has This Been Tested?
Checklist