Skip to main content

Broadcast

A message broadcast to groups of subscribers on a specific platform. Collection: broadcasts | DB: MongoDB Source: hbf-core/src/main/java/gr/helvia/hbf/core/domain/Broadcast.kt TypeScript: hbf-core-api/src/datamodel/broadcast.ts

Fields

FieldTypeRequiredIndexedNotes
idStringyesPKMongoDB document ID
labelStringyesBroadcast name
tenantTenantyes@DBRef lazy
groupsList<Group>yes@DBRef lazy. Target groups
methodBroadcastMethodyes
textStringyesBroadcast message body
typeBroadcastTypeyes
imageStringnoImage URL
statusBroadcastStatusyesyes
errorStringnoError message if status is ERROR
choicesList<Choice>noInteractive options
sendAtDateyesyesScheduled send time
postbackDataBasicDBObjectno
platformMessagingPlatformyes
titleStringyes
userEmailStringnoEmail of user who created it
userFullNameStringnoName of user who created it
currentBatchIntnoBatch number in progress
totalBatchesIntnoTotal number of batches
createdAtDateyesyes@CreatedDate
updatedAtDateyes@LastModifiedDate
resultsBroadcastResultsno@Transient, computed

Nested Objects

BroadcastResults (transient, not persisted)

FieldTypeNotes
totalRecipientsLong
totalDeliveredLong
totalRespondedLong

Choice

FieldTypeNotes
textStringChoice text
valueStringChoice value

Note: In TS, BroadcastChoice has text and isCorrect (for quiz type).

Enums

BroadcastStatus

ValueDescription
INACTIVENot scheduled
PENDINGScheduled, waiting
SENDINGCurrently sending
WAITINGWaiting for responses
COMPLETEFinished
ERRORFailed with error

BroadcastType (from TypeScript)

ValueDescription
MESSAGESimple message
POLLPoll with choices
QUIZQuiz with correct answer
ANALYTICS_REPORTAnalytics report

BroadcastMethod (from TypeScript)

ValueDescription
BATCHESSend in batches
ONE_SHOTSend all at once

Relationships

  • Belongs to: Tenant (via @DBRef)
  • Targets: Group (via @DBRef, many-to-many)
  • Groups contain: Subscriber (by ID reference)

TypeScript Mapping

hbf-core (Kotlin)hbf-core-api (TypeScript)Notes
BroadcastBroadcastTS uses tenant as Record, groups as Array<Record>. TS adds elastic field
BroadcastStatusBroadcastStatusesDifferent naming
BroadcastTypeBroadcastTypesDifferent naming. Values from TS (not found in Kotlin scan)
BroadcastMethodBroadcastMethodsDifferent naming. Values from TS
ChoiceBroadcastChoiceTS uses isCorrect instead of value
BroadcastResults(not in TS)Gap: results not in TS types
(not in Kotlin)ResponseBroadcast / ResponseBroadcastFormTS-only. Per-subscriber broadcast delivery tracking
(not in Kotlin)BroadcastFormTS-only write model