Skip to content

feat(backend): Automated email notification, session cleanup, Sentry … - #1401

Merged
joelpeace48-cell merged 1 commit into
FinesseStudioLab:mainfrom
STX-Boot:feat/backend-email-notification-session-cleanup-sentry-tenant-isolation
Sep 28, 2026
Merged

joelpeace48-cell merged 1 commit into
FinesseStudioLab:mainfrom
STX-Boot:feat/backend-email-notification-session-cleanup-sentry-tenant-isolation

Conversation

@STX-Boot

Copy link
Copy Markdown

…integration, multi-tenant isolation

Implement minimal versions of four backend features:

  1. feat(Closes feat(backend): Automated email notification service for campaign reward availability #1246): Automated email notification service for campaign reward availability

    • New repository: campaignRewardNotificationRepository to track sent notifications
    • New job: campaignRewardNotificationJob runs twice daily (12h interval)
    • Prevents duplicate notifications via unique constraint on campaign_id+user_address+type
    • Integrates with existing emailService for delivery
  2. feat(Closes feat(backend): Automated periodic cleanup worker deleting expired temporary session tokens #1262): Automated periodic cleanup worker for expired session tokens

    • New table: session_tokens with user_address, token, expires_at fields
    • New repository: sessionTokenRepository with deleteExpired() method
    • New job: sessionTokenCleanupJob runs hourly (1h interval)
    • Tracks all temporary session tokens with TTL expiration
  3. feat(Closes feat(backend): Sentry error monitoring integration with sourcemap upload #1263): Sentry error monitoring integration with sourcemap support

    • New service: sentryIntegration.js with @sentry/node integration
    • Configurable via SENTRY_DSN environment variable
    • Includes automatic sourcemap support via source-map-support
    • Graceful fallback when Sentry not configured
    • withErrorBoundary helper for easy error tracking
  4. feat(Closes feat(backend): Multi-tenant database isolation model for enterprise campaign operators #1264): Multi-tenant database isolation for enterprise operators

    • Added tenant_id column to campaigns table (nullable for backward compatibility)
    • New service: tenantIsolationService for tenant-aware campaign access
    • Indexed queries: campaigns(tenant_id) and campaigns(tenant_id, active)
    • All new tables support nullable tenant_id for flexible deployment

Database migrations:

  • 046_session_tokens.js: session token storage and cleanup
  • 047_campaign_tenant_isolation.js: tenant_id column with indexes
  • 048_campaign_reward_notifications.js: notification tracking

…integration, multi-tenant isolation

Implement minimal versions of four backend features:

1. feat(FinesseStudioLab#1246): Automated email notification service for campaign reward availability
   - New repository: campaignRewardNotificationRepository to track sent notifications
   - New job: campaignRewardNotificationJob runs twice daily (12h interval)
   - Prevents duplicate notifications via unique constraint on campaign_id+user_address+type
   - Integrates with existing emailService for delivery

2. feat(FinesseStudioLab#1262): Automated periodic cleanup worker for expired session tokens
   - New table: session_tokens with user_address, token, expires_at fields
   - New repository: sessionTokenRepository with deleteExpired() method
   - New job: sessionTokenCleanupJob runs hourly (1h interval)
   - Tracks all temporary session tokens with TTL expiration

3. feat(FinesseStudioLab#1263): Sentry error monitoring integration with sourcemap support
   - New service: sentryIntegration.js with @sentry/node integration
   - Configurable via SENTRY_DSN environment variable
   - Includes automatic sourcemap support via source-map-support
   - Graceful fallback when Sentry not configured
   - withErrorBoundary helper for easy error tracking

4. feat(FinesseStudioLab#1264): Multi-tenant database isolation for enterprise operators
   - Added tenant_id column to campaigns table (nullable for backward compatibility)
   - New service: tenantIsolationService for tenant-aware campaign access
   - Indexed queries: campaigns(tenant_id) and campaigns(tenant_id, active)
   - All new tables support nullable tenant_id for flexible deployment

Database migrations:
- 046_session_tokens.js: session token storage and cleanup
- 047_campaign_tenant_isolation.js: tenant_id column with indexes
- 048_campaign_reward_notifications.js: notification tracking
@drips-wave

drips-wave Bot commented Sep 28, 2026

Copy link
Copy Markdown

@STX-Boot 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

@joelpeace48-cell
joelpeace48-cell merged commit a104505 into FinesseStudioLab:main Sep 28, 2026
8 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment