all the refactor
Build and Publish / BuildAndDeployAmd64 (push) Failing after 5s
Build and Publish / BuildAndDeployArm64 (push) Failing after 6s

This commit is contained in:
2026-06-28 17:51:52 +02:00
parent 7db0d236c7
commit aa8b2bdedc
84 changed files with 4328 additions and 2344 deletions
+19 -14
View File
@@ -1,30 +1,35 @@
package order
import "git.k6n.net/mats/go-cart-actor/pkg/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 in pkg/cart; this is a re-export for
// backward compatibility.
type TaxProvider = cart.TaxProvider
// The canonical definition is in platform/tax; this is a type alias
// for backward compatibility.
type TaxProvider = tax.Provider
// ComputeTax is the shared tax formula: tax = total x rate / (100 + rate).
// Re-exported from pkg/cart for backward compatibility.
func ComputeTax(total int64, taxRate int) int64 {
return cart.ComputeTax(total, taxRate)
// ComputeTax is the shared ex-VAT-first tax formula. rateBp is basis points
// (2500 = 25%). Re-exported from platform/tax for backward compatibility.
func ComputeTax(total money.Cents, rateBp int) money.Cents {
return money.Cents(tax.Compute(total.Int64(), rateBp))
}
// NordicTaxProvider implements TaxProvider for the Nordic countries.
// Re-exported from pkg/cart for backward compatibility.
type NordicTaxProvider = cart.NordicTaxProvider
// Re-exported from platform/tax for backward compatibility.
type NordicTaxProvider = tax.Nordic
// NewNordicTaxProvider returns a new NordicTaxProvider.
func NewNordicTaxProvider(defaultCountry string) *NordicTaxProvider {
return cart.NewNordicTaxProvider(defaultCountry)
return tax.NewNordic(defaultCountry)
}
// StaticTaxProvider is a stateless TaxProvider with no country awareness.
// Re-exported from pkg/cart for backward compatibility.
type StaticTaxProvider = cart.StaticTaxProvider
// Re-exported from platform/tax for backward compatibility.
type StaticTaxProvider = tax.Static
// NewStaticTaxProvider returns a new StaticTaxProvider.
func NewStaticTaxProvider() *StaticTaxProvider {
return cart.NewStaticTaxProvider()
return tax.NewStatic()
}