retail

package
v0.0.0-...-8b501b0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PriceCalculator

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

PriceCalculator estimates the VAT-inclusive retail prices of items.

func NewPriceCalculator

func NewPriceCalculator(priceSvcEndpoint, vatSvcEndpoint string) *PriceCalculator

NewPriceCalculator creates a PriceCalculator instance that queries the provided endpoints for item price and VAT information.

func (*PriceCalculator) PriceForItem

func (pc *PriceCalculator) PriceForItem(itemUUID string) (float64, error)

PriceForItem calculates the VAT-inclusive retail price of itemUUID with the currently applicable VAT rates.

func (*PriceCalculator) PriceForItemAtDate

func (pc *PriceCalculator) PriceForItemAtDate(itemUUID string, date time.Time) (float64, error)

PriceForItemAtDate calculates the VAT-inclusive retail price of itemUUID with the VAT rates that applied at a particular date.

Jump to

Keyboard shortcuts

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