Skip to content

Feat/add system notificaton services#28

Merged
Rashed99Azm merged 2 commits into
developfrom
feat/add-system-notificaton-services
May 23, 2026
Merged

Feat/add system notificaton services#28
Rashed99Azm merged 2 commits into
developfrom
feat/add-system-notificaton-services

Conversation

@Rashed99Azm
Copy link
Copy Markdown
Collaborator

Summary

  • Refactored notification system with a base EntityRepository<T, TId> pattern and replaced all notification repos to extend it
  • Integrated password reset into the notification pipeline with Email+SMS delivery, bypassing user opt-out for security alerts
  • Replaced MarkAllRead raw SQL with DDD-compliant domain-method calls; deleted unused IPasswordResetEmailSender/PasswordResetEmailSender and dead IsUserSuppressedAsync method
    Test plan
  • dotnet test backend/CCE.sln green
  • pnpm nx run-many -t lint,test green (N/A — monorepo frontend not in this PR scope)
  • If API surface changed: ./scripts/check-contracts-clean.sh green (N/A — no contract changes)
  • If UI changed: pnpm nx run-many -t e2e (N/A — backend-only PR)
  • Manual smoke notes: Seeder runs idempotently with --demo and --migrate --seed-reference; password reset flow dispatches via gateway on both Email and SMS channels
    Security checklist
  • No new secrets / credentials in code
  • AuthN / AuthZ impact considered — ForgotPasswordAsync still returns 200 OK regardless of result (no user enumeration)
  • Input validation on new endpoints — no new endpoints
  • Audit-log entry for new state-changing operations — notification logs are created for password reset dispatches via the existing NotificationLog mechanism

- Add `BypassSettings` flag to `NotificationDispatchRequest` so security
  notifications (password reset) always send regardless of user opt-out
- Replace `IPasswordResetEmailSender` with `INotificationGateway` in
  `AuthService.ForgotPasswordAsync` — sends through the notification system
- Add `NotificationChannel.Sms` to password reset dispatch alongside Email
- Add `PASSWORD_RESET` SMS template to `ReferenceDataSeeder` (short Arabic
  and English bodies suitable for SMS character limits)
- Fix seeder idempotency check in `SeedNotificationTemplatesAsync` to query
  by `(code, channel)` instead of deterministic ID, preventing duplicate-key
  errors on re-seed
- Delete unused `IPasswordResetEmailSender` interface and
  `PasswordResetEmailSender` implementation
@Rashed99Azm Rashed99Azm merged commit c93374c into develop May 23, 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