package psvc

import (
	svcshared "github.com/tech/sendico/payments/orchestrator/internal/service/shared"
	paymenttypes "github.com/tech/sendico/pkg/payments/types"
)

func stepMoneyEqual(left, right *paymenttypes.Money) bool {
	left = svcshared.CloneMoneyTrimNonEmpty(left)
	right = svcshared.CloneMoneyTrimNonEmpty(right)
	switch {
	case left == nil && right == nil:
		return true
	case left == nil || right == nil:
		return false
	default:
		return left.Amount == right.Amount && left.Currency == right.Currency
	}
}
