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.
| Object | Access | Key Fields Used |
|---|---|---|
| Organization | reads via HTTP to hbf-core | id, displayName, image, externalOrganizations, timezone |
| Tenant | reads via HTTP to hbf-core | id, handle, displayName, description, image, plugins, timezone |
| User | reads via HTTP to hbf-core | id, email, fullName, tenantRoles, organizationRoles, effectiveRoles |
| UserGroup | reads/writes via HTTP to hbf-core | id, name, description, organizationId, users, tenantRoles, organizationRoles |
| UserInvitation | writes via HTTP to hbf-core | organizationId, user data |
| ChatSession | reads/writes via HTTP to hbf-core | id, status, messages, tags, subscriberHandle, tenantId |
| Contact | reads via HTTP to hbf-core | id, subscriberHandle |
| Tag | reads/writes via HTTP to hbf-core | label, scope |
| AuditLog | writes via HTTP to hbf-core | organizationId, description, category |
| Plugin | reads via HTTP to hbf-core | integration (type, enabled), settings |
| Translation | reads via HTTP to hbf-core | source, target, text |
Local Entities
| Entity | Table | DB | Key Fields |
|---|---|---|---|
| BusinessHours | business_hours | MySQL | id, userGroupId, day (enum 0-6), opensAt (min), closesAt (min) |
| LivechatConversation | livechat_conversation | MySQL | id, startDate, endDate, status, platformSessionId, platformUserId, organizationId, tenantId, roomSid |
| LivechatRequest | livechat_request | MySQL | id, type, requestedDate, status, targetGroupId, targetUserId, acceptedBy, platformUserId, platformUserEmail |
| LivechatRequestMetadata | livechat_request_metadata | MySQL | id, teamsNotification (embedded), preLiveChatSurvey (JSON), externalNotificationId |
| LivechatParticipant | livechat_participant | MySQL | id, participantType, status, isOwner, platformUserId, fullName, email, callToken, callStatus, flags (JSON) |
| LivechatMessage | livechat_message | MySQL | id, type, text, originalText, sentDate, language, platformSessionId, options (embedded) |
| LivechatAttachment | livechat_attachment | MySQL | id, name, path, mimetype, platformUserId |
| LivechatNote | livechat_note | MySQL | id, text, from (FK participant), conversation (FK) |
| LivechatSettings | livechat_settings | MySQL | id, organizationId (unique), isTranslationEnabled, agentDefaultLanguage, livechatMode, idleReminderThreshold, botAssistantSettings (embedded) |
| LivechatEnvironment | livechat_environment | MySQL | env (PK, enum MONITOR_LOCK), value |
| MsTeamsInstallation | ms_teams_installation | MySQL | id, channelId, azureTenantId, teamId, teamName, aadGroupId, serviceUrl |
| PredefinedResponse | predefined_response | MySQL | id, name, text, platformUserId, organizationId, organizationWide, tenantIds (JSON), categories (JSON) |
| PredefinedAction | predefined_action | MySQL | id, 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
LivechatEntitywith 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.