4 ms·
My vision just now was to create a sand box with a DSL (that doesn't use floats) and have others write the rules into it. VAT.include(country, type, amount)
by 6510 3y ago
My vision just now was to create a sand box with a DSL (that doesn't use floats) and have others write the rules into it.
VAT.include(country, type, amount){
if(type == "high" && country == "NL"){
return percentageOf(price, VAT.NL.high) + amount;
}
throw new Error("Error in VAT.include: VAT not found.");
}