Files
gochat/internal/csat/model.go
T
2026-06-04 15:44:48 +08:00

26 lines
1.2 KiB
Go

package csat
import (
"time"
"github.com/gochat/gochat/internal/model"
)
// CsatSurveyResponse stores a customer satisfaction survey response.
// Reference: Chatwoot CSAT survey response model — captures rating (1-5), feedback_message,
// review_notes, and links to conversation/message/agent.
type CsatSurveyResponse struct {
model.Base
AccountID uint `gorm:"index;not null" json:"account_id"`
ConversationID uint `gorm:"index;not null" json:"conversation_id"`
ContactID uint `gorm:"index;not null" json:"contact_id"`
MessageID uint `gorm:"index;not null" json:"message_id"`
AssignedAgentID *uint `gorm:"index" json:"assigned_agent_id,omitempty"`
Rating int `gorm:"not null;check:rating >= 1 AND rating <= 5" json:"rating"` // 1-5
FeedbackMessage string `gorm:"type:text" json:"feedback_message"`
CsatReviewNotes string `gorm:"type:text" json:"csat_review_notes"`
ReviewNotesUpdatedAt *time.Time `json:"review_notes_updated_at,omitempty"`
ReviewNotesUpdatedByID *uint `json:"review_notes_updated_by_id,omitempty"`
}
func (CsatSurveyResponse) TableName() string { return "csat_survey_responses" }