Lessons
A lesson is a single class within a unit, sorted by ordinal. Its
activities are the actual learner-facing steps.
list_lessons
Section titled “list_lessons”List the lessons of a unit, ordered by ordinal. RLS-scoped.
Inputs:
| Arg | Type | Notes |
|---|---|---|
unit_id | uuid | required |
Result: { "lessons": [ { "id", "unit_id", "ordinal", "title_i18n" }, … ] }
create_lesson
Section titled “create_lesson”Add a lesson to a unit. Author-role only.
Inputs:
| Arg | Type | Notes |
|---|---|---|
unit_id | uuid | Parent unit. |
ordinal? | int ≥ 0 | Sort position (default 0). |
title_i18n? | string | map | i18n map or bare string. |
Result: { "success": true, "lesson": { "id", "unit_id", "ordinal", "title_i18n" } }
update_lesson
Section titled “update_lesson”Update a lesson’s ordinal and/or title_i18n. Author-role only. Only
provided fields change.
Inputs:
| Arg | Type | Notes |
|---|---|---|
lesson_id | uuid | required |
ordinal? | int ≥ 0 | |
title_i18n? | string | map |
Result: { "success": true, "lesson": {…} }
delete_lesson
Section titled “delete_lesson”Delete a lesson. Cascades to its activities. Author-role only.
Inputs:
| Arg | Type | Notes |
|---|---|---|
lesson_id | uuid | required |
Result: { "success": true, "deleted": "<lesson_id>" }