Skip to content

feat: Add notification on Kyc system and extend notification for deposit and withdrawal processes.#414

Merged
forge0x merged 6 commits into
lnflash:tmp/bridge-rebase-pr-readyfrom
heyolaniran:tmp/bridge-rebase-pr-ready
Jun 24, 2026
Merged

feat: Add notification on Kyc system and extend notification for deposit and withdrawal processes.#414
forge0x merged 6 commits into
lnflash:tmp/bridge-rebase-pr-readyfrom
heyolaniran:tmp/bridge-rebase-pr-ready

Conversation

@heyolaniran

@heyolaniran heyolaniran commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds localized push notifications across the Bridge deposit, withdrawal, and KYC flows. Each notification type uses outcome-specific copy (EN/ES) and structured FCM data payloads so the mobile app can route users to the right screen.

in the commit b0e3635 , the fix for the flash developer fees on withdrawal request is addressed too

Deposit notifications

  • Adds an outcome parameter to sendBridgeDepositNotification (received, processing, completed).
  • Locale keys are nested under notification.bridgeDeposit.{outcome}.
  • Existing callers keep working via default outcome: "completed".

Withdrawal notifications

  • Extends BridgeWithdrawalNotificationOutcome with submitted, usdt_sent, and processing.
  • Adds matching locale strings for the new lifecycle stages.
  • Existing completed, failed, and cancelled behavior is unchanged.

KYC notifications (new)

  • New send-kyc-notification module sends push alerts for KYC status changes.
  • Outcomes: approved, rejected, in_review, incomplete, offboarded.
  • Pre-initiation guard: no push when bridgeKycStatus was unset (avoids notifying before bridgeInitiateKyc).
  • Incomplete deep-link: fetches the latest Bridge KYC link via GET /customers/{id}/kyc_links/latest and includes kycLink / tosLink in the push data payload.
  • Dedicated incomplete copy: separate message from generic “in review”.
  • Rejection reasons are included in the body when Bridge provides them.

KYC webhook wiring

  • Bridge /kyc webhook handler calls notifyKycStatusChange on status transitions.
  • Skips notification when status is unchanged or KYC was not yet initiated.
  • Status is still persisted in all cases; only the push is suppressed when appropriate.

Commits

feat: support deposit notification outcomes — deposit module + locale strings (EN/ES)
feat: send withdrawal push notifications on submit and USDT send — withdrawal outcome type expansion
feat: add KYC push notification module — notification module, incomplete deep-link support, unit tests
feat: wire KYC webhook status changes to push notifications — webhook handler integration + tests

Mobile notes for @Nodirbek75

Mobile follow-up for incomplete KYC: on tap, open data.kycLink in a WebView; fall back to bridgeInitiateKyc if links are missing.

Test plan

  • Unit: test/flash/unit/app/bridge/send-kyc-notification.spec.ts
    Outcome mapping, pre-initiation guard, incomplete KYC link attachment, fetch-failure fallback

  • Unit: test/flash/unit/services/bridge/webhook-server/kyc.spec.ts

Approved / pending / incomplete / rejected webhooks

  • No push before initiation or on duplicate status

  • Manual: trigger Bridge KYC webhooks locally (yarn bridge-webhook) for incomplete, approved, rejected

  • Manual: confirm incomplete push data contains kycLink and tosLink

  • Manual: confirm no push when account has no bridgeKycStatus (pre-initiation)

  • Manual: confirm deposit notification still sends with default completed outcome

  • Mobile: handle bridge_kyc_incomplete tap → open KYC link

…ing, completed)

Add an outcome parameter to deposit push notifications so each lifecycle stage can use its own title and body.
Notify users when a withdrawal is submitted to Bridge and when USDT is sent, and centralize send-failure handling with push alerts.
send localized kyc status notifications, skip pushes before initiation, use a dedicated incomplete message, and attach latest KYC links for incomplete notifications.
Notify users on KYC status transitions from bridge webhook handler, with guards for unchanged status and pre-initiation states.
Notify users when a withdrawal is submitted to Bridge and when USDT is sent.
Centralize send-failure handling with failed push alerts and add unit tests
for the new notification outcomes.
bridge only applies developer_fee_percent when flexible_amount is enabled, fixed amount offramps (implemented in flash) must use developer_fee (USD value), so pass the stored flashFee from the pending withdrawal instead
@forge0x forge0x merged commit 9c36c6b into lnflash:tmp/bridge-rebase-pr-ready Jun 24, 2026
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