model

package
v0.0.0-...-534225f Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

type Batch struct {
	ID             int
	Name           string
	ExpirationDate time.Time
}

type Repository

type Repository struct {
	// contains filtered or unexported fields
}

func NewRepository

func NewRepository() *Repository

func NewRepositoryCustom

func NewRepositoryCustom(_db *gorm.DB) *Repository

func (*Repository) GetDB

func (r *Repository) GetDB() *gorm.DB

GetDB gets a database connection

func (*Repository) GetThing

func (r *Repository) GetThing(id int) *Thing

func (*Repository) GetThingByName

func (r *Repository) GetThingByName(name string) *Thing

func (*Repository) ListThings

func (r *Repository) ListThings() []Thing

func (*Repository) SaveThing

func (r *Repository) SaveThing(t *Thing) *Thing

type StockMovement

type StockMovement struct {
	ID         int     `json:"id" gorm:"primaryKey;autoIncrement"`
	Quantity   float64 `json:"quantity"`
	UnityValue float64 `json:"unityValue"`
}

type Thing

type Thing struct {
	ID             int             `json:"id" gorm:"primaryKey;autoIncrement"`
	Name           string          `json:"name" gorm:"uniqueIndex;unique;size:50"`
	Description    *string         `json:"description" gorm:"size:255"`
	Available      float64         `json:"available"`
	StockMovements []StockMovement `json:"movs"`
	CreatedAt      time.Time
	UpdatedAt      time.Time
}

Jump to

Keyboard shortcuts

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