Data Model: hbf-core
Domain objects owned by this service (source of truth). Java/Spring Boot application backed by MongoDB.
Objects This Service Owns
hbf-core is the central data store. It owns all MongoDB collections and exposes them via REST API. Other services access these objects through the hbf-core HTTP API (often via the hbf-core-api client library).
| Object | Collection/Resource | Key Fields |
|---|---|---|
| Organization | organizations | id, displayName, image, timezone, dataRetentionPeriod, auditLogsRetentionPeriod |
| Tenant | tenants | id, handle, displayName, organizationId, settings, systemSettings, plugins, contentCompiled, tenantStats, dataRetentionPeriod |
| User | users | id, email, fullName, isModerator, tenantRoles, organizationRoles, effectiveRoles |
| UserGroup | user-groups | id, name, description, organizationId, users, tenantRoles, organizationRoles |
| ChatSession | chat-sessions | id, status, messages, subscriberHandle, tenantId, tags, duration, messageCount, lastInteraction |
| Subscriber | subscribers | handle, tenantId, contact info |
| BotDeployment | bot-deployments | id, tenantId, organizationId, settings |
| BotContent | bot-contents | id, contentCompiled, activities |
| Activity | activities (nested) | id, type, tenantId |
| Broadcast | broadcasts | id, tenantId, platform, status, groups |
| Response | responses | id, broadcastId, subscriberHandle, status |
| Survey | surveys | id, tenantId, organizationId, type, sections |
| NLPPipeline | nlp-pipelines | id, tenantId, status, failedReason |
| KnowledgeBase | knowledge-bases | id, tenantId, organizationId |
| KnowledgeBaseArticle | knowledge-base-articles (nested) | id, title, body, group, tags |
| ArticleMetadata | (embedded in KnowledgeBaseArticle) | Polymorphic via Jackson @JsonTypeInfo on type field. Lives in domain/ArticleMetadata.kt. Currently: SharePointArticleMetadata (managedMetadata: ManagedMetadataEntry[]?, permissions: SharePointPermissions?) |
| Integration | integrations | id, type, enabled, category |
| MissedQuestion | missed-questions | id, organizationId |
| MessagingApp | messaging-apps | id, tenantId |
| Group | groups | id, tenantId |
| HandoverLink | handover | id, tenantId, status |
| AuditLog | audit-logs | id, organizationId, description, category |
| TestSet | test-sets | id, tenantId, organizationId |
| Analytics | analytics | summary, liveChat, automatedAnswers, interviews, decisionTrees, userFeedback, missedQuestions, CSAT |
| Tag | tags | label, scope |
| Contact | contacts | id, subscriberHandle |
| Ticket | ticketing | id |
Undocumented Collections
The following 15 collections exist in code but are not yet fully documented above:
api-tokens, automated-tests, automated-test-results, bot-contents-compiled, bot-templates, csat-sections, fb-handovers, jobs, knowledge-base-articles, knowledge-base-groups, missed-questions-occurrences, nlp-pipeline-trees, tenant-backups, tenant-stats, user-invitations
Notes
- hbf-core is a Java (Maven/Spring Boot) application, not Node.js.
- All other services treat hbf-core as the single source of truth for these objects.
- The REST API supports pagination, filtering, and includes (e.g.,
includeMessages,includeSettings,includePlugins). - MongoDB with replica set support. Liquibase manages schema migrations.
ArticleMetadatawas extracted to its own file (domain/ArticleMetadata.kt) with Jackson polymorphic deserialization (@JsonTypeInfo/@JsonSubTypes). Custom MongoDB converters (ArticleMetadataReadingConverter,ArticleMetadataWritingConverter) handle BSON round-tripping, registered inMongoConfig.java.