Orchestrator refactoring + planned amounts

This commit is contained in:
Stephan D
2026-03-11 20:04:10 +01:00
parent 208b4283d0
commit f578278205
111 changed files with 2485 additions and 1517 deletions

View File

@@ -0,0 +1,24 @@
package shared
import (
"strings"
paymenttypes "github.com/tech/sendico/pkg/payments/types"
)
// CloneMoneyTrimNonEmpty clones a money value after trimming fields.
// It returns nil when amount or currency is missing.
func CloneMoneyTrimNonEmpty(src *paymenttypes.Money) *paymenttypes.Money {
if src == nil {
return nil
}
amount := strings.TrimSpace(src.GetAmount())
currency := strings.TrimSpace(src.GetCurrency())
if amount == "" || currency == "" {
return nil
}
return &paymenttypes.Money{
Amount: amount,
Currency: currency,
}
}