Commit Graph

6 Commits

Author SHA1 Message Date
weli fa14a5ca8c perf: add GIN indexes on clazz JSONB columns and date-range indexes
- 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>
2026-05-03 09:39:36 +08:00
weli debff3a447 fix: use string_to_date in by_hty_id clazz queries
The by_hty_id variants incorrectly used string_to_datetime which expects
%Y-%m-%d %H:%M:%S format, but the API sends date-only %Y-%m-%d.
Switching to string_to_date fixes silent query failures.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 10:22:24 +08:00
weli 5bf43143ea feat: add audit logging and lesson statistics for clazz
- Add clazz_audit_log table with diesel migration for CRUD audit trail
- Add audit log backend: model, queries, handler, route
- Add audit log viewer in clazz detail modal (操作记录)
- Add student_lesson_stats API (GET /api/v1/clazz/stats/my-lessons)
- Add teacher_detail_stats API (GET /api/v1/clazz/stats/teacher-detail)
- Register all new routes in lib.rs

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 19:45:56 +08:00
weli c5134c9356 feat(org): enforce tenant isolation in ws/kc with leave and stats APIs
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
2026-04-27 20:12:02 +08:00
weli 0e53c9f66d feat(htykc): clazz completed_at migration; logrotate for htykc/htyproc/htyts
Portable run_rotate; moicen_start_huiwings_stack and ws_clazz updates; schema/models sync.

Made-with: Cursor
2026-04-26 17:14:44 +08:00
weli bcd2c50729 feat(htykc): clazz 命名迁移、消课点名与 Diesel 迁移
将课程相关表与 API 从 kecheng 迁至 clazz;新增消课/点名迁移;htyws 路由同步;工作区依赖 patch AuthCore。

Made-with: Cursor
2026-04-24 07:43:05 +08:00