package tax

import "golang.source-fellows.com/solid/srp"

func NewTaxCalculator(country string) srp.TaxCalculatorFunc {
	switch country {
	case "FR":
		return FranceTaxCalculator
	default:
		return GermanTaxCalculator
	}
}

var GermanTaxCalculator = func(p srp.Product) float64 {
	return p.Price / 119 * 19
}

var FranceTaxCalculator = func(p srp.Product) float64 {
	return p.Price / 119 * 19
}
