feat: new validations
All checks were successful
Publish to docs.datacontroller.io / Deploy docs (push) Successful in 57s

This commit is contained in:
_
2026-02-15 23:49:13 +00:00
parent 965efacf70
commit f9daa7dfbb
2 changed files with 57 additions and 2 deletions

View File

@@ -20,9 +20,64 @@ When features are requested, we will describe the work to be performed in the se
The following features are currently requested:
* Additional Validations
* Ability to set 'number of approvals' to zero, enabling instant updates (4 days)
* Ability to make automated submissions using an API
### Additional Validations
The following additional features are necessary:
* Frontend Formulae
* Regex Rules
* Custom Functions
The above rules will apply only at frontend, and will be configurable in the MPE_VALIDATIONS table. The values will appear as part of the [editors/getdata](https://code.datacontroller.io/getdata_8sas_source.html) service response in the `dqrules` object.
**Frontend Formulae**
An example of a simple rule would be:
```sas
REVENUE = PRICE * VOLUME
```
How to apply this in Data Controller? Let's consider a table as follows:
|ITEM|PRICE|VOLUME|REVENUE|
|---|---|---|---|
|PAPER|4.20|100|`= PRICE * VOLUME`|
|PEN|61.02|1,971|`= PRICE * VOLUME`|
The plan here will be to introduce [hyperformula](https://hyperformula.handsontable.com/guide/demo.html) into HandsOnTable. We have confirmed with support, and it is included in our OEM plan. It will allow a library of ~400 functions and advanced excel-like behaviour.
HyperFormula requires cell references to operate (rather than named variables), eg as follows:
|ITEM|PRICE|VOLUME|REVENUE|
|---|---|---|---|
|PAPER|4.20|100|`= B1 * C1`|
|PEN|61.02|1,971|`= B2 * C2`|
For ease of use, and to avoid the need to hard code a particular column order, the frontend should perform replacement of the variables for each Formula cell. For instance, replacing ` PRICE ` with ` B1 ` and ` VOLUME ` with ` C1 ` in the first row (and with ` B2 ` and ` C2 ` in the second row respectively).
To avoid clashes with names that match function names (eg, `MATCH()`) each named variable **must have a leading and trailing blank**.
There would be two types applied:
* `HARDFORMULA` -> Column is readonly
* `SOFTFORMULA` -> Column can be changed by the user
**Regex Rules**
There are two types of rule we can apply in the form of regular expressions:
* `HARDREGEX` -> If the value fails the rule, the data cannot be submitted (turns red)
* `SOFTREGEX` -> If the value fails the rule we change the cell colour to yellow (as a warning), but can still submit
**Custom Functions**
There may be a requirement to implement a non-standard function, eg to return the value of the logged in user. For that we can implement a validation rule named `CUSTOMFUNC`. These functions will be built / tested / documented and packaged by the Data Controller team and shipped inside the product.
### Set Approvals to Zero