Schemas
Field types
The 18 types, how each is validated, and how its value is normalized.
Types are the vocabulary of a schema. Each has deterministic rules — the same rules for every schema. GET /api/v1/field-types returns the list with each type's options.
| Type | Title | Options |
|---|---|---|
string | Short text | min, max, pattern |
text | Free text | min, max |
number | Number | min, max |
integer | Whole number | min, max |
money | Amount of money | validation.currency, min, max |
boolean | Yes / no | — |
enum | One of a list | — |
date | Date | validation.notBefore |
time | Time of day | — |
datetime | Date and time | validation.notBefore |
duration | Duration | normalization.unit |
phone | Phone number | validation.country, validation.inferFromUnassigned, normalization.format |
email | Email address | pattern |
person | Person name | — |
address | Address / place | — |
location | Location | — |
array | List | min, max |
object | Group of fields | — |
Validation and normalization by type
| Type | Validation | Normalized to |
|---|---|---|
string | Every meaningful word must appear in what was said; a one-letter spelling fix is accepted as uncertain. No number that wasn't said. | Trimmed. |
text | Mostly the speaker's own words (≥75%); no time, size or count that wasn't said. | Lightly tidied by the model; numbers as numerals. |
person | Every word said, exactly. Never corrected or completed; pronouns and role words are never names. | None. |
address / location | Every word said; one-letter spelling fixes are uncertain. «هون», «هناك» are never places. | Returned as text — never geocoded. |
phone | A valid number whose digits were spoken (digits, words, chunks, +962). One digit short → invalid with `heard`. | national or international (+962…). |
email | Every part of the address must have been said. | «at»/«dot»/«آت»/«دوت» → @ and . |
number / integer | That number was said — digits, Arabic number words («ميه وخمسين»), or a dual noun («شاورمتين» = 2). min / max. | A number. |
money | That amount was said. Needs confirmation unless the schema turns it off. | A number + `unit` (currency). |
boolean | The deciding words (`said`) must have been said. | true / false. |
enum | An allowed option; the option's label or a synonym was said → extracted, otherwise uncertain (mapped_by_model). | The option's value. |
date | Resolved in code from the words: «بكرا», weekdays, «25 أيلول». Relative dates need `referenceTime`, or come back invalid. | YYYY-MM-DD. `notBefore` keeps an end after a start. |
time | The hour must have been said; without morning/evening it is uncertain (am_pm_assumed). | HH:MM, 24-hour. |
datetime | Date and time rules together. | YYYY-MM-DDTHH:MM. |
duration | Read from the words: «ساعتين», «ساعة ونص», «3 أيام». | ISO 8601 (PT1H30M) or minutes/hours/days. |
array | Each entry checked with its own type; entries that were not said are dropped and listed in `issues`. | A list. |
object | Each sub-field checked; an entry whose required part was invented is dropped. | An object. |
Generic text is never transformed aggressively: string and text keep the speaker's words. Specialized types — phones, money, dates — get canonical forms.
