Skip to main content

Data Model: hbf-lcg

Database

MySQL/MariaDB, database name: lcm (shared with hbf-lcm, different tables).

ER Diagram

Entities

LiveChatSession

Table: live_chat_session File: src/entities/session.entity.ts

Tracks active livechat sessions between a subscriber and an external provider. Generic over Plugin<T> to store provider-specific configuration in the plugin JSON column.

ColumnTypeNotes
idintPK, auto-increment
subscriberHandlestringIndexed. Identifies the end user.
externalServiceSessionIdstringIndexed. Session ID in the external system.
externalConversationIdstringNullable, indexed. Conversation ID (some providers).
organizationIdstringHBF organization ID.
tenantIdstringHBF tenant ID.
integrationTypestringProvider alias (helvia-livechat, cisco-livechat, etc.).
statusSubscriberStatusNONE, ACTIVE, or PENDING.
setCookiesstringNullable. Stored cookies for provider sessions.
createdAtdatetimeAuto-set on creation.
acceptedAtdatetimeNullable. Set when agent accepts the request.
lastActivitydatetimeAuto-set, updated on activity.
pluginjsonNullable. Provider-specific Plugin config.

CiscoEvent

Table: cisco_event File: src/entities/cisco-event.entity.ts

Deduplicates events received via Cisco polling. Unique constraint on (livechatSession, eventId) prevents processing the same event twice.

ColumnTypeNotes
idintPK, auto-increment
eventIdintEvent ID from Cisco
eventTypeCiscoEventTypeDefault: TypingEvent
statusstringNullable
livechatSessionLiveChatSessionManyToOne, CASCADE delete

Enums

SubscriberStatus

ValueMeaning
NONENo active session
ACTIVESession accepted, conversation in progress
PENDINGRequest created, waiting for agent acceptance

CiscoEventType

ValueMeaning
TypingEventDefault. Agent typing indicator.

Migrations

FileDateSummary
1718189673885-Init.ts2024-06Create live_chat_session and cisco_event tables
1720432889736-AddSessionConversationId.ts2024-07Add externalConversationId, lastActivity; make setCookies nullable
1761818418752-AddCiscoEventTypeAndStatus.ts2025-03Add eventType and status to cisco_event
1764241635781-AddPluginLiveChatSession.ts2025-03Add plugin JSON column to live_chat_session