Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

05 — Screen Inventory (Parents Module)

Every screen of the Parents module: intent, route, composition, states, permissions, platform behavior, events. Authoritative components in 00-shared/03; module-specific components in 07_Component_Library.md.

Legend — States: idle / loading / success / empty / error(offline, 4xx, 5xx) / permission. Analytics events {module}.{screen}.{action} (proposed; SDK open — 00-shared/10 §8).


1. Parents List (/parents)

FieldDetail
PurposePaginated directory of guardian profiles
SourceGET /parentsdata: ParentDocument[], meta:{page,limit,totalItems,totalPages,hasNext,hasPrevious} (parent.service.ts:55-67, pagination-query.dto.ts:32-39)
Entry / Exitshell → list; → detail, → /parents/new
WidgetsAppSearchBarserver ignores q (parent.service.ts:58-61) → treat as client-side filter or omit (OQ-7); AppListTile rows (identity from joined User), AppSkeleton(list), AppEmptyState ("No guardians yet"), AppErrorState, RefreshIndicator
FAB"Add guardian" (extended, Icons.person_add) → /parents/new
Paginationinfinite scroll via meta.hasNext (00-shared/06 §3.2); no sort param honored (OQ-7)
Row actionsAppMenu: Open, Edit
Statesloading skeleton; empty; error 5xx generic + requestId; offline last-good cache + banner
Analyticsparents.list.{view,search,open,create_tap}
A11yrow semantics "Guardian , linked children N"; list position announced
Adaptivephone single column; tablet 2-column; desktop master-detail ≥ 840 dp

2. Parent Detail (/parents/:id)

FieldDetail
PurposeFull guardian profile + all linked children with per-link metadata
SourceGET /parents/:id (404 "Parent not found." parent.service.ts:51) + GET /parents/:id/studentsraw link docs (parent.service.ts:69-72)
Entry / Exitlist → detail; → edit; → link sheet
CompositionHeader: AppAvatar (from User.avatarFileId/name), display name (join users), chips (occupation, company); sections: Emergency & pickup (profile flags), Linked children (per child: relationship chip, primary badge, pickup/financial/priority line, AppMenu: Unlink, Set primary)
Join noteLink docs expose only studentId/parentId ObjectIds (student-parent-link.schema.ts:18-25) → client joins GET /students/:id per child (OQ-10)
404 stateAppErrorState "Guardian not found" + back
Pull-to-refreshyes
Analyticsparents.detail.{view,edit_tap,link_tap,unlink_tap}

3. Create / Edit Parent Form (/parents/new, /parents/:id/edit)

FieldDetail
PurposeCreate or update a guardian profile
SourcePOST /parents (create-parent.dto.ts), PATCH /parents/:id (update-parent.dto.ts)
Create-only fielduserId (required @IsMongoId, create-parent.dto.ts:5-7) — picker over GET /users?q= (users.service.ts:90-115); not editable after create (update-parent.dto.ts has no userId)
Fieldsoccupation, company, annualIncome (number), relationshipNotes, emergencyContactPriority (number), pickupAuthorization (switch, default false parent.schema.ts:28)
Duplicate409 → inline banner + "open existing profile" (parent.service.ts:32-34)
Statesidle/loading/error/saving; 400 field details mapped
Analyticsparents.form.{open,submit,success,duplicate,error}
FieldDetail
PurposeCreate one student_parent_links row
SourcePOST /parents/link/:studentId (link-parent.dto.ts, student-parent-link.service.ts:16-32)
Compositionstudent picker (search by admission number/name) or preselected; AppDropdown relationship (mother/father/guardian/grandparent/relative/foster_parent — enum student-parent-link.schema.ts:7-14); AppSwitch isPrimaryGuardian; AppSwitch pickupAllowed (default true, student-parent-link.schema.ts:33-34); AppSwitch financialResponsibility; number field emergencyPriority
Warnings"Already linked" if the pair exists in loaded links (client pre-check, OQ-2); "This student already has a primary guardian — replace?" (OQ-5)
Errors404 student (only when server validates — today it doesn't, OQ-3); 400 validation
Analyticsparents.link.{open,submit,success,warn_duplicate}
FieldDetail
PurposeConfirm removing a parent–student relationship
SourceDELETE /parents/link/:linkId → 404 "Link not found." (student-parent-link.service.ts:38-41)
Copy"Unlink from ? The guardian profile and other links are kept." (04-Modules/Parents.md:58)
Primary caseIf link isPrimaryGuardian → warn "This child will have no primary guardian." (OQ-4)
Behaviordestructive-style confirm (error CTA, heavyImpact); server-first (no optimistic)

6. My Children (/my/children) (forward-looking)

FieldDetail
PurposeParent home: enumerate own linked children only (privacy boundary USER_PERSONAS.md:48-53)
SourceNo endpoint today (OQ-1): needs (planned) GET /parents/me (or userId filter) + links; then GET /students/:id join per child
CompositionChildSwitcherBar (avatars row), selected child summary card (name, class/grade via student.schema.ts:33-39), entry points to attendance/results/fees (other modules, student.read)
EmptyAppEmptyState "No linked children — contact the school office"
Offlinecached last-good children list

7. Child Switcher (component, embedded in /my/children and child context screens)

FieldDetail
PurposeMulti-child households switch context without leaving the screen
StateChildSwitcherCubit (selectedChildId persisted in memory; 13_State_Management.md §3)
Behaviorhorizontal avatar chips, selected = primaryContainer; all child-context modules read selected child
A11yeach chip: "Child: , selected"; Semantics(toggled:)

8. My Profile (/my/profile) (forward-looking)

FieldDetail
PurposeParent edits own guardian flags (occupation, emergency priority, pickup)
SourceGET /parents/:id + PATCH /parents/:id (self-owned id resolved via (planned) my-profile endpoint)
Read-onlyrelationship/primary/pickup-per-child (link-level, no link PATCH endpoint — OQ-4); identity fields (from users)

Shared components used

AppListTile, AppCard, AppAvatar, AppChips, AppBadge, AppSwitch, AppDropdown, AppTextField, AppSearchBar, AppDialog, AppBottomSheet, AppMenu, AppSkeleton, AppEmptyState, AppErrorState, AppOfflineBanner, AppFAB, AppSnackbar, AppSectionHeader, AppInfoRow. Module-specific: ParentListTile, GuardianCard, LinkedChildCard, RelationshipChip, PrimaryGuardianBadge, ChildSwitcherBar (07_Component_Library.md).

Analytics events (proposed)

parents.list.{view,search,open,create_tap}, parents.detail.{view,edit_tap,link_tap,unlink_tap}, parents.form.{open,submit,success,duplicate,error}, parents.link.{open,submit,success,warn_duplicate}, parents.unlink.{confirm,success,404}, parents.my.children.{view,switch_child} (all proposed).