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
| Field | Type | Required | Indexed | Notes |
|---|
id | String | yes | PK | MongoDB document ID |
label | String | yes | | Broadcast name |
tenant | Tenant | yes | | @DBRef lazy |
groups | List<Group> | yes | | @DBRef lazy. Target groups |
method | BroadcastMethod | yes | | |
text | String | yes | | Broadcast message body |
type | BroadcastType | yes | | |
image | String | no | | Image URL |
status | BroadcastStatus | yes | yes | |
error | String | no | | Error message if status is ERROR |
choices | List<Choice> | no | | Interactive options |
sendAt | Date | yes | yes | Scheduled send time |
postbackData | BasicDBObject | no | | |
platform | MessagingPlatform | yes | | |
title | String | yes | | |
userEmail | String | no | | Email of user who created it |
userFullName | String | no | | Name of user who created it |
currentBatch | Int | no | | Batch number in progress |
totalBatches | Int | no | | Total number of batches |
createdAt | Date | yes | yes | @CreatedDate |
updatedAt | Date | yes | | @LastModifiedDate |
results | BroadcastResults | no | | @Transient, computed |
Nested Objects
BroadcastResults (transient, not persisted)
| Field | Type | Notes |
|---|
totalRecipients | Long | |
totalDelivered | Long | |
totalResponded | Long | |
Choice
| Field | Type | Notes |
|---|
text | String | Choice text |
value | String | Choice value |
Note: In TS, BroadcastChoice has text and isCorrect (for quiz type).
Enums
BroadcastStatus
| Value | Description |
|---|
INACTIVE | Not scheduled |
PENDING | Scheduled, waiting |
SENDING | Currently sending |
WAITING | Waiting for responses |
COMPLETE | Finished |
ERROR | Failed with error |
BroadcastType (from TypeScript)
| Value | Description |
|---|
MESSAGE | Simple message |
POLL | Poll with choices |
QUIZ | Quiz with correct answer |
ANALYTICS_REPORT | Analytics report |
BroadcastMethod (from TypeScript)
| Value | Description |
|---|
BATCHES | Send in batches |
ONE_SHOT | Send 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 |
|---|
| Broadcast | Broadcast | TS uses tenant as Record, groups as Array<Record>. TS adds elastic field |
| BroadcastStatus | BroadcastStatuses | Different naming |
| BroadcastType | BroadcastTypes | Different naming. Values from TS (not found in Kotlin scan) |
| BroadcastMethod | BroadcastMethods | Different naming. Values from TS |
| Choice | BroadcastChoice | TS uses isCorrect instead of value |
| BroadcastResults | (not in TS) | Gap: results not in TS types |
| (not in Kotlin) | ResponseBroadcast / ResponseBroadcastForm | TS-only. Per-subscriber broadcast delivery tracking |
| (not in Kotlin) | BroadcastForm | TS-only write model |