package model import ( "time" "gorm.io/datatypes" ) // ShangwutongClassificationCache stores the last successful remote catalog per inbox. // It is deliberately separate from native GoChat tags and CRM categories. type ShangwutongClassificationCache struct { InboxID uint `gorm:"primaryKey" json:"inbox_id"` ConversationKinds datatypes.JSON `gorm:"type:jsonb;not null;default:'[]'" json:"conversation_kinds"` CustomerColorKinds datatypes.JSON `gorm:"type:jsonb;not null;default:'[]'" json:"customer_color_kinds"` SyncStatus string `gorm:"size:20;not null;default:never" json:"sync_status"` SyncedAt *time.Time `json:"synced_at,omitempty"` LastErrorCode *string `gorm:"size:100" json:"last_error_code,omitempty"` LastErrorMessage *string `gorm:"type:text" json:"last_error_message,omitempty"` LastSyncEventID string `gorm:"size:128" json:"-"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` } func (ShangwutongClassificationCache) TableName() string { return "shangwutong_classification_caches" }