package shared

import (
	"strings"

	"github.com/tech/sendico/payments/storage/model"
)

func NormalizeFundingMode(mode model.FundingMode) model.FundingMode {
	switch strings.ToLower(strings.TrimSpace(string(mode))) {
	case string(model.FundingModeNone):
		return model.FundingModeNone
	case string(model.FundingModeBalanceReserve):
		return model.FundingModeBalanceReserve
	case string(model.FundingModeDepositObserved):
		return model.FundingModeDepositObserved
	default:
		return model.FundingModeUnspecified
	}
}
