entities

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

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

Go to latest
Published: Oct 29, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Business

type Business struct {
	ID            uuid.UUID      `gorm:"type:uuid;"`
	Name          string         `gorm:"not null;"`
	Description   string         `gorm:"not null;"`
	Type          string         `gorm:"not null;"`
	Level         string         `gorm:"not null;"`
	Founded       time.Time      `gorm:"not null;"`
	Growths       []Growth       `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	ContactPerson Contact        `gorm:"type:jsonb;"`
	Entrepreneurs []Entrepreneur `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	CreatedAt     time.Time      `gorm:"default:CURRENT_TIMESTAMP"`
	UpdatedAt     time.Time      `gorm:"default:CURRENT_TIMESTAMP"`
}

func (*Business) BeforeCreate

func (b *Business) BeforeCreate(_ *gorm.DB) error

func (*Business) BeforeUpdate

func (b *Business) BeforeUpdate(_ *gorm.DB) error

func (*Business) Prepare

func (b *Business) Prepare()

type Contact

type Contact struct {
	Name  string `json:"name"`
	Phone string `json:"phone"`
}

func (*Contact) Scan

func (c *Contact) Scan(value interface{}) error

func (Contact) Value

func (c Contact) Value() (driver.Value, error)

type Entrepreneur

type Entrepreneur struct {
	ID         uuid.UUID `gorm:"type:uuid;"`
	Forename   string    `gorm:"not null;"`
	Surname    string    `gorm:"not null;"`
	Gender     string    `gorm:"not null;"`
	BirthDate  time.Time `gorm:"not null;"`
	Phone      string    `gorm:"not null;"`
	Email      string    `gorm:"not null;"`
	BusinessID string    `gorm:"default:null;"`
	Business   Business
	CreatedAt  time.Time `gorm:"default:CURRENT_TIMESTAMP"`
	UpdatedAt  time.Time `gorm:"default:CURRENT_TIMESTAMP"`
}

func (*Entrepreneur) BeforeCreate

func (t *Entrepreneur) BeforeCreate(_ *gorm.DB) error

func (*Entrepreneur) BeforeUpdate

func (t *Entrepreneur) BeforeUpdate(_ *gorm.DB) error

func (*Entrepreneur) Prepare

func (t *Entrepreneur) Prepare()

type Event

type Event struct {
	ID            uuid.UUID `gorm:"type:uuid;"`
	Name          string    `gorm:"not null;"`
	Description   string    `gorm:"not null;"`
	StartDate     time.Time `gorm:"not null;"`
	EndDate       time.Time `gorm:"not null;"`
	InstitutionID string    `gorm:"not null;"`
	Institution   Institution
	Trainees      []Trainee `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	Teams         []Team    `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	Rewards       []Reward  `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	CreatedAt     time.Time `gorm:"default:CURRENT_TIMESTAMP"`
	UpdatedAt     time.Time `gorm:"default:CURRENT_TIMESTAMP"`
}

func (*Event) BeforeCreate

func (e *Event) BeforeCreate(_ *gorm.DB) error

func (*Event) BeforeUpdate

func (e *Event) BeforeUpdate(_ *gorm.DB) error

func (*Event) Prepare

func (e *Event) Prepare()

type Growth

type Growth struct {
	ID          uuid.UUID `gorm:"type:uuid;"`
	Year        int64     `gorm:"not null;"`
	NetWorth    float64   `gorm:"not null;"`
	Income      float64   `gorm:"not null;"`
	Expenditure float64   `gorm:"not null;"`
	Assets      string    `gorm:"default:null;"`
	BusinessID  string    `gorm:"not null;"`
	Business    Business
	CreatedAt   time.Time `gorm:"default:CURRENT_TIMESTAMP"`
	UpdatedAt   time.Time `gorm:"default:CURRENT_TIMESTAMP"`
}

func (*Growth) BeforeCreate

func (g *Growth) BeforeCreate(_ *gorm.DB) error

func (*Growth) BeforeUpdate

func (g *Growth) BeforeUpdate(_ *gorm.DB) error

func (*Growth) Prepare

func (g *Growth) Prepare()

type Institution

type Institution struct {
	ID            uuid.UUID `gorm:"type:uuid;"`
	Name          string    `gorm:"not null;"`
	Description   string    `gorm:"default:null;"`
	Address       string    `gorm:"not null;"`
	ContactPerson Contact   `gorm:"type:jsonb;"`
	CreatedAt     time.Time `gorm:"default:CURRENT_TIMESTAMP"`
	UpdatedAt     time.Time `gorm:"default:CURRENT_TIMESTAMP"`
}

func (*Institution) BeforeCreate

func (i *Institution) BeforeCreate(_ *gorm.DB) error

func (*Institution) BeforeUpdate

func (i *Institution) BeforeUpdate(_ *gorm.DB) error

func (*Institution) Prepare

func (i *Institution) Prepare()

type Reward

type Reward struct {
	ID          uuid.UUID `gorm:"type:uuid;"`
	Name        string    `gorm:"not null;"`
	Description string    `gorm:"default:null;"`
	EventID     string    `gorm:"not null;"`
	Event       Event
	Position    int       `gorm:"not null;"`
	CreatedAt   time.Time `gorm:"default:CURRENT_TIMESTAMP"`
	UpdatedAt   time.Time `gorm:"default:CURRENT_TIMESTAMP"`
}

func (*Reward) BeforeCreate

func (r *Reward) BeforeCreate(_ *gorm.DB) error

func (*Reward) BeforeUpdate

func (r *Reward) BeforeUpdate(_ *gorm.DB) error

func (*Reward) Prepare

func (r *Reward) Prepare()

type Solution

type Solution struct {
	ID          uuid.UUID `gorm:"type:uuid;"`
	Title       string    `gorm:"not null;"`
	Description string    `gorm:"default:null;"`
	EventID     string    `gorm:"not null;"`
	Event       Event
	TeamID      string `gorm:"not null;"`
	Team        Team
	RewardID    string `gorm:"default:null;"`
	Reward      Reward
	Position    int       `gorm:"default:0"`
	CreatedAt   time.Time `gorm:"default:CURRENT_TIMESTAMP"`
	UpdatedAt   time.Time `gorm:"default:CURRENT_TIMESTAMP"`
}

func (*Solution) BeforeCreate

func (r *Solution) BeforeCreate(_ *gorm.DB) error

func (*Solution) BeforeUpdate

func (r *Solution) BeforeUpdate(_ *gorm.DB) error

func (*Solution) Prepare

func (r *Solution) Prepare()

type Team

type Team struct {
	ID          uuid.UUID `gorm:"type:uuid;"`
	Name        string    `gorm:"not null;"`
	Description string    `gorm:"default:null;"`
	EventID     string    `gorm:"not null;"`
	Event       Event
	Trainees    []Trainee `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	CreatedAt   time.Time `gorm:"default:CURRENT_TIMESTAMP"`
	UpdatedAt   time.Time `gorm:"default:CURRENT_TIMESTAMP"`
}

func (*Team) BeforeCreate

func (t *Team) BeforeCreate(_ *gorm.DB) error

func (*Team) BeforeUpdate

func (t *Team) BeforeUpdate(_ *gorm.DB) error

func (*Team) Prepare

func (t *Team) Prepare()

type Trainee

type Trainee struct {
	ID            uuid.UUID `gorm:"type:uuid;"`
	Forename      string    `gorm:"not null;"`
	Surname       string    `gorm:"not null;"`
	Gender        string    `gorm:"not null;"`
	BirthDate     time.Time `gorm:"not null;"`
	Phone         string    `gorm:"not null;"`
	Email         string    `gorm:"not null;"`
	Qualification string    `gorm:"default:null;"`
	EventID       string    `gorm:"not null;"`
	Event         Event
	TeamID        string `gorm:"default:null;"`
	Team          Team
	CreatedAt     time.Time `gorm:"default:CURRENT_TIMESTAMP"`
	UpdatedAt     time.Time `gorm:"default:CURRENT_TIMESTAMP"`
}

func (*Trainee) BeforeCreate

func (t *Trainee) BeforeCreate(_ *gorm.DB) error

func (*Trainee) BeforeUpdate

func (t *Trainee) BeforeUpdate(_ *gorm.DB) error

func (*Trainee) Prepare

func (t *Trainee) Prepare()

type User

type User struct {
	ID           uuid.UUID `gorm:"type:uuid;" json:"id"`
	FirstName    string    `gorm:"size:100;not null;"`
	LastName     string    `gorm:"size:100;not null;"`
	Phone        string    `gorm:"size:100;not null;unique;"`
	Password     string    `gorm:"size:100;"`
	BasePassword string    `gorm:"size:100;"`
	Status       string    `gorm:"size:100;"`
	Role         string    `gorm:"not null;"`
	CreatedAt    time.Time `gorm:"default:CURRENT_TIMESTAMP"`
	UpdatedAt    time.Time `gorm:"default:CURRENT_TIMESTAMP"`
}

func (*User) BeforeCreate

func (user *User) BeforeCreate(_ *gorm.DB) error

func (*User) BeforeUpdate

func (user *User) BeforeUpdate(_ *gorm.DB) error

func (*User) Prepare

func (user *User) Prepare()

Jump to

Keyboard shortcuts

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