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

23 lines
944 B
Plaintext

package model
import (
"time"
)
// ContactInbox represents the join between Contact and Inbox with source info.
// Reference: Chatwoot ContactInbox model + P2B M4 spec
type ContactInbox struct {
ID uint `gorm:"primaryKey" json:"id"`
ContactID uint `gorm:"not null;index" json:"contact_id"`
InboxID uint `gorm:"not null;index" json:"inbox_id"`
SourceID string `gorm:"size:255;index" json:"source_id"`
HMACToken string `gorm:"size:255" json:"hmac_token"`
PubsubToken string `gorm:"size:255" json:"pubsub_token"`
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at"`
Contact Contact `gorm:"foreignKey:ContactID" json:"contact,omitempty"`
Inbox Inbox `gorm:"foreignKey:InboxID" json:"inbox,omitempty"`
}
func (ContactInbox) TableName() string { return "contact_inboxes" }