Skip to main content

Survey

Survey responses collected from a ChatSession. Stores question-answer pairs from interviews, live chats, or user feedback flows. Collection: surveys | DB: MongoDB Source: hbf-core/src/main/java/gr/helvia/hbf/core/domain/Survey.kt TypeScript: hbf-core-api/src/datamodel/survey.ts

Fields

FieldTypeRequiredIndexedNotes
idStringyesPKMongoDB document ID
tenantIdStringyes
organizationIdStringyes
sessionStringnoDeprecated. Kept for backward references
chatSessionChatSessionno@DBRef lazy
subscriberStringyesSubscriber ID
questionsList<SurveyQuestion>yes
createdAtDateyes@CreatedDate
updatedAtDateyes@LastModifiedDate
typeSurveyTypeno

Nested Objects

SurveyQuestion

FieldTypeNotes
questionIdString
questionStringQuestion text
answerStringUser's answer
sourceActivityNameStringOptional. Activity that generated this question

Enums

SurveyType

ValueDescription
INTERVIEWFrom interview flow
LIVECHATFrom live chat flow
USER_FEEDBACKFrom user feedback flow

Relationships

  • Belongs to: Tenant (via tenantId), Organization (via organizationId)
  • References: ChatSession (via @DBRef)
  • References: Subscriber (via subscriber string ID)

TypeScript Mapping

hbf-core (Kotlin)hbf-core-api (TypeScript)Notes
SurveySurveyTS omits organizationId. TS uses chatSession as optional ChatSessionDTO
SurveyQuestionQuestionDifferent naming
SurveyTypeSurveyType (const enum)Aligned
(not in Kotlin)SurveyFormTS-only write model (Partial<Survey>)