Skip to main content

Data Model: hbf-lcm

Domain objects used by this service. Full schemas: docs/domain-model.md

Objects This Service Uses

hbf-lcm does not import from @helvia/hbf-core-api. It defines its own reduced DTOs and accesses hbf-core via direct HTTP calls through CoreClientService.

ObjectAccessKey Fields Used
Organizationreads via HTTP to hbf-coreid, displayName, image, externalOrganizations, timezone
Tenantreads via HTTP to hbf-coreid, handle, displayName, description, image, plugins, timezone
Userreads via HTTP to hbf-coreid, email, fullName, tenantRoles, organizationRoles, effectiveRoles
UserGroupreads/writes via HTTP to hbf-coreid, name, description, organizationId, users, tenantRoles, organizationRoles
UserInvitationwrites via HTTP to hbf-coreorganizationId, user data
ChatSessionreads/writes via HTTP to hbf-coreid, status, messages, tags, subscriberHandle, tenantId
Contactreads via HTTP to hbf-coreid, subscriberHandle
Tagreads/writes via HTTP to hbf-corelabel, scope
AuditLogwrites via HTTP to hbf-coreorganizationId, description, category
Pluginreads via HTTP to hbf-coreintegration (type, enabled), settings
Translationreads via HTTP to hbf-coresource, target, text

Local Entities

EntityTableDBKey Fields
BusinessHoursbusiness_hoursMySQLid, userGroupId, day (enum 0-6), opensAt (min), closesAt (min)
LivechatConversationlivechat_conversationMySQLid, startDate, endDate, status, platformSessionId, platformUserId, organizationId, tenantId, roomSid
LivechatRequestlivechat_requestMySQLid, type, requestedDate, status, targetGroupId, targetUserId, acceptedBy, platformUserId, platformUserEmail
LivechatRequestMetadatalivechat_request_metadataMySQLid, teamsNotification (embedded), preLiveChatSurvey (JSON), externalNotificationId
LivechatParticipantlivechat_participantMySQLid, participantType, status, isOwner, platformUserId, fullName, email, callToken, callStatus, flags (JSON)
LivechatMessagelivechat_messageMySQLid, type, text, originalText, sentDate, language, platformSessionId, options (embedded)
LivechatAttachmentlivechat_attachmentMySQLid, name, path, mimetype, platformUserId
LivechatNotelivechat_noteMySQLid, text, from (FK participant), conversation (FK)
LivechatSettingslivechat_settingsMySQLid, organizationId (unique), isTranslationEnabled, agentDefaultLanguage, livechatMode, idleReminderThreshold, botAssistantSettings (embedded)
LivechatEnvironmentlivechat_environmentMySQLenv (PK, enum MONITOR_LOCK), value
MsTeamsInstallationms_teams_installationMySQLid, channelId, azureTenantId, teamId, teamName, aadGroupId, serviceUrl
PredefinedResponsepredefined_responseMySQLid, name, text, platformUserId, organizationId, organizationWide, tenantIds (JSON), categories (JSON)
PredefinedActionpredefined_actionMySQLid, name, url, runOnMissedRequest, runOnEndConversation, headers (JSON), agentInput (JSON)

Notes

  • Largest local schema of any service (13 TypeORM entities).
  • LivechatConversation and LivechatRequest share a base class LivechatEntity with common platform fields.
  • PredefinedResponse and PredefinedAction share a base class PredefinedEntity.
  • Uses Redis for Socket.IO adapter (multi-instance WebSocket support) and optional HTTP response caching via Keyv/Redis.
  • Communicates with hbf-core via direct HTTP (not the hbf-core-api npm client). Defines its own DTO classes that mirror core schemas.
  • Handles real-time events via WebSocket (Socket.IO) gateway.