Description
I'm using this lib for a project and i need to do two weird thing.
1 - I need to create a rule outside of querybuilder and add her to the other rules the user created. I need this because i must force that rule to always be present no matter what. (Unfortunately it can be one of three possible rules and there can only one of them at any time.)
2 - I plan, at a later time, to give the user the option to change the rules and so i can't show him/her this special rule grouped with the other rules because it needs special handling (with a special input in another section of the page)
For (1) i can't see any other solution except grabing the result of getRules() and adding it manually to the object.
For (2) i have no elegant solution except remove the "hidden" rule before displaying the other rules, let the user change them as it pleases and later re-add the rule.
Here is an example:
I have a car stand and i want to let the user select if they want a certain color, size, number of doors, etc.
However i want to force the user to ALWAYS select if it wants to buy a car (and each one), a goup of cars (assume that there are predefined groups already) or buy all cars.
Later, when the user chooses to change the rules, i want to show the rule to select a car, group or all in a separate section.
Are there better options to tackle this?
Oh the reason why i need this is because we have an internal system that requires all this as a single group of rules.