model

package module
v0.0.0-...-3f451a6 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2023 License: GPL-2.0 Imports: 1 Imported by: 0

README

model

zdev model

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Email

type Email struct {
	gorm.Model
	Address string
	UserID  uint
}

type Group

type Group struct {
	gorm.Model
	Name    string
	UserID  uint
	Members []*User `gorm:"many2many:group_users;"`
	Admins  []*User `gorm:"many2many:group_admins;"`
}

type Phone

type Phone struct {
	gorm.Model
	Number string
	UserID uint
}

func FromNumber

func FromNumber(number string) *Phone

func FromNumbers

func FromNumbers(numbers ...string) (phones []*Phone)

type Role

type Role struct {
	gorm.Model
	Title string
}

type User

type User struct {
	gorm.Model
	Name         string
	Code         string
	NationalCode string
	FullName     string
	Role         *Role
	Phones       []*Phone
	Emails       []*Email
	Ownerships   []*Group
	Memberships  []*Group `gorm:"many2many:group_users;"`
	Managements  []*Group `gorm:"many2many:group_admins;"`
}

Jump to

Keyboard shortcuts

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