Commit Graph

311 Commits

Author SHA1 Message Date
e7e335cd95 spec: fix student import name/phone from dingtalk 2026-07-10 09:45:43 +08:00
97c2ceccde fix: re-apply UX fixes on Bills, Expenses, Deposits
- Add Empty component to antd imports
- Replace console.error with message.error in catch blocks
- Add batchLoading state + guard on batch operations
- Add locale emptyText to Tables
2026-07-09 19:57:10 +08:00
8f28c172c4 fix: close unclosed fragments in Expenses/Deposits, fix brace in Bills 2026-07-09 19:52:33 +08:00
bc2ff2b270 fix: brace mismatch in Classes fetchData try/catch/finally 2026-07-09 19:49:21 +08:00
c59fd6ce92 fix(admin): UX improvements — silent fetch failures, empty states, batch loading guards, dashboard refresh
- Replace console.error-only catches with message.error user-facing notifications
  across Bills, Classes, ClassroomRentals, ClassroomSchedule, Classrooms, Deposits,
  Expenses, OperationLogs, Permissions, Roles, RoomVisual, Rooms, Students,
  Tenants, Users
- Add Empty component via Table locale prop on list pages: Bills, Classes,
  ClassroomRentals, Classrooms, Deposits, Expenses (room+personal), Occupancies,
  Rooms, Students, Tenants, Roles
- Add batchLoading state to batch delete/update operations: Bills (batchDelete,
  batchUpdateStatus), Expenses (batchDeleteRoom, batchDeletePersonal),
  Occupancies (batchCheckOut, batchDelete), Rooms (batchDelete),
  Students (batchDelete)
- Add refreshLoading indicator to Dashboard header when re-fetching data
- Consistent error pattern: catch (e: unknown) { const err = e as { message?: string }; message.error(...); }
2026-07-09 18:03:42 +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
b0f7883f33 feat(admin): remove all department/campus scoping from frontend
- Delete CampusSwitcher component and useCampus hook
- Delete Departments page and its route
- Remove campus header interceptor from API client
- Remove departmentId from Class interfaces
- Remove campusLocation from student profile
- Remove department permissions from test fixtures
- Remove currentCampusId from test cleanup

TypeScript compiles clean.
2026-07-09 17:40:57 +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
1f63a53222 feat: rewrite sync drawer with checkable tree + class batch import 2026-07-09 17:16:08 +08:00
91035e9f2c feat: add batch-import students to class endpoint 2026-07-09 17:12:23 +08:00
7b8691866e refactor: remove User-based import and RBAC UserDingMapping endpoints 2026-07-09 17:10:33 +08:00
570ef7b7e9 revert: remove deepest-2-levels filter, restore full org tree 2026-07-09 17:07:22 +08:00
e87e5e2096 refactor: syncAll creates Student + StudentDingMapping directly 2026-07-09 17:05:54 +08:00
73c1ea7a76 fix: correct studentId-as-userId bugs in 3 files
- dingtalk.service.ts syncOneUser: find Student by userId before mapping,
  use Student.id (not User.id) as studentId FK
- sync.service.ts importDingTalkUsers: type coercion for studentId
  (method deleted in Task 4, minimal compile fix)
- schedule-sync.service.ts getStatus: remove broken teacher mapping
  query (teacher scheduling deprecated); hardcode mappedTeachers=0,
  totalTeachers=0
2026-07-09 17:04:35 +08:00
86f126671c fix: repair 5 sites where StudentDingMapping.studentId was misused as User FK
- dingtalk.service.ts syncOneUser: query studentRepo (not userRepo) by mapping.studentId
- sync.service.ts importDingTalkUsers: skip User role lookup for existing mappings
- attendance.service.ts autoMatchDingRecords: use studentId directly, remove second-hop query
- schedule-sync.service.ts syncAll: skip teacher mapping block (deprecated)
- rbac.service.ts getUnboundUsers: return [] (method deleted in Task 4)
2026-07-09 17:00:00 +08:00
ef1b46b9f4 refactor: replace UserDingMapping with StudentDingMapping entity 2026-07-09 16:53:25 +08:00
1fa336331c docs: student ding mapping + batch operations implementation plan 2026-07-09 16:49:38 +08:00
6762a7f661 docs: student ding mapping + drawer batch operations spec 2026-07-09 16:46:32 +08:00
c1d065a5e6 fix(students): remove staff role from status map 2026-07-09 16:32:02 +08:00
4592502876 feat(sync): add import request/result logging 2026-07-09 16:32:02 +08:00
6b232eb4ed fix(seed): only seed with SEED_DEV=true, not auto on dev env 2026-07-09 16:32:01 +08:00
c56f297f95 refactor: remove SeedModule from app imports (manual seed only) 2026-07-09 16:32:01 +08:00
b81a06e77c refactor(classes): remove CampusScope dependency 2026-07-09 16:32:01 +08:00
5145c3e4b4 fix(layout): use controlled sidebar openKeys to preserve manual expand/collapse across navigation 2026-07-09 16:31:56 +08:00
d1d5b4681b feat(schedules): replace teacher ID input with searchable user select, show teacher name, add schedule button 2026-07-09 16:31:53 +08:00
c928ee0f65 feat(rbac): add user-ding-mapping CRUD endpoints 2026-07-09 16:31:50 +08:00
4f3b5112b0 feat: filter org-tree-with-users to deepest 2 levels 2026-07-09 16:12:13 +08:00
0509175a57 feat: add getDeptDepthMap BFS method for org tree depth tracking 2026-07-09 16:08:53 +08:00
a6891b32d7 docs: implementation plan for org tree deepest levels filter 2026-07-09 16:07:26 +08:00
3ee1ebaa1e docs: org tree deepest levels only design spec 2026-07-09 16:06:09 +08:00
7e4f06058c fix(admin): match flat API response shape, no nested data envelope 2026-07-09 15:52:40 +08:00
64c8964ea4 fix(server): handle existing User from syncAll in importDingTalkUsers to avoid UNIQUE constraint error 2026-07-09 15:51:04 +08:00
2da2e68318 fix(admin): refactor inline map arrow to avoid oxc TSX parser confusion 2026-07-09 15:46:24 +08:00
d2d0ca31ad fix(admin): use type pattern consistent with rest of codebase (oxc compat) 2026-07-09 15:43:46 +08:00
867e1aab1f fix(admin): avoid TSX generic syntax to fix oxc parser in Vite 8 2026-07-09 15:41:30 +08:00
8bfb8bf7ae fix(admin): fix syntax error — missing closing parens in map after console.log removal 2026-07-09 15:39:03 +08:00
4d4db7626c chore: remove dead CampusScope references from attendance spec test 2026-07-09 15:35:59 +08:00
3240c7cfdd fix(server): restore @InjectRepository(UserDingMapping) accidentally removed with scope 2026-07-09 15:31:35 +08:00
7f355952fd fix(server): remove CampusScope from AttendanceService 2026-07-09 15:29:50 +08:00
897ffbe018 fix(server): restore staff exclusion in StudentsService.findAll default filter 2026-07-09 15:28:18 +08:00
9b36284f1a fix(server): remove CampusScope from StudentsService 2026-07-09 15:25:54 +08:00
b624c52b30 fix(admin): restore nested ImportUsersResponse and remove debug console.log 2026-07-09 15:24:54 +08:00
f7df3bdcf1 fix(admin): only show class-mark button on leaf departments with users 2026-07-09 15:18:23 +08:00
3ea7f9a2b7 docs: add DingTalk import fix implementation plan 2026-07-09 15:17:25 +08:00
a568d9a871 docs: add DingTalk import fix design spec 2026-07-09 15:15:56 +08:00
7666baceff fix: add missing Bed and Locker entities to TypeORM registration 2026-07-09 14:00:58 +08:00
db3e4aae84 fix(admin): display classCount and warnings in import response 2026-07-09 13:01:07 +08:00
eeacab6130 test(sync): add class-marking import test cases (7 new, 5 fixed) 2026-07-09 12:53:03 +08:00