Calculates the price of a product from pricing rules given the following input, and of course access to the database: