The form designer
Define the fields a requester fills in, per policy.
Every policy carries its own submit form. When someone starts a request under that policy, the app renders exactly the fields you designed, validates them server-side, and stores the values as the request’s payload.
Field types
| Type | Renders as | Validation |
|---|---|---|
text | Text input | Required flag |
number | Numeric input | Must be a number |
date | Date picker | Valid date |
select | Dropdown | Value must be one of the options |
Each field has a key (the payload name rules match on), an English label, an optional Arabic
label, and a required flag.
Why the payload matters
Field values are not decoration. They become the request’s snapshot, which is exactly what
conditional rules evaluate. A field with key amount
enables a rule like amount > 50000.
Example
The seeded “Purchase approval” policy defines:
[
{ "key": "amount", "label": "Amount (USD)", "type": "number", "required": true },
{ "key": "category", "label": "Category", "type": "select",
"options": ["it-equipment", "site-materials", "services", "other"], "required": true },
{ "key": "vendor", "label": "Vendor", "type": "text" }
]
Submitting without a required field, with a non-numeric amount, or with a category outside the options is rejected with a clear message before any routing happens.