The daka query branching checked teacher_id first. When a student
has currentTeacherId set, both params are present, causing the
teacher branch to activate (requires scope) and fail with
"scope can not be none". Fixed by adding student_id.is_none()
to the teacher branch condition.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
List endpoint: batch-load daka_course_section, course_section,
course, and lianxi in single queries instead of per-daka loops.
Detail endpoint: single DB connection + batch relation lookup.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Allow students to filter dakas by teacher_id when querying.
Both student_id and teacher_id can now coexist in the request.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add published_snapshot (jsonb) and published_at (timestamp) columns
- New POST publish/{id} endpoint: stores snapshot JSON, locks editing
- New POST unpublish/{id} endpoint: clears published_at for editing
- Block update and sync_items when published_at is set
- Frontend detail page with conditional edit/publish/unpublish buttons
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
CourseGroup has treat_none_as_null=true, so partial updates would set
unsent fields to NULL. Merge with existing record before update to
preserve org_id, created_by, course_section_ids, and teachers.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Migrations:
- htyws: add org_id, org_visible columns to course_group
- htykc: create course_package_item table
Backend:
- CourseGroup: add org_visible, org_id fields; find_org_visible_by_org_id query
- CoursePackageItem: new model with sync/list API
- SUPERVISOR role check for package item management
- New endpoint: GET /api/v1/ws/find_org_visible_course_groups
- New endpoints: POST /api/v1/clazz/course-package/item/sync,
GET /api/v1/clazz/course-package/item/list/{package_id}
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Introduce course_package table and API for selling course templates.
Supports teacher-owned and org-wide active package queries with keyword
search, sort order, and pagination.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Downgrade list failures when loading ref resources for a section so one bad row does not fail the entire page; log warn with section id.
Made-with: Cursor
Require current_org_id for lianxi deletion and relation traversal, and add org-scoped relation lookups to prevent cross-organization hits in daka/jihua counters.
Made-with: Cursor
Add org_id fields and migrations for course, section, lianxi, piyue, and jihua/daka data paths, and enforce organization-scoped filtering in ws service queries.
Made-with: Cursor
Add org_id schema migrations and service-level filtering for teacher-student and class workflows, then cover org-context behavior with focused unit/e2e tests for leave and hour statistics.
Made-with: Cursor
nginx proxy_pass with location /api/v2/ts/ strips the prefix and appends
the remaining path to /api/v1/ts/, resulting in /api/v1/ts/ for root requests.
axum routes are exact-match by default, so add the trailing slash variant.
Make moicen env copying compatible with sibling AuthCore repo and add start/stop/build helper scripts for huiwings stack bring-up on moicen hosts.
Made-with: Cursor
Rename remaining qumu_category db artifacts to course_category and document jsonb key migration procedure for existing production data.
Made-with: Cursor
Track required workspace crates, scripts, and historical diesel migrations so the repository contains the complete runnable backend baseline.
Made-with: Cursor
Add diesel migrations and synchronize backend/frontend model fields plus jsonb key migration to support generic teaching subjects beyond piano-specific naming.
Made-with: Cursor