Commit Graph

28 Commits

Author SHA1 Message Date
b1f35f9d1a test: harden business boundary conditions 2026-07-15 00:03:55 +08:00
0533c30ece refactor(classes): preserve student membership history 2026-07-13 16:12:57 +08:00
xyx
910a4263f6 fix: refactor notification display logic and add format function 2026-07-13 14:52:03 +08:00
a266d450e1 chore: apply eslint --fix autofixes (remove unnecessary as never casts in tests) 2026-07-12 23:01:37 +08:00
cc4f4dae4e fix: audit remediation — SSE user scoping, FK transactional safety, UI error handling
- H4: scoped SSE import progress to exact userId match; non-HTTP events excluded from all subscribers
- H2: moved PRAGMA foreign_key_check inside SQLite transaction before COMMIT; violations rollback preserving old tables
- M1: removed dead axios-style error branch from extractErrorMessage (interceptor already unwraps)
- M2: split handleSave try/catch — save errors vs reload errors shown distinctly
- M3: added provider field validation before AI config test request
- Added SSE scoping regression tests (import service + controller)
- Added FK check failure rollback test (database-migrations.spec)
- Updated controller spec expectations for userId parameter

Co-authored-by: Code Review <branch-review>
2026-07-12 22:59:03 +08:00
1e1c476bc3 feat: add CASL authorization and AI configuration 2026-07-11 14:25:34 +08:00
8ed1682b90 fix permissions and teacher attendance workflows 2026-07-10 20:40:52 +08:00
44105c1689 refactor: remove obsolete scaffolding and dead modules
Drop the unused root hello-world controller, empty CommonModule imports, development seeding code, legacy student report entity, stale DTOs, notification hook, and their placeholder tests.
2026-07-10 14:12:56 +08:00
b093d69f6a fix(server): correct archive filters and deposit access
Parse archived class query flags without Boolean string coercion, register the refund approval permission, and grant dorm managers the deposit permission group.
2026-07-10 14:12:44 +08:00
31bcd15189 fix: use real name and phone from frontend when importing students 2026-07-10 09:50:18 +08:00
b261ec5930 feat: change dingUserIds to users array with name/mobile in DTOs 2026-07-10 09:49:41 +08:00
6029d8e2fd refactor(server): remove Department/UserDepartment entities, CampusScope, and departmentId from all entities
- Delete department.entity.ts, user-department.entity.ts
- Remove Department/UserDepartment from entities/index.ts
- Remove departmentId column from 18 entities (AttendanceRecord, ArchiveAttachment, Bill, ClassSchedule, Classroom, ClassroomRental, Deposit, DepositInstallment, ExamScore, LearningRecord, Occupancy, PersonalExpense, ResultArchive, Room, RoomExpense, Student, StudentEnrollment, StudentProfile, StudentReport)
- Remove departments/ module entirely
- Delete campus-scope.ts, campus-scope.middleware.ts (request-utils.ts kept — it's just IP extraction)
- Simplify common.module.ts to empty module
- Remove CampusScopeMiddleware from app.module.ts
- Remove all CampusScope injections and filter calls across all services
- Remove departmentId from all DTOs and controllers
- Simplify dingtalk/wecom sync to only sync users (no dept table)
- Update seed module to remove department seeding
- Clean frontend compilation
2026-07-09 17:51:32 +08:00
22bc1876d8 refactor: remove departmentId from Class entity 2026-07-09 17:32:37 +08:00
40fef906cd fix: resolve DingTalk dept ID to local department ID in class create 2026-07-09 17:28:12 +08:00
9b7a8e37b4 fix: resolve 5 review findings
Critical 1: Remove broken '钉钉绑定' tab (IntegConfig) — deleted /rbac/user-ding-mappings calls
Critical 2: Fix decorator placement in CreateClassDto — @IsOptional @IsArray restored to teachers
Important 1: Restore sync.service.spec.ts from 1fa3363, strip importDingTalkUsers tests
Important 2: Fix N+1 in batchImportStudents — batched find/save with In() operator
Important 3: Add migrate-student-ding-mapping.sql
2026-07-09 17:25:44 +08:00
91035e9f2c feat: add batch-import students to class endpoint 2026-07-09 17:12:23 +08:00
b81a06e77c refactor(classes): remove CampusScope dependency 2026-07-09 16:32:01 +08:00
454a0d24c6 fix: release beds/lockers in batchCheckOut
The batchCheckOut method was not releasing assigned beds and lockers
after checkout, leaving them orphaned as 'occupied'. Added the same
release pattern used in checkOut() — using runner.manager.update()
since batchCheckOut operates inside a QueryRunner transaction.
2026-07-09 12:05:36 +08:00
5ea49d0a9e feat(classes): add schedule and attendance-summary endpoints + frontend tabs
- Add GET /classes/:id/schedule returning ClassSchedule list with classroom name
- Add GET /classes/:id/attendance-summary returning attendance/absence/late rates
- Add 课表 and 出勤汇总 tabs to Classes detail page
- Register ClassSchedule and AttendanceRecord in ClassesModule
2026-07-06 17:48:19 +08:00
7b298a615c feat: complete PRD verification fixes and deployment readiness
- Add CommonModule to provide/export CampusScope across business modules
- Replace DepartmentsModule imports with CommonModule in 11 modules
- Add missing Class/Tenant repository imports to StudentsModule and SchedulesModule
- Fix service specs with CampusScope, ClassRepository, StudentRepository mocks
- Move better-sqlite3 to optionalDependencies for production Docker builds
- Rewrite Dockerfiles for monorepo root build context
- Update docker-compose.yml service build contexts
2026-07-06 01:55:35 +08:00
cd6364268d feat: integrate CampusScope.filter() into all business services (12 services + 12 modules) 2026-07-05 23:58:51 +08:00
7020e86809 feat: integrate notification creation into business modules (classes, schedules done; bills/occupancies/deposits need student→userId mapping) 2026-07-05 23:25:34 +08:00
194f25c3ad feat: add class roster export and attendance stats export
- GET /classes/:id/roster/export — Excel export with 姓名/学号/加入日期/状态
- GET /attendance-records/export — Excel export with 姓名/班级/日期/时段/状态/来源/备注/打卡时间
- Add findAllForExport to AttendanceService (no pagination)
- Both use ExcelJS following classrooms controller downloadTemplate pattern
2026-07-05 20:35:11 +08:00
66aadfe3ff fix: I2 add studentNo to class listing, I4 replace attendance edit placeholder with working edit modal 2026-07-05 20:31:53 +08:00
b7117ddf2d fix: review blockers — entity registration, session enum, conflict date-range, @Type decorators 2026-07-05 20:20:43 +08:00
ec26cb5f5e feat(classes): add ClassesController with operation logging and permission guards 2026-07-05 19:05:18 +08:00
786aa2ba2d fix: add @IsEnum validation to Classes DTOs 2026-07-05 19:02:54 +08:00
c378cc45f8 feat: add ClassesService with CRUD + student/teacher management 2026-07-05 18:59:09 +08:00