price

package
v0.0.0-...-b0e2d2c Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ProductPriceTableName = "product_price"

Variables

This section is empty.

Functions

This section is empty.

Types

type ProductPrice

type ProductPrice struct {
	ProductId int64     `db:"product_id"`
	DateTime  time.Time `db:"date_time"`
	Price     int       `db:"price"`
	Currency  string    `db:"currency"`
}

type Repository

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

func NewRepository

func NewRepository(db *sql.DB) *Repository

func (*Repository) CountPrices

func (r *Repository) CountPrices(productId int64, tx *sql.Tx) (int64, error)

func (*Repository) CreatePrice

func (r *Repository) CreatePrice(productId int64, currency string, price int, timestamp time.Time, tx *sql.Tx) error

func (*Repository) FindLatestPrice

func (r *Repository) FindLatestPrice(productId int64, tx *sql.Tx) (*ProductPrice, error)

func (*Repository) FindPrices

func (r *Repository) FindPrices(productId int64, offset int64, limit int, orderBy, direction string, tx *sql.Tx) ([]ProductPrice, error)

func (*Repository) FindPricesBetween

func (r *Repository) FindPricesBetween(productId int64, from time.Time, to time.Time, tx *sql.Tx) ([]ProductPrice, error)

Jump to

Keyboard shortcuts

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