- GIN indexes on students/teachers (jsonb_path_ops) for fast user lookups
- Composite index on clazz (is_repeat, start_from, end_by) for date range queries
- Indexes on clazz_repeat (clazz_id, repeat_start, repeat_end) for joins
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add `published_at IS NOT NULL` filter to the public-packages query.
Unpublished packages (ACTIVE status but no published_at) should not
appear in the student-facing store.
Two new model methods added:
- find_all_published_by_org_with_page
- find_all_published_with_page
Existing find_all_active_* methods unchanged for admin use.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Make org_id optional in find_public_course_packages API.
When omitted, return all active packages across all orgs.
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>
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>
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
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