19 lines
533 B
Go
Raw Normal View History

2025-08-09 15:08:26 +07:00
package entities
import (
"time"
"github.com/google/uuid"
)
type Title struct {
ID uuid.UUID `gorm:"type:uuid;primary_key;default:gen_random_uuid()" json:"id"`
Name string `gorm:"not null" json:"name"`
Code *string `gorm:"uniqueIndex" json:"code,omitempty"`
Description *string `json:"description,omitempty"`
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at"`
}
func (Title) TableName() string { return "titles" }