ingredient

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Query

type Query interface {
	New() Query

	Get() (*UsedIngredient, error)
	Select() ([]UsedIngredient, error)

	Insert(UsedIngredient) (UsedIngredient, error)
	Update(UsedIngredient) (UsedIngredient, error)
	Delete(id int64) error

	Page(pageParams pgdb.OffsetPageParams) Query

	FilterById(ids ...int64) Query
	FilterByName(names ...string) Query
	FilterByQuantity(quantities ...int64) Query
	FilterByOrigin(origins ...string) Query
	FilterByPrice(prices ...float64) Query
	FilterByDeletionDate(dates ...time.Time) Query
	FilterByReason(reasons ...string) Query
}

func NewQuery

func NewQuery(db *sqlx.DB) Query

type UsedIngredient

type UsedIngredient struct {
	Id           int64     `db:"ID" structs:"-"`
	Name         string    `db:"NAME" structs:"name"`
	Quantity     int64     `db:"QUANTITY" structs:"quantity"`
	Origin       string    `db:"ORIGIN" structs:"origin"`
	Price        float64   `db:"PRICE" structs:"price"`
	DeletionDate time.Time `db:"DELETION_DATE" structs:"deletion_date"`
	Reason       string    `db:"REASON" structs:"reason"`
}

Jump to

Keyboard shortcuts

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