Files
gochat/backend/internal/model/inbox_member.go
T
Rogeeandrogee 3d9817c9f5 H-337: fix Web Channel availability and realtime delivery (#60)
* H-337: fix Web Channel availability and realtime delivery

* fix(widget): preserve realtime sender and activity contracts

* fix(widget): keep realtime sender payloads consistent

* fix(widget): make public message persistence atomic

* fix(inbox): keep availability projection out of schema

---------

Co-authored-by: Rogee <rogee@ipao.vip>
2026-08-20 14:30:05 +08:00

18 lines
844 B
Go

package model
// InboxMember represents an agent assigned to an inbox.
// Reference: Chatwoot InboxMember model + P2B M2 spec
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" }