price

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteAll added in v0.6.0

func DeleteAll(db *gorm.DB) error

func UpsertAllByType added in v0.3.9

func UpsertAllByType(db *gorm.DB, commodityType config.CommodityType, prices []Price)

func UpsertAllByTypeNameAndID added in v0.6.0

func UpsertAllByTypeNameAndID(db *gorm.DB, commodityType config.CommodityType, commodityName string, commodityID string, prices []*Price)

Types

type AutoCompleteField added in v0.5.1

type AutoCompleteField struct {
	Label     string `json:"label"`
	ID        string `json:"id"`
	Help      string `json:"help"`
	InputType string `json:"inputType"`
}

type AutoCompleteItem added in v0.5.1

type AutoCompleteItem struct {
	Label string `json:"label"`
	ID    string `json:"id"`
}

type Price

type Price struct {
	ID            uint                 `gorm:"primaryKey" json:"id"`
	Date          time.Time            `json:"date"`
	CommodityType config.CommodityType `json:"commodity_type"`
	CommodityID   string               `json:"commodity_id"`
	CommodityName string               `json:"commodity_name"`
	Value         decimal.Decimal      `json:"value"`
}

func (Price) Less

func (p Price) Less(o btree.Item) bool

type PriceProvider added in v0.5.1

type PriceProvider interface {
	Code() string
	Label() string
	Description() string
	AutoCompleteFields() []AutoCompleteField
	AutoComplete(db *gorm.DB, field string, filter map[string]string) []AutoCompleteItem
	ClearCache(db *gorm.DB)
	GetPrices(code string, commodityName string) ([]*Price, error)
}

Jump to

Keyboard shortcuts

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