I hope you can help me on this one, since I was unable to find anything relatable on HN or elsewhere:<p>I am currently building a variable cost calculation function for cost quotations. Craftsman and Installer should be able to create a variable cost quotation for their service which works for different sizes of buildings. Such as the installation of a heat pump or air conditioning.<p>The calculation should look like this:<p>(variables are given by the system)<p>cost block A: variable_1 x 100<p>cost block B: if variable_2 = true +200<p>(add all to get the sum)<p>The current setup works as follows:<p>1. Create calculation in Form (DnD)<p>2. Convert to json-logic `https://github.com/jwadhams/json-logic-js`<p>3. Save to Database in json field<p>-- Display Product or Service --<p>4. Get json-logic from DB and apply for each cost block with
variables<p>5. Return in API<p>6. Display for Customer in Front End<p>Am I missing something, is there a better way?