Files
2026-09-14 10:47:21 +08:00

20 lines
882 B
Go

package model
// InboxMember represents an agent assigned to an inbox.
// Reference: Chatwoot InboxMember model + P2B M2 spec
const InboxMemberRoleAgent = "agent"
type InboxMember struct {
Base
InboxID uint `gorm:"column:inbox_id;not null;index" json:"inbox_id"`
UserID uint `gorm:"column:user_id;not null;index" json:"user_id"`
Role string `gorm:"column:role;size:50;default:agent" json:"role"` // agent, supervisor
AvailabilityStatus string `gorm:"column:availability_status;size:50;default:offline" json:"availability_status"` // online, offline, busy
AccountAvailability string `gorm:"-" json:"-"`
Inbox Inbox `gorm:"foreignKey:InboxID" json:"inbox,omitempty"`
User User `gorm:"foreignKey:UserID" json:"user,omitempty"`
}
func (InboxMember) TableName() string { return "inbox_members" }