I am looking for a way to empower advanced users to create and save custom math formulas that will be used in a shopping cart check-out process. These users are not programmers, but can follow instructions easily. The formulas should be editable by the users themselves, not by system administrators or developers.
A visual language UI seems like the ideal solution for this requirement, providing an environment familiar to power users that ultimately generates JavaScript code for the check-out routine to execute (evaluating myFormula).
For instance, consider the following myFormula example:
In this scenario, the user specifies the fee using... input type="number" ng-model="fee", while gross is entered at check-out (after testing the formula).
...and then, the formula is entered into a text box as follows (assuming fee was saved at 0.05):
var youPay = IF gross > 1000 THEN fee * gross ELSE 50
The resulting youPay amount is displayed during check-out. In this case, if the gross amount is under $1000, the customer pays a fixed fee of $50; otherwise, they pay five percent of the gross amount.
Do you have any feedback on the Google Blockly project or other potential solutions? Perhaps an Excel to JavaScript code converter where the Excel formula can be tested before being implemented in my application.
Furthermore, there needs to be a security layer added to ensure that the formulas do not pose any security threats or introduce bugs that could crash the check-out system.