diff --git a/backend/models/models.go b/backend/models/models.go index 0524c64..29eed3a 100644 --- a/backend/models/models.go +++ b/backend/models/models.go @@ -212,10 +212,12 @@ type Conversation struct { MessageID string `gorm:"uniqueIndex;not null"` Type string `gorm:"not null"` Content string `gorm:"type:text"` - Direction string `gorm:"not null"` // inbound/outbound - Status string `gorm:"type:varchar(20)"` // sent, delivered, read, failed + Direction string `gorm:"not null"` // inbound / outbound + Status string `gorm:"type:varchar(20)"` // sent, delivered, read, failed + ParentID *uint `gorm:"index"` // lien vers le message parent (nullable) } + func NewTextMessage(to string, body string) WhatsappMessage { return WhatsappMessage{ MessagingProduct: "whatsapp",