more changes
All checks were successful
Build and Publish / BuildAndDeployAmd64 (push) Successful in 36s
Build and Publish / BuildAndDeployArm64 (push) Successful in 3m59s

This commit is contained in:
matst80
2025-12-01 20:15:48 +01:00
parent c227870f13
commit 060b3dfbf0
22 changed files with 316 additions and 242 deletions

View File

@@ -15,6 +15,9 @@ func RemoveVoucher(g *CartGrain, m *messages.RemoveVoucher) error {
StatusCode: 400,
}
}
if g.PaymentInProgress > 0 {
return ErrPaymentInProgress
}
if !slices.ContainsFunc(g.Vouchers, func(v *Voucher) bool {
return v.Id == m.Id
@@ -42,6 +45,10 @@ func AddVoucher(g *CartGrain, m *messages.AddVoucher) error {
}
}
if g.PaymentInProgress > 0 {
return ErrPaymentInProgress
}
if slices.ContainsFunc(g.Vouchers, func(v *Voucher) bool {
return v.Code == m.Code
}) {