Files
gochat/internal/model/contact_label.go
T

19 lines
761 B
Go

package model
import "time"
// ContactLabel stores the account label/tag assignments for contacts.
// Reference: Chatwoot Contact includes Labelable and uses label_list.
type ContactLabel struct {
ContactID uint `gorm:"primaryKey;autoIncrement:false;index" json:"contact_id"`
TagID uint `gorm:"primaryKey;autoIncrement:false;index" json:"tag_id"`
AccountID uint `gorm:"not null;index" json:"account_id"`
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at"`
Contact Contact `gorm:"foreignKey:ContactID" json:"contact,omitempty"`
Tag Tag `gorm:"foreignKey:TagID" json:"tag,omitempty"`
}
func (ContactLabel) TableName() string { return "contact_labels" }