entity

package
v0.0.0-...-7a2aee4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	*gorm.Model
	ID          uuid.UUID `gorm:"type:uuid;primaryKey"`
	FirstName   string    `gorm:"size:100;not null"`
	LastName    string    `gorm:"size:100"`
	Email       string    `gorm:"size:100;unique;not null"`
	Password    string    `gorm:"size:255"`
	PhoneNumber string    `gorm:"size:20"`
	IsActive    bool      `gorm:"type:boolean"`
	Provider    string    `gorm:"size:20"`
	ProviderID  string    `gorm:"size:100"`
}

User represents a user in the system. The struct fields are annotated with GORM tags to specify database constraints.

func (*User) BeforeCreate

func (user *User) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate is a GORM hook that is triggered before a new record is created in the database. It sets the ID field to a new UUID if it hasn't been set already.

func (User) TableName

func (User) TableName() string

TableName overrides the default table name used by GORM for the User model.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL