Skip to main content

Communication: hbf-reports

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 (hbf-core-api)10+ analytics API methods (summary, live chat, automated answers, interviews, decision trees, user feedback, missed questions, CSAT), org info, tenant data, bot deploymentsAnalytics fetch for report generation
MySQLTypeORMScheduled report persistenceScheduledReport, ScheduledReportExport entities
SMTPnodemailerSends scheduled reports to recipientsEmail delivery with PDF attachments

Called By

ServiceProtocolHow
hbf-console (or any HTTP client)REST APIReport schedule management

Report Triggers

  • Weekly cron: 0 0 0 * * 1 (Monday 00:00 UTC) sends weekly reports
  • Monthly cron: 0 5 0 1 * * (1st of month 00:05 UTC) sends monthly reports
  • Manual trigger: GET /organization/:orgId/report/schedule/trigger/:id

Contracts

Inbound

MethodPathPurpose
GET/organization/:orgId/report/schedule/List schedules
POST/organization/:orgId/report/schedule/Create schedule
PUT/organization/:orgId/report/schedule/:idUpdate schedule
DELETE/organization/:orgId/report/schedule/:idDelete schedule
GET/organization/:orgId/report/schedule/trigger/:idManual trigger
GET/organization/:orgId/report/export/On-demand export (streams PDF)

Outbound

TargetAuthEnv Vars
hbf-coreBearer token (CORE_TOKEN)CORE_URL, CORE_TOKEN
MySQLCredentialsDB_HOST, DB_PORT, DB_USERNAME, DB_PASSWORD, DB_NAME
SMTPSMTP credentialsEMAIL_*

Additional env vars: CONSOLE_URL (used in email links)

Flows Involving This Service