upvote and feedback list
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/promote/production Build is passing

This commit is contained in:
2024-04-22 19:39:41 +03:00
parent 8fb0c0f056
commit 16a03ca5a1
17 changed files with 983 additions and 12 deletions

View File

@@ -11,23 +11,32 @@ type Feedback struct {
ProjectID string `gorm:"type:varchar(255)"`
SessionUUID string `gorm:"type:varchar(255)"`
SessionName string `gorm:"type:varchar(255)"`
Type string `gorm:"type:varchar(255)"`
Text string `gorm:"type:varchar(300)"`
Type FeedbackType `gorm:"type:varchar(255)"`
Text string `gorm:"type:varchar(300)"`
Upvote []Upvote `gorm:"foreignKey:FeedbackUUID;references:UUID"`
CreatedAt time.Time `gorm:"type:timestamp"`
UpdatedAt time.Time `gorm:"type:timestamp"`
}
func NewFeedback(userUUID, sessionUUID, ticketType, text, projectID string) *Feedback {
type FeedbackType string
const (
FeedbackTypeFeature FeedbackType = "feature"
FeedbackTypeFeedback FeedbackType = "feedback"
FeedbackTypeSupport FeedbackType = "support"
)
func NewFeedback(userUUID, sessionUUID, text, projectID string, feedbackType FeedbackType) *Feedback {
return &Feedback{
UUID: uuid.New().String(),
UserID: userUUID,
SessionUUID: sessionUUID,
ProjectID: projectID,
Type: ticketType,
Type: feedbackType,
Text: text,
}
}