Files
mats aa8b2bdedc
Build and Publish / BuildAndDeployAmd64 (push) Failing after 5s
Build and Publish / BuildAndDeployArm64 (push) Failing after 6s
all the refactor
2026-06-28 17:51:52 +02:00

25 lines
834 B
Go

package cart
import (
"git.k6n.net/mats/platform/money"
"git.k6n.net/mats/platform/tax"
)
// TaxProvider computes taxes for orders and line items.
// The canonical definition is now in platform/tax; this is a type alias
// for backward compatibility.
type TaxProvider = tax.Provider
// ComputeTax returns the VAT portion of an inc-VAT total. rateBp is basis points
// (2500 = 25%). Re-exported from platform/tax.
func ComputeTax(total money.Cents, rateBp int) money.Cents {
return money.Cents(tax.Compute(total.Int64(), rateBp))
}
// StaticTaxProvider is a stateless, always-available TaxProvider.
// Re-exported from platform/tax for backward compatibility.
type StaticTaxProvider = tax.Static
// NewStaticTaxProvider returns a new StaticTaxProvider.
func NewStaticTaxProvider() *StaticTaxProvider { return tax.NewStatic() }