Refactor notification push system with registry pattern

Replace NotificationPusher with a cleaner architecture:

- Add Notification::Pushable concern with push target registry
- Add Notification::Push base class with template methods
- Add Notification::Push::Web for web push (OSS)
- Add Notification::Push::Native for native push (SaaS)
- Add Notification::WebPushJob and Notification::NativePushJob

Key design:
- Registry pattern: Notification.register_push_target(:web)
- Template method: push calls should_push? then perform_push
- Subclasses override should_push? (with super) and perform_push
- Each target handles its own job enqueueing

Also:
- Add Notification#pushable? for checking push eligibility
- Add Notification#identity delegation to user
- Reorganize tests to match new class structure

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Tidy up saas engine a bit more
This commit is contained in:
Rosa Gutierrez
2026-01-21 18:50:53 +01:00
parent 555132bbef
commit 05819f84a2
15 changed files with 321 additions and 187 deletions
@@ -0,0 +1,3 @@
Rails.application.config.to_prepare do
Notification.register_push_target(:web)
end