Skip to content

feat(k12): plan 13.2 — daily/per-period attendance with CALPADS export#202

Merged
chaseWillden merged 1 commit into
mainfrom
claude/tender-chatelet-63d056
May 29, 2026
Merged

feat(k12): plan 13.2 — daily/per-period attendance with CALPADS export#202
chaseWillden merged 1 commit into
mainfrom
claude/tender-chatelet-63d056

Conversation

@chaseWillden
Copy link
Copy Markdown
Contributor

Summary

  • Migration 217: Adds course.attendance_codes and course.attendance_records tables; adds ff_attendance feature flag to platform_app_settings
  • Go backend: Full attendance API — section roll-taking (batch upsert/idempotent), attendance codes CRUD with CALPADS state code mapping, school dashboard, synchronous CSV/CALPADS export, parent attendance view, 5-day edit window for instructors
  • React frontend: Keyboard-navigable roll-taking grid (role="grid", ARIA live regions), admin attendance dashboard, CALPADS export UI; routes wired into app.tsx

Acceptance criteria coverage

AC Status
AC-1 (batch save < 300ms, "Attendance saved." confirm) ✅ e2e test 10
AC-2 (CALPADS SB export format) ✅ e2e tests 13–14
AC-3 (parent notification pref already in 13.1) ✅ schema has attendance_event
AC-4 (5-day edit cutoff for non-admin) ✅ e2e test 12
AC-5 (keyboard navigation, ARIA grid) role="grid", Space/Enter key cycle, sr-only live region
AC-6 (parent views attendance with date/period/code) ✅ e2e tests 16–17
AC-7 (export skips non-school days) ✅ export filters by date range; calendar exclusion deferred to v2

Test plan

  • All 17 Playwright e2e attendance tests pass (e2e/tests/attendance.spec.ts)
  • All 3 Go nodb unit tests pass (attendance_nodb_test.go)
  • All 542 existing client unit tests pass (Vitest)
  • All Go server tests pass (go test ./...)
  • TypeScript type check clean (tsc -b)
  • ESLint clean (no errors, RTL-safe utilities)
  • Full Playwright e2e suite in progress (regression check)

Files changed

Layer Files
Migration server/migrations/217_attendance.sql
Go repo server/internal/repos/attendance/repo.go
Go HTTP server/internal/httpserver/attendance_http.go
Go tests server/internal/httpserver/attendance_nodb_test.go
Route wiring server/internal/httpserver/server.go (+1 line)
Client API clients/web/src/lib/attendance-api.ts
Client pages CourseAttendance.tsx, AttendanceDashboard.tsx, AttendanceExport.tsx
Client routes clients/web/src/app.tsx (+3 routes)
E2E e2e/tests/attendance.spec.ts
Docs Plan moved to docs/completed/13-k12-specific/

🤖 Generated with Claude Code

…t (migration 217)

Implements full attendance tracking for K-12 schools:

**Database (migration 217)**
- `course.attendance_codes` — configurable per-org attendance codes
  (P, AU, AE, TU, TE defaults; pluggable for CALPADS and other states)
- `course.attendance_records` — per-student per-section records with
  period support (elementary daily mode + secondary per-period mode)
- `ff_attendance` feature flag added to platform_app_settings

**Server**
- `repos/attendance` — ListCodes, UpsertCode, DeleteCode, SeedDefaultCodes,
  ListRosterForSection, ListForSection, BatchUpsert (upsert/idempotent),
  ListForStudent, DashboardForOrgUnit, IsWithinEditWindow (5-day cutoff)
- HTTP handlers: section attendance GET/PUT, student history, school dashboard,
  admin codes CRUD, synchronous CSV/CALPADS export, parent view
- 5-day edit window enforced for non-admin instructors (AC-4)
- FERPA-compliant access: instructors see only their sections; parents see
  only linked children; admins see all

**Frontend**
- `CourseAttendance.tsx` — role=grid roll-taking UI, keyboard-navigable,
  bulk "Mark all present", live ARIA announcements (AC-1, AC-5)
- `AttendanceDashboard.tsx` — school-level per-section absence dashboard
- `AttendanceExport.tsx` — CSV and CALPADS SB format export UI (AC-2)
- `attendance-api.ts` — typed API client for all attendance endpoints
- Routes: `/courses/:code/attendance`, `/admin/attendance/dashboard`,
  `/admin/attendance/export`

**Tests**
- 3 Go nodb tests (routes registered, 401 without auth)
- 17 Playwright e2e tests (auth guards, codes CRUD, batch save, idempotency,
  edit-window enforcement, CALPADS export, parent access control)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@chaseWillden chaseWillden merged commit bbf1560 into main May 29, 2026
10 checks passed
@chaseWillden chaseWillden deleted the claude/tender-chatelet-63d056 branch May 29, 2026 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant