feat(labels): align chatwoot label payloads
This commit is contained in:
+10
-8
@@ -10,15 +10,17 @@ import (
|
||||
// Reference: Chatwoot Tag + Taggings merged + P2B M4 spec
|
||||
// Each tag belongs to an account and has a unique name within that account.
|
||||
type Tag struct {
|
||||
ID uint `gorm:"primaryKey;autoIncrement" json:"id"`
|
||||
AccountID uint `gorm:"not null;uniqueIndex:idx_tag_account_name" json:"account_id"`
|
||||
Name string `gorm:"size:255;not null;uniqueIndex:idx_tag_account_name" json:"name"`
|
||||
Color string `gorm:"size:50" json:"color,omitempty"`
|
||||
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at,omitempty"`
|
||||
ID uint `gorm:"primaryKey;autoIncrement" json:"id"`
|
||||
AccountID uint `gorm:"not null;uniqueIndex:idx_tag_account_name" json:"account_id"`
|
||||
Name string `gorm:"size:255;not null;uniqueIndex:idx_tag_account_name" json:"name"`
|
||||
Color string `gorm:"size:50;not null;default:#1f93ff" json:"color,omitempty"`
|
||||
Description string `gorm:"type:text" json:"description,omitempty"`
|
||||
ShowOnSidebar *bool `json:"show_on_sidebar"`
|
||||
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at,omitempty"`
|
||||
|
||||
Account Account `gorm:"foreignKey:AccountID" json:"account,omitempty"`
|
||||
}
|
||||
|
||||
func (Tag) TableName() string { return "tags" }
|
||||
func (Tag) TableName() string { return "tags" }
|
||||
|
||||
Reference in New Issue
Block a user