34 lines
745 B
Go
34 lines
745 B
Go
package models
|
|
|
|
import (
|
|
"github.com/google/uuid"
|
|
"time"
|
|
)
|
|
|
|
type Feedback struct {
|
|
UUID string `gorm:"primaryKey"`
|
|
UserID string `gorm:"type:varchar(255)"`
|
|
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)"`
|
|
|
|
CreatedAt time.Time `gorm:"type:timestamp"`
|
|
UpdatedAt time.Time `gorm:"type:timestamp"`
|
|
}
|
|
|
|
func NewFeedback(userUUID, sessionUUID, ticketType, text, projectID string) *Feedback {
|
|
return &Feedback{
|
|
UUID: uuid.New().String(),
|
|
UserID: userUUID,
|
|
SessionUUID: sessionUUID,
|
|
ProjectID: projectID,
|
|
|
|
Type: ticketType,
|
|
Text: text,
|
|
}
|
|
}
|