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
+4 -3
View File
@@ -7,6 +7,7 @@ import (
"time"
"git.k6n.net/mats/go-cart-actor/pkg/cart"
"git.k6n.net/mats/platform/money"
)
// --- Helpers ---------------------------------------------------------------
@@ -63,13 +64,13 @@ func makeCart(totalOverride int64, items []struct {
}) *cart.CartGrain {
g := cart.NewCartGrain(1, time.Now())
for _, it := range items {
p := cart.NewPriceFromIncVat(it.priceInc, 0.25)
p := cart.NewPriceFromIncVat(it.priceInc, 2500) // 25% in basis points
g.Items = append(g.Items, &cart.CartItem{
Id: uint32(len(g.Items) + 1),
Sku: it.sku,
Price: *p,
TotalPrice: cart.Price{
IncVat: p.IncVat * int64(it.qty),
IncVat: p.IncVat.Mul(int64(it.qty)),
VatRates: p.VatRates,
},
Quantity: it.qty,
@@ -81,7 +82,7 @@ func makeCart(totalOverride int64, items []struct {
// Recalculate totals
g.UpdateTotals()
if totalOverride >= 0 {
g.TotalPrice.IncVat = totalOverride
g.TotalPrice.IncVat = money.Cents(totalOverride)
}
return g
}