Notifications — the module and its seams

Notifications — the module and its seams An architecture diagram generated by Archify. tenant (adapter in main) · Deps.Hosts: contracts.HostLookup · Deps · its own contracts/, satisfied in main · Deps tenant (adapter in main) Deps.Hosts: contracts.HostLookup Deps user (adapter in main) · Deps.Recipients: contracts.RecipientLookup · Deps · its own contracts/, satisfied in main · Deps user (adapter in main) Deps.Recipients: contracts.RecipientLookup Deps SMTP or Mailbox (main) · Deps.Mailer: contracts.Mailer · Deps · its own contracts/, satisfied in main · Deps SMTP or Mailbox (main) Deps.Mailer: contracts.Mailer Deps auth · Notify · Mailer · HostLookup · consumers · consumer auth Notify · Mailer · HostLookup consumer a client module · Notify: album completed · consumers · consumer a client module Notify: album completed consumer contracts/ · Notification · Notice · 3 events · Service · modules/notification contracts/ Notification · Notice · 3 events · Service module.go · Deps{Recipients, Hosts, Mailer, Secure} · modules/notification module.go Deps{Recipients, Hosts, Mailer, Secure} internal/ · Service: Notify · MarkRead · ListFor · SendMail · modules/notification internal/ Service: Notify · MarkRead · ListFor · SendMail RegisterRoutes · list · {id}/read · /api/v1/notification/notifications · SignedIn · kit/ seams RegisterRoutes · list · {id}/read /api/v1/notification/notifications · SignedIn admin screens · none · no rest.Spec · no Nav · kit/ seams admin screens none · no rest.Spec · no Nav events · notification.created · email_requested · read · kit/ seams events notification.created · email_requested · read jobs · none · events, not the clock · kit/ seams jobs none · events, not the clock migrations/000011 · notifications · FORCE RLS · kit/ seams migrations/000011 notifications · FORCE RLS Events · Service NewService RegisterRoutes crud over Tx[Tenant] events.Publish none no Resource Deps.Recipients Deps.Hosts Deps.Mailer Notifier · Mailer · Hosts Service.Notify modules/notification kit/ seams Deps · its own contracts/, satisfied in main consumers Legend Frontend Backend Database Message bus

Promises

  • • No permission: both routes are SignedIn and scoped to the caller; anybody else’s notice is not found
  • • created, and email_requested when mail is asked and there is an address, from Notify; read from MarkRead, once

Needs

  • • Recipients, Hosts: its own interfaces, adapters in main over user and tenant; Mailer: SMTP or Mailbox
  • • No rest.Spec: only Notify writes recipientId, only MarkRead readAt; a link is a path, never a URL

Proof

  • • notificationtest: the fake and the real service pass one suite; the outbox carries no address, body or link
  • • A hung relay times out, a failed send fails the subscription; app_test drives both routes; no browser journey