Every screen of the Leave module, its intent, route, composition, states,
permissions, and data source. Authoritative shared components in
00-shared/03; this file enumerates which ones each screen uses with
module specifics. Legend matches design-docs/auth/05.
AppCard per type: code badge, name, daysRemaining headline, daysPerYear, carriedForward, daysUsed sub-line; linear progress used/entitlement
States
loading (skeleton per card); empty (no types — server seeds defaults on first call, leave.service.ts:299-306, so practically unreachable); error (offline → cached copy + banner; 404 user → inline)
Refresh
pull-to-refresh (RefreshIndicator)
Analytics
leave.balance.open, leave.balance.refresh
Permission
any authenticated user; client hides for viewing others' balance (API does not restrict — gap, leave.controller.ts:55-59)
Notes
Balance is live-computed (leave.service.ts:87-88); never cache > 1 session. Weekend/holiday days count as used days (:310-312) — surface a caption on the card
GET /leave/types (leave.controller.ts:67-71) for the picker; submit POST /leave/requests (:32-36)
Form
leave type (required, dropdown from types), startDate (required), endDate (required), reason (optional, multiline) — contract per create-leave-request.dto.ts:4-21; daysRequested is server-computed (not in DTO)
Primary CTA
"Submit request"
States
loading (types + submit); validation (client: endDate ≥ startDate; mirror of leave.service.ts:133-134); error: 404 type (reload types), 409/offline
GET /leave/requests?status=pending (admin sees all, leave.service.ts:163-167); optional ?userId= (leave.controller.ts:41-44)
Composition
filter chips (pending default, approved, rejected); list of request tiles with requester name (needs users lookup — no populate in service, gap), dates, days, reason
error: 409 not approved (leave.service.ts:227-230), 404 no teacher record (:232-238), 409 time clash (:241-250) → inline "already assigned in this slot"
Decision pushed to requester via LeaveApproved/LeaveRejected events
(events/leave-events.ts:10-18) → Notifications module; substitution
notification to substitute + students (planned, IMPLEMENTATION_PLAN.md:163).