Skip to main content

Communication: hbf-notifications

1-hop view of how this service communicates with its siblings. For the full system view, see service-communication.md.

Calls Out To

ServiceProtocolPurposeKey calls / queues
hbf-coreHTTP via hbf-core-api SDK + gotOrg lookup, user authOrganizationsClient.find(), GET /users/me

Called By

ServiceProtocolHow
hbf-coreHTTP POSTPOST /organizations/:orgId/notifications/ -- create notification (JWT auth)
hbf-nlpHTTP POSTPOST /organizations/:orgId/notifications/ -- training notifications (JWT auth)
hbf-consoleSSEGET /organizations/:orgId/notifications/events?userId= -- real-time stream (HBF auth)
hbf-consoleHTTPGET/PATCH for notification management

Contracts

Inbound

  • POST /organizations/:orgId/notifications/ -- create notification (JWT auth). Body: CreateNotificationDto
  • GET /organizations/:orgId/notifications/ -- list paginated (HBF auth). Returns: {notifications, total, unreadNotificationCount}
  • GET /organizations/:orgId/notifications/unread-count -- unread count
  • PATCH /organizations/:orgId/notifications/read/:id -- mark read. Body: {userId}
  • PATCH /organizations/:orgId/notifications/readAll -- mark all read. Body: {userId}
  • DELETE /organizations/:orgId/notifications/:id -- delete
  • GET /organizations/:orgId/notifications/events -- SSE stream (HBF auth). Emits: {event: 'notification', data: Notification}

Outbound

  • hbf-core: SDK and HTTP calls for org lookup and auth validation

Env vars:

  • CORE_URL -> hbf-core
  • CORE_TOKEN -> hbf-core
  • JWT_SECRET -> JWT validation
  • TYPEORM_* -> MySQL

Flows Involving This Service

(Supporting service. No primary flow.)