Files
gochat/internal/model/whatsapp_call.go
T
2026-06-04 15:44:48 +08:00

22 lines
994 B
Go

package model
import (
"time"
)
// WhatsAppCall represents a WhatsApp voice call tracking record.
type WhatsAppCall struct {
ID uint `gorm:"primaryKey" json:"id"`
InboxID uint `gorm:"not null;index" json:"inbox_id"`
ConversationID uint `gorm:"not null;index" json:"conversation_id"`
CallID string `gorm:"size:255;not null;uniqueIndex" json:"call_id"`
CallStatus string `gorm:"size:50;not null;index" json:"call_status"` // ringing/active/ended/failed
Duration int `json:"duration"` // call duration in seconds
CallerNumber string `gorm:"size:50" json:"caller_number"`
CreatedAt time.Time `gorm:"autoCreateTime;index" json:"created_at"`
Inbox Inbox `gorm:"foreignKey:InboxID" json:"inbox,omitempty"`
Conversation Conversation `gorm:"foreignKey:ConversationID" json:"conversation,omitempty"`
}
func (WhatsAppCall) TableName() string { return "whatsapp_calls" }