Skip to content

Fix/tech debt indexes aml idempotency - #278

Open
james2177 wants to merge 4 commits into
dupdab:mainfrom
james2177:fix/tech-debt-indexes-aml-idempotency
Open

Fix/tech debt indexes aml idempotency#278
james2177 wants to merge 4 commits into
dupdab:mainfrom
james2177:fix/tech-debt-indexes-aml-idempotency

Conversation

@james2177

Copy link
Copy Markdown

Closes #149
Closes #150
Closes #151
Closes #156

Add @Index decorators to Settlement.merchantId/status, Webhook.merchantId/isActive,
and BlockchainWallet.lastSyncedAt to match the indexing strategy already used in
group.entity.ts and notification-preference.entity.ts. Add a migration to backfill
these indexes on existing tables.
AmlService.checkAndFlag() was never called from anywhere outside the aml
module, so high-value/high-velocity AML flags were never created in
production. Call it from PaymentsService.confirmPayment() once a payment
transitions to CONFIRMED, guarded so an AML failure never blocks the
payment confirmation itself. Add unit tests asserting the check runs and
that a check failure is non-blocking.
…MIN_EMAIL

aml.service.ts read ADMIN_EMAIL, which appears nowhere in .env.example or
README.md, while AdminAlertService and the docs use ADMIN_ALERT_EMAIL.
In any environment configured per .env.example, AML alert emails silently
never sent. Align on ADMIN_ALERT_EMAIL and log a warning when it's unset.
…dempotency interceptor

CacheService.set() reads options.ttlSeconds, but the idempotency interceptor
passed options.ttl, which was silently ignored in favor of CacheService's
hardcoded 86400s default. Fix the option key and add a unit test asserting
the TTL actually reaches the cache store.
@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@james2177 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! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant