Add lessons Phase 4: lesson sessions with hybrid calendar generation

Individual lesson occurrences generated from schedule slot patterns.
Idempotent session generation with configurable rolling window.
Post-lesson notes workflow with auto-set notesCompletedAt. Status
tracking (scheduled/attended/missed/makeup/cancelled) and date/time
filtering. 13 new tests (64 total lessons tests).
This commit is contained in:
Ryan Moon
2026-03-30 09:29:03 -05:00
parent 93405af3b2
commit 73360cd478
8 changed files with 587 additions and 3 deletions

View File

@@ -0,0 +1,22 @@
-- Phase 4: Lesson sessions — individual lesson occurrences
CREATE TYPE "lesson_session_status" AS ENUM ('scheduled', 'attended', 'missed', 'makeup', 'cancelled');
CREATE TABLE "lesson_session" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid(),
"enrollment_id" uuid NOT NULL REFERENCES "enrollment"("id"),
"scheduled_date" date NOT NULL,
"scheduled_time" time NOT NULL,
"actual_start_time" time,
"actual_end_time" time,
"status" lesson_session_status NOT NULL DEFAULT 'scheduled',
"instructor_notes" text,
"member_notes" text,
"homework_assigned" text,
"next_lesson_goals" text,
"topics_covered" text[],
"makeup_for_session_id" uuid,
"notes_completed_at" timestamptz,
"created_at" timestamptz NOT NULL DEFAULT now(),
"updated_at" timestamptz NOT NULL DEFAULT now()
);

View File

@@ -218,6 +218,13 @@
"when": 1774900000000,
"tag": "0030_enrollments",
"breakpoints": true
},
{
"idx": 31,
"version": "7",
"when": 1774910000000,
"tag": "0031_lesson_sessions",
"breakpoints": true
}
]
}