Database / Notifications

endorsement_comment_entity

Comment thread on an endorsement. Also stores server notifications (commentType = NOTIFICATIONS).

Table factsheetagri_db
Written by
  • FetchCommentsNotificationWorker (Repo.saveComments)
  • Post comment (createEndorsementComment)
Read by
  • Comment thread (getCommentListForId, by timestamp ASC)
  • Notification list (getNotifications)
Filled from
GET gateway/asset-service/api/v1/endorsementComment
Sync
No BaseEntity flags. New comments are queued in sync_ledger as ENDORSEMENT_COMMENT.
Source
data/src/main/java/org/mindtree/app/agricultor/data/sync/entity/EndorsementCommentEntity.kt

Columns

ColumnTypeNullKeyMeaning
idINTEGERYesServer id. Null or 0 until the row is synced.
entityTypeTEXTYesType of the endorsed entity: ENTITY.TYPE.VO | ENTITY.TYPE.SHG | ENTITY.TYPE.FARMER.
entityIdTEXTYesFK → endorsement_entity.entityIdEntity id. Link by convention only, no FK constraint.
entityCodeTEXTYesNo description in code.
postedByTEXTYesAuthor.
timestampINTEGERYesWhen the comment was posted (epoch millis).
descriptionTEXTYesComment text.
uuidTEXTNoPKPrimary key.
commentTypeTEXTYesNOTIFICATIONS for server notifications, otherwise an endorsement comment.

Notes

  • Two notification stores exist: this table and legacy notifications (FCM).
  • Missing index on entityId.