feat: add bulk client notifications and email enhancements with review fixes (Stories 3.4 & 3.5)

Story 3-4: Bulk client notification scheduling — BulkNotificationController,
BulkActionBar component, checkbox selection on declarations index.

Story 3-5: Email notification enhancement — observer-driven email on
en_attente_client, cache invalidation on ferme, workspace branding on
all email templates, 11 feature tests.

Code review fixes:
- Move bulk-notify route above resource wildcard to prevent shadowing
- Add static $suppressEmail flag to prevent observer double-sending
  when DeclarationMessageController already sends the email
- Fix canBulkNotify logic (was granting workers access)
- Add WorkspaceUserRole check to BulkNotifyRequest::authorize()
- Replace firstOrCreate with explicit invitation lookup that syncs
  client email and handles used/expired invitations correctly
- Watch declarations.data instead of current_page to clear selection
  on filter/sort changes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-26 14:31:36 +01:00
parent 32e11db2b5
commit 1d4f3bcd0f
17 changed files with 1384 additions and 7 deletions

View File

@@ -35,6 +35,10 @@
generated: 2026-03-11
last_updated: "2026-03-26"
# Story 3-5 dev completed: 2026-03-26
# Story 3-5 contexted: 2026-03-26
# Story 3-4 dev started: 2026-03-26
# Story 3-4 contexted: 2026-03-26
project: "l'ami fiduciaire"
project_key: NOKEY
tracking_system: file-system
@@ -72,9 +76,9 @@ development_status:
epic-3: in-progress
3-1-notification-infrastructure-setup: done
3-2-one-click-nudge-system: done
3-3-notification-center-and-bell: review
3-4-bulk-client-notification-scheduling: backlog
3-5-email-notification-enhancement-for-key-events: backlog
3-3-notification-center-and-bell: done
3-4-bulk-client-notification-scheduling: done
3-5-email-notification-enhancement-for-key-events: review
epic-3-retrospective: optional
# Epic 4: Bulk Operations, Search & Advanced Filtering