Files
alla-allaos-fullstack/docs/implementation/task-p.7.1-implementation.md

7.5 KiB

Task P.7.1 Implementation Report

Scope

This round starts Task P.7.1 by extending the existing notification foundation into a reusable delivery layer for channel-based notifications, with email as the first implemented provider.

Review Summary

Reviewed before implementation:

Discovery Findings

  • The repo already had an in-app notification foundation from Task F4 using app_notification_events, app_notifications, app_notification_templates, and app_notification_deliveries.
  • Approval automation from Task F5 already publishes reminder/escalation events and proves scheduler-oriented notification orchestration exists, but only for in-app delivery.
  • Storage and immutable document delivery foundations already exist and are reusable through:
  • There was no usable SMTP provider implementation in the workspace yet; nodemailer had to be added.
  • There was no generic external-delivery history/queue log yet; the old app_notification_deliveries rows were still shaped around inbox notifications.

Delivered In This Round

Design Notes

  • The old in-app notification foundation remains the source of truth for header bell / inbox UX.
  • The new delivery foundation uses a separate app_notification_dispatches log so external-channel delivery history does not depend on internal inbox rows.
  • Attachment resolution is storage-backed only. It reads existing artifact/document-library files and does not regenerate PDFs during send.
  • If a channel-specific template is missing, the new service falls back to the event's active in-app template so the API remains usable during migration.

Known Gaps After This Round

  • No template management UI yet.
  • No automated CRM event publication into email dispatch yet; CRM modules still need to call the new service/API explicitly.
  • No seed update was added yet for dedicated email templates, so best experience currently comes from template override or the in-app fallback path.
  • No Teams / LINE / Slack / SMS / web push provider implementations yet.
  • No background worker process yet; queue behavior is modeled in persisted dispatch status plus retry semantics, but still executed synchronously in this round.