I have a case where I have an existing method that does a specific kind of processing. I have setup a database table that it checks and if a specific value in a column exists it uses the value in one of the columns.
Example: let's say that I have a method that charges a user. And I have in the table a row that has a column for the country and a column for reduction percentage. So while I am processing the user if the user's country exists in the table I use the value of the column to reduce the price. So far so good.
My question is how could I enhance my design in order to add more general/complex rules?
E.g. I would like to support some kind of interface that the user specifies rules e.g. a user's age or a product weight etc and based on this rules my code processing can figure out how to apply them?
I mean how could I extend my simple table and business logic processing with the country/percentage values to a small rule based setup?
I don't need really complex rules. Just the ability to be let the define a rule if needed