I need to give a group of power users a way to create and save a math formula that will later be run as part of a shopping cart check-out routine. I'm must assume the power uses are not programmers but can follow simple instructions. The formulas will not change often but must be under the control of the power users, not system administrators or programmers.
A visual language UI seems like a good match for this sort of requirement, an environment that a power user can relate to that in the end generates JavaScript code that the check-out routine will be able to eval( myFormula ).
myFormula for example:
In this example fee is specified something like... input type="number" ng-model="fee" and gross would be entered at the time of check-out (excluding a test function before saving formula).
... then in a separate text box the formula would look something like the following (where I'm assuming fee was saved at 0.05.
var youPay = IF gross > 1000 THAN fee * gross ELSE 50
The youPay result will be displayed to the person checking out. In this example if the gross was less that $1000 a base amount of $50 would apply otherwise they would pay five percent of the gross
Does anyone have any comments about the Google Blockly project or other solutions that might help? Perhaps an Excel to JavaScript code generator where the Excel formula could be tested prior to saving in my application.
And then there will be another layer of this solution that will need to make sure the formula does not create security issues or introduce bugs that might crash the check-out application.