Skip to content

feat: implement wallet management, notification preferences, referral…#577

Merged
Devsol-01 merged 1 commit intoDevsol-01:mainfrom
Haroldwonder:feature/issues-524-525-528-529-user-wallet-notifications-referrals-export
Mar 30, 2026
Merged

feat: implement wallet management, notification preferences, referral…#577
Devsol-01 merged 1 commit intoDevsol-01:mainfrom
Haroldwonder:feature/issues-524-525-528-529-user-wallet-notifications-referrals-export

Conversation

@Haroldwonder
Copy link
Copy Markdown
Contributor

#524 — User Wallet Management API

Adds full multi-wallet support for Stellar addresses.

New files: user-wallet.entity.ts, wallet.service.ts, wallet.controller.ts,
link-wallet.dto.ts

Endpoints:

  • POST /users/wallets/link — links a Stellar wallet after verifying the user's Ed25519
    signature over a provided message
  • DELETE /users/wallets/:address/unlink — removes a wallet; blocks unlinking the primary
    while others exist
  • GET /users/wallets — lists all linked wallets, primary first
  • PATCH /users/wallets/:address/set-primary — promotes a wallet to primary

Duplicate wallet linking across users is prevented at both the service and DB level (unique
constraint). Events emitted: wallet.linked, wallet.unlinked, wallet.primaryChanged.

closes #524

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

#525 — User Notification Preferences API

Extends the existing NotificationPreference entity with granular controls and adds a
dedicated route prefix.

Changes: notification-preference.entity.ts, update-notification-preference.dto.ts, new
user-notifications.controller.ts

New fields:

  • Channel prefs: pushNotifications, smsNotifications (alongside existing email/in-app)
  • Type prefs: depositNotifications, withdrawalNotifications, goalNotifications,
    governanceNotifications, marketingNotifications
  • Quiet hours: quietHoursEnabled, quietHoursStart / quietHoursEnd (HH:MM validated),
    timezone
  • Digest frequency: instant | daily | weekly enum

Endpoints:

  • GET /users/notifications/preferences
  • PATCH /users/notifications/preferences

All existing preference columns are preserved for backward compatibility.

closes #525
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

#528 — User Referral Dashboard API

Adds a user-facing referral dashboard with stats, custom code generation, history, and
leaderboard.

New files: user-referrals.controller.ts
Modified: referrals.service.ts, referral.dto.ts

Endpoints:

  • GET /users/referrals/stats — returns referralCode, totalReferrals, successfulReferrals,
    pendingRewards, claimedRewards, rank
  • POST /users/referrals/code/generate — creates a custom code (4–12 uppercase alphanumeric)
    or auto-generates one
  • GET /users/referrals/history — referred users with conversion funnel data (signup →
    deposit → reward)
  • GET /users/referrals/leaderboard?limit=10 — ranked list of top referrers by successful
    referrals

closes #528

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

#529 — User Export Data API (GDPR Compliance)

Implements async data portability export with secure time-limited download links.

New module: data-export/ (entity, service, controller, DTO)

Endpoints:

  • POST /users/data/export — queues an async export job; returns requestId immediately (202
    Accepted)
  • GET /users/data/export/:requestId/status — polls export status (
    pending | processing | ready | expired | failed)
  • GET /users/data/export/download/:token — downloads the ZIP (token acts as auth, no JWT
    required)

Export ZIP contains: profile.json, transactions.json, goals.json, notifications.json

Download links expire after 7 days. The user receives an email with the download URL when
the export is ready. All requests are persisted in data_export_requests for compliance
audit.

closes #529

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Migration

1796000000000-CreateUserWalletsAndDataExport.ts creates:

  • user_wallets table
  • New columns on notification_preferences
  • data_export_requests table

Dependencies added

  • archiver ^7.0.1 — ZIP generation for data exports
  • @types/archiver ^6.0.3 (dev)

… dashboard, and GDPR data export APIs

Closes Devsol-01#524 - User Wallet Management API
- Add UserWallet entity with multi-wallet support per user
- POST /users/wallets/link with Stellar signature verification
- DELETE /users/wallets/:address/unlink
- GET /users/wallets to list all linked wallets
- PATCH /users/wallets/:address/set-primary
- Duplicate wallet prevention across users
- EventEmitter events for wallet.linked, wallet.unlinked, wallet.primaryChanged

Closes Devsol-01#525 - User Notification Preferences API
- Enhance NotificationPreference entity with granular controls
- Channel prefs: email, in-app, push, SMS
- Type prefs: deposits, withdrawals, goals, governance, marketing
- Quiet hours: enabled flag, start/end time (HH:MM), timezone
- Digest frequency: instant | daily | weekly
- New controller at GET/PATCH /users/notifications/preferences
- Backward-compatible with existing preference columns

Closes Devsol-01#528 - User Referral Dashboard API
- GET /users/referrals/stats with dashboard metrics (referralCode, totalReferrals, successfulReferrals, pendingRewards, claimedRewards, rank)
- POST /users/referrals/code/generate for custom referral codes
- GET /users/referrals/history with conversion funnel data
- GET /users/referrals/leaderboard for top referrers

Closes Devsol-01#529 - User Export Data API (GDPR Compliance)
- POST /users/data/export triggers async ZIP generation
- Includes profile, transactions, savings goals, notifications as JSON files
- GET /users/data/export/:requestId/status to poll progress
- GET /users/data/export/download/:token for secure download
- Links expire after 7 days; email notification on completion
- All export requests logged for compliance
- Migration 1796000000000 for user_wallets, notification_preferences columns, data_export_requests
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nestera Error Error Mar 30, 2026 10:21am

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 30, 2026

@Haroldwonder 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

@Devsol-01 Devsol-01 merged commit 76dd14f into Devsol-01:main Mar 30, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants