entities

package
v0.0.0-...-54db4b9 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2021 License: Apache-2.0 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 {
	gorm.Model
	Name     string    `header:"Name" gorm:"unique"`
	Projects []Project `gorm:"foreignKey:CompanyRef"`
}

type Project

type Project struct {
	gorm.Model
	Name        string    `header:"Name"`
	Description string    `header:"Description"`
	Budget      float64   `header:"Budget"`
	StartDate   time.Time `header:"Start Date"`
	Finished    bool      `header:"Completed" gorm:"'Finished' boolean"`
	CompanyRef  uint      `header:"Company Ref"`
	Company     Company   `gorm:"foreignKey:CompanyRef"`
	Users       []User    `gorm:"many2many:projects_users;"`
}

type User

type User struct {
	gorm.Model
	FirstName string    `header:"First Name"`
	LastName  string    `header:"Last Name"`
	Email     string    `header:"Email"`
	Username  string    `header:"Username"`
	Password  string    `header:"Password"`
	Active    bool      `gorm:"'Active' boolean"`
	Projects  []Project `gorm:"many2many:projects_users;"`
}

func (*User) BeforeSave

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

Jump to

Keyboard shortcuts

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