Skip to content · تخطَّ إلى المحتوى
نبرة Nabra

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.

TypeTitleOptions
stringShort textmin, max, pattern
textFree textmin, max
numberNumbermin, max
integerWhole numbermin, max
moneyAmount of moneyvalidation.currency, min, max
booleanYes / no—
enumOne of a list—
dateDatevalidation.notBefore
timeTime of day—
datetimeDate and timevalidation.notBefore
durationDurationnormalization.unit
phonePhone numbervalidation.country, validation.inferFromUnassigned, normalization.format
emailEmail addresspattern
personPerson name—
addressAddress / place—
locationLocation—
arrayListmin, max
objectGroup of fields—

Validation and normalization by type

TypeValidationNormalized to
stringEvery meaningful word must appear in what was said; a one-letter spelling fix is accepted as uncertain. No number that wasn't said.Trimmed.
textMostly the speaker's own words (≥75%); no time, size or count that wasn't said.Lightly tidied by the model; numbers as numerals.
personEvery word said, exactly. Never corrected or completed; pronouns and role words are never names.None.
address / locationEvery word said; one-letter spelling fixes are uncertain. «هون», «هناك» are never places.Returned as text — never geocoded.
phoneA valid number whose digits were spoken (digits, words, chunks, +962). One digit short → invalid with `heard`.national or international (+962…).
emailEvery part of the address must have been said.«at»/«dot»/«آت»/«دوت» → @ and .
number / integerThat number was said — digits, Arabic number words («ميه وخمسين»), or a dual noun («شاورمتين» = 2). min / max.A number.
moneyThat amount was said. Needs confirmation unless the schema turns it off.A number + `unit` (currency).
booleanThe deciding words (`said`) must have been said.true / false.
enumAn allowed option; the option's label or a synonym was said → extracted, otherwise uncertain (mapped_by_model).The option's value.
dateResolved 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.
timeThe hour must have been said; without morning/evening it is uncertain (am_pm_assumed).HH:MM, 24-hour.
datetimeDate and time rules together.YYYY-MM-DDTHH:MM.
durationRead from the words: «ساعتين», «ساعة ونص», «3 أيام».ISO 8601 (PT1H30M) or minutes/hours/days.
arrayEach entry checked with its own type; entries that were not said are dropped and listed in `issues`.A list.
objectEach 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.