models

package
v0.0.0-...-924408c Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Boat

type Boat struct {
	ID           int       `gorm:"primaryKey"`
	Name         string    `gorm:"size:124;unique;not null"`
	BtypeID      uint8     `gorm:"not null"`
	Displacement uint16    `gorm:"not null"`
	Build_date   time.Time `gorm:"not null"`
	CreatedAt    time.Time
	UpdatedAt    time.Time
	DeletedAt    gorm.DeletedAt `gorm:"index"`
	Btype        Btype
}

type Btype

type Btype struct {
	ID   uint8  `gorm:"primaryKey"`
	Name string `gorm:"size:124"`
}

type Employee

type Employee struct {
	ID         int    `gorm:"primaryKey"`
	Lastname   string `gorm:"size:124;not null"`
	Firstname  string `gorm:"size:124;not null"`
	Middlename string `gorm:"size:124;"`
	Address    string `gorm:"size:255;not null"`
	Birth_date time.Time
	PositionID uint8 `gorm:"not null"`
	CreatedAt  time.Time
	UpdatedAt  time.Time
	DeletedAt  gorm.DeletedAt `gorm:"index"`
	Position   Position
	Trips      []Trip `gorm:"many2many:trips_employees;"`
}

type FishType

type FishType struct {
	ID       int       `gorm:"primaryKey"`
	Name     string    `gorm:"not null" form:"name"`
	SeaBanks []SeaBank `gorm:"many2many:sea_banks_fish_types;"`
}

type FishTypeTrip

type FishTypeTrip struct {
	FishTypeID int
	TripID     int
	Catch      int `gorm:"default:0"`
}

type Position

type Position struct {
	ID   uint8  `gorm:"primaryKey"`
	Name string `gorm:"size:124"`
}

type Role

type Role struct {
	ID   int    `gorm:"primaryKey"`
	Name string `gorm:"size:16;unique;not null"`
}

type SeaBank

type SeaBank struct {
	ID        int        `gorm:"primaryKey"`
	Lat       float64    `gorm:"not null" form:"lat"`
	Lng       float64    `gorm:"not null" form:"lng"`
	Name      string     `gorm:"not null" form:"name"`
	FishTypes []FishType `gorm:"many2many:sea_banks_fish_types;"`
	Trips     []Trip     `gorm:"many2many:sea_banks_trips;"`
}

type Trip

type Trip struct {
	ID            int `gorm:"primaryKey"`
	BoatID        int `gorm:"not null"`
	DepartureDate time.Time
	ArrivalDate   time.Time `gorm:"default:2006-01-02"`
	Boat          Boat
	Employees     []Employee `gorm:"many2many:trips_employees;"`
	SeaBanks      []SeaBank  `gorm:"many2many:sea_banks_trips;"`
	FishTypes     []FishType `gorm:"many2many:fish_type_trips;"`
}

type User

type User struct {
	ID        int    `gorm:"primaryKey"`
	Name      string `gorm:"unique; size:32"`
	Password  string
	RoleID    int `gorm:"not null"`
	CreatedAt time.Time
	UpdatedAt time.Time
	Role      Role
}

Jump to

Keyboard shortcuts

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