Forms & Validation

Field-level specifications for every form in the NIVAA platform — data types, validation rules, required/optional status, example values, and rendering components.

Validation Rules Summary

These cross-cutting rules apply across multiple forms and are enforced on both frontend and backend unless noted otherwise.

RuleDetailEnforcement
Email formatMust match ^[^\s@]+@[^\s@]+\.[^\s@]+$Backend + frontend
Password minimumAt least 8 charactersBackend + frontend
Postal codeExactly 6 digitsBackend (where applicable)
Time slotsend_time must be after start_timeBackend (session log)
Read-only fieldsnric_name, dob, gender, race — locked after first save on tutor profilesBackend enforced
Role restrictionSelf-registration limited to Parent or Tutor onlyBackend enforced

Educator Onboarding

Multi-step onboarding wizard for new tutors. Route: /apply/onboard. Component: src/routes/apply/onboard/+page.svelte. Step 1 calls POST /auth/register to create the account, then Steps 2–5 collect profile and intake data submitted via POST /intake/tutor.

FieldTypeRequiredValidationExample
display_namestringYesMin 1 characterAlex Tan
emailstringYesValid email format[email protected]
passwordstringYesMin 8 characterss3cur3Pa$$
phonestringNoDigits only91234567
subjectsarray of {stage, level, subject}YesMin 1 entry required[{stage:"Primary", level:"P3", subject:"Math"}]
eip_yearsnumberNoInteger >= 0, default 03
moe_yearsnumberNoInteger >= 0, default 05
intl_school_yearsnumberNoInteger >= 0, default 02
employment_typestringNoEnum: Full-time / Part-time / Other / Current Allied EducatorPart-time
areastringNoPlain textBukit Timah
postal_codestringNo6 digits588888
languagesstring[]NoFrom: English, Mandarin, Malay, Tamil, Other["English", "Mandarin"]
genderstringNoEnum: Male / Female. Locked after first saveFemale
racestringNoEnum: Chinese / Malay / Indian / Other. Locked after first saveChinese
introductionstringNoTextarea, free textI have 5 years of experience...
special_needs_experiencestring[]NoFrom: ASD, ADHD, Dyslexia, GDD, Dyscalculia, Other["ASD", "ADHD"]
past_student_profilesstringNoTextarea, free textTaught P3–P6 students with learning differences

The onboarding flow spans 5 wizard steps. Account creation (Step 1) is separate from intake submission (Step 5). gender and race become read-only after the first successful save.

Login

Standard credential-based login. Route: /login. Component: src/routes/login/+page.svelte. Backend: POST /auth/login.

FieldTypeRequiredValidationExample
emailstringYesValid email format[email protected]
passwordstringYesMin 1 characters3cur3Pa$$

Login password validation is min 1 character (presence check only). The stricter 8-character minimum applies only at registration.

Register

Role-aware self-registration for parents and tutors. Route: /register. Component: src/routes/register/+page.svelte. Backend: POST /auth/register. Coordinator educator setup links (/register?role=tutor&uid={user_id}) use GET /auth/register-prefill and can complete first-time password setup via POST /auth/complete-invite.

FieldTypeRequiredValidationExample
display_namestringYesMin 1 characterSarah Lim
emailstringYesValid email format[email protected]
passwordstringYesMin 8 charactersmyP@ssw0rd
rolestringYesEnum: Parent / Tutorparent

Only Parent and Tutor roles are available for self-registration. Coordinator and Admin accounts are created internally via the admin people page.

The setup-link role query is case-insensitive (role=tutor or role=Tutor). For this setup path, name/email fields are prefilled and locked, and the Singpass info panel is hidden.

Parent Posting

Form for parents to create a new tutoring request. Route: /parent/postings/new. Component: src/routes/parent/postings/new/+page.svelte. Backend: POST /postings.

FieldTypeRequiredValidationExample
child_idnumberYesMust be an existing child belonging to the parent (dropdown)12
subjectstringYesFrom level-based subject pickerMath
gradestringNoAuto-prefilled from child's current levelP3
session_duration_minsnumberYesEnum: 60 / 90 / 12090
timing_preferencesarray of {day, start_time, end_time}Noend_time must be after start_time[{day:"Monday", start_time:"15:00", end_time:"16:30"}]
location_areastringNoPlain textBukit Timah
language_preferencestringNoEnum: No preference / English / Mandarin / Malay / TamilNo preference
gender_preferencestringNoEnum: No preference / Male / FemaleNo preference
special_needs_summarystringNoTextarea, free textChild has mild ASD, prefers visual learning
other_requirementsstringNoCoordinator-only notes, not shown to tutorsFamily prefers weekend mornings

The grade field is auto-prefilled from the selected child's current_level. The subject picker options change dynamically based on the child's curriculum system and level.

Tutor Profile

Editable tutor profile for updating qualifications, availability, and personal details. Route: /tutor/profile. Component: src/routes/tutor/profile/+page.svelte. Backend: POST /intake/tutor.

Legacy TimeTap tutors may have sparse tutor_profiles rows. The read path now falls back to users.display_name, users.phone, and users.address_data.full_address so /tutor/profile still shows core name/contact/location data for older imported accounts.

Operational source-of-truth rule: if rollout sheets disagree with TimeTap on tutor email or educator code, use /home/ubuntu/tmp/nivaa/TimeTap System -NEW.xlsx as canonical. Staged tutor rollouts should be tracked in tutor_profiles.launch_cohort (for example Wave1Demo).

FieldTypeRequiredValidationExample
subjectsarray of {stage, level, subject}YesMin 1 entry[{stage:"Secondary", level:"Sec 2", subject:"Science"}]
eip_yearsnumberNoInteger >= 03
moe_yearsnumberNoInteger >= 05
intl_school_yearsnumberNoInteger >= 00
employment_typestringNoEnum: Full-time / Part-time / Other / Current Allied EducatorFull-time
areastringNoPlain textTampines
postal_codestringNo6 digits520123
languagesstring[]NoFrom: English, Mandarin, Malay, Tamil, Other["English"]
genderstringNoLocked after first save. Enum: Male / FemaleMale
racestringNoLocked after first save. Enum: Chinese / Malay / Indian / OtherIndian
nric_namestringNoLocked after first saveTAN WEI MING
dobdateNoLocked after first save. YYYY-MM-DD1995-03-15
introductionstringNoTextareaPassionate about inclusive education...
special_needs_experiencestring[]NoFrom: ASD, ADHD, Dyslexia, GDD, Dyscalculia, Other["Dyslexia"]
past_student_profilesstringNoTextareaPrimarily secondary school students
soft_constraintsstringNoFree text preferencesPrefer not to travel more than 30 min
schedulearray of {day, start_time, end_time}Noend_time must be after start_time[{day:"Tuesday", start_time:"14:00", end_time:"18:00"}]

Fields nric_name, dob, gender, and race are permanently locked after the first save. These values cannot be changed by the tutor — admin intervention is required for corrections.

Parent Profile

Parent profile now covers family particulars and address together. Route: /parent/profile. Component: src/routes/parent/profile/+page.svelte. Backend: GET /profile/parent/me returns display_name, email, phone, address, and created_at; PATCH /profile/parent/me updates display_name, phone, and address.

FieldTypeRequiredValidationExample
address_data.blockstringNoFrom OneMap autocomplete123
address_data.streetstringNoFrom OneMap autocompleteBukit Timah Road
address_data.unitstringNoFree text#05-12
address_data.postal_codestringNo6 digits588888
address_data.building_namestringNoFrom OneMap autocompleteThe Cascadia
address_data.latnumberNoAuto-populated from OneMap1.3321
address_data.lngnumberNoAuto-populated from OneMap103.7890
address_data.formattedstringNoAuto-generated full address string123 Bukit Timah Road #05-12, 588888

Address fields are populated via OneMap autocomplete. The lat, lng, and formatted fields are auto-generated — not manually editable. The address is used for location-based tutor matching. Full parent particulars such as display name and phone still need a backend contract expansion before the profile page can render them as first-class editable fields.

Child Creation

Add a new child to a parent's account. Route: /parent/children/new. Component: src/routes/parent/children/new/+page.svelte. Backend: POST /children.

FieldTypeRequiredValidationExample
display_namestringYesMin 1 characterAmelia
legal_namestringNoFree textAmelia Tan Wei Ling
dobdateNoYYYY-MM-DD format2016-05-20
school_namestringNoFree textNanyang Primary School
curriculum_systemstringYes (frontend)Enum: Singapore / SPED / International / IB / AP / BritishSingapore
current_levelstringConditionalRequired if curriculum is not SPED. Values depend on curriculum systemP3
overall_notesstringNoTextarea, free textNeeds extra help with reading comprehension

current_level is conditionally required — it must be provided for all curriculum systems except SPED. The available level options change dynamically based on the selected curriculum_system.

Readiness Report

Classroom readiness questionnaire filled by parents, scoring children across developmental domains. Route: /parent/children/[childId]/readiness/new. Component: src/routes/parent/children/[childId]/readiness/new/+page.svelte. Backend: POST /readiness.

FieldTypeRequiredValidationExample
child_idnumberYesDerived from URL parameter12
scoresobjectYesKeys are domain_item codes, values 0–3 (Not Yet / With Help / Mostly / Independently){"B1":2, "B2":3, "C1":1}
notes_bstringNoDomain B (Emotional Regulation) notesGets frustrated with difficult tasks
notes_cstringNoDomain C (Communication & Social) notesShy in group settings
notes_dstringNoDomain D (Learning Readiness) notesStrong visual learner
notes_estringNoDomain E (Independence) notesNeeds prompting for task transitions
notes_gstringNoDomain G (Literacy & Numeracy) notesReading at grade level
notes_hstringNoDomain H (Sensory Processing) notesSensitive to loud noises
coping_mechanismsstringNoFree textDeep breathing, fidget tools
likesstringNoFree textDrawing, Lego, animals
triggersstringNoFree textSudden schedule changes
what_worksstringNoFree textVisual timers, clear instructions
statusstringYesEnum: Draft / CompletedCompleted

Active domains are: B (Emotional Regulation), C (Communication & Social), D (Learning Readiness), E (Independence), G (Literacy & Numeracy), H (Sensory Processing). Each item within a domain is scored 0–3. Reports can be saved as Draft and completed later.

Session Log

Tutors log completed sessions for approval. Supports single and batch logging. Route: /tutor/sessions/log. Component: src/routes/tutor/sessions/log/+page.svelte. Backend: POST /appointments/log.

FieldTypeRequiredValidationExample
match_idnumberYesFrom active matches dropdown7
datestringYesYYYY-MM-DD format2026-03-25
start_timestringYesHH:MM format, must be before end_time14:00
end_timestringYesHH:MM format, must be after start_time15:30
tutor_notesstringNoFree textCovered fractions chapter 5
billed_as_addonbooleanNoDefault false. Marks session as ad-hoc (exam prep)false

Batch logging is supported — the payload accepts a sessions[] array for multiple sessions at once. Each session in the batch follows the same field rules. Ad-hoc sessions (billed_as_addon = true) are tracked separately in analytics and billing.

Add People (Admin)

Admin form for adding coordinators or parents to the platform. Educators are not directly created from admin people tools; they enter through the educator onboarding flow and are reviewed through /admin/tutors. Route: /admin/people. Component: src/routes/admin/people/+page.svelte. Backends: POST /admin/people/add-coordinator, POST /admin/people/add-parent.

Common Fields (all types)

FieldTypeRequiredValidationExample
display_namestringYesMin 1 characterJohn Lee
emailstringYesValid email format[email protected]
phonestringNoDigits only81234567

Parent-specific Fields

FieldTypeRequiredValidationExample
child_namestringNoCreates a child record linked to the parentEmma

Admin-created accounts generate a temporary password. The user must reset their password on first login. Coordinator accounts can only be created by admins — there is no self-registration path for coordinators.