package domain import ( "context" "time" ) type UserRole string const ( UserRoleAdmin UserRole = "admin" UserRoleUser UserRole = "user" ) type User struct { ID string `gorm:"primaryKey;type:text"` Email string `gorm:"uniqueIndex;not null;type:text"` Name string `gorm:"type:text"` // Primary name (Russian) Password string `gorm:"not null;type:text"` Role UserRole `gorm:"type:varchar(50);default:'user'"` CreatedAt time.Time `gorm:"autoCreateTime"` UpdatedAt time.Time `gorm:"autoUpdateTime"` } // TableName specifies the table name for GORM func (User) TableName() string { return "users" } type UserRepository interface { GetByEmail(ctx context.Context, email string) (*User, error) GetByID(ctx context.Context, id string) (*User, error) Create(ctx context.Context, user *User) error }