models

package
v0.0.0-...-ced94c0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Company

type Company struct {
	ID                  uint           `gorm:"primaryKey;autoIncrement;unique" json:"id"`
	Name                string         `gorm:"not null" json:"name" binding:"required"`
	URL                 string         `gorm:"unique; not null" json:"url" binding:"required"`
	Address             datatypes.JSON `json:"address,omitempty"`
	SocialMedia         datatypes.JSON `json:"socialMedia,omitempty"`
	Description         string         `json:"description"`
	IsRemote            bool           `json:"isRemote"`
	IsJobPostingDisable bool           `gorm:"default:false" json:"isJobPostingDisable"`
	Users               []User         `json:"users,omitempty"`
	CreatedAt           int64          `gorm:"autoCreateTime" json:"createdAt"`
	UpdatedAt           int64          `gorm:"autoUpdateTime" json:"updatedAt"`
}

func (*Company) Create

func (c *Company) Create(db *gorm.DB) error

Create

func (*Company) GetDetails

func (c *Company) GetDetails(db *gorm.DB) error

Get details

type OTP

type OTP struct {
	Id        uint      `gorm:"primaryKey;autoIncrement;unique" json:"id"`
	OTP       string    `gorm:"not null" json:"otp"`
	MappingId uuid.UUID `gorm:"not null" json:"mappingId"`
	CreatedAt int64     `gorm:"autoCreateTime" json:"createdAt"`
	UpdatedAt int64     `gorm:"autoUpdateTime" json:"updatedAt"`
}

func (*OTP) GetLatestOTP

func (o *OTP) GetLatestOTP(db *gorm.DB) error

func (*OTP) Save

func (o *OTP) Save(db *gorm.DB) error

type OTPBody

type OTPBody struct {
	OTP string `json:"otp"`
}

type User

type User struct {
	ID          uuid.UUID      `gorm:"unique, not null" json:"id"`
	FirstName   string         `gorm:"not null" json:"firstName"`
	MiddleName  string         `json:"middleName,omitempty"`
	LastName    string         `gorm:"not null" json:"lastName"`
	Address     datatypes.JSON `json:"address,omitempty"`
	Avatar      string         `json:"avatar,omitempty"`
	RoleID      uint           `json:"roleId,omitempty"`
	IsVerified  bool           `json:"isVerified"`
	IsActive    bool           `gorm:"default:true" json:"isActive"`
	Department  string         `gorm:"not null" json:"department"`
	Designation string         `gorm:"not null" json:"designation"`
	Type        string         `gorm:"not null" json:"type"`
	Timezone    string         `gorm:"not null" json:"timezone"`
	CompanyID   uint           `json:"companyId"`
	CreatedAt   int64          `gorm:"autoCreateTime"`
	UpdatedAt   int64          `gorm:"autoUpdateTime"`
}

func (*User) BeforeCreate

func (u *User) BeforeCreate(tx *gorm.DB) error

Hook - BeforeCreate

func (*User) Create

func (u *User) Create(db *gorm.DB) error

Create

Jump to

Keyboard shortcuts

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