Commit Graph

24 Commits

Author SHA1 Message Date
38f6e18cca Task 3: sync RENTAL class_schedule on rental create/update/delete
- ClassroomRentalsService.create/update now upsert a ClassSchedule row with schedule_type='RENTAL' and rental_id set.
- ClassroomRentalsService.remove deletes the synced schedule row; update to 'cancelled' also removes it.
- SchedulesService.getClassroomOccupancy explicitly returns INTERNAL and RENTAL schedules.
- Make classId/teacherId/rentalId nullable in ClassSchedule entity to support rental schedules.
- Add unit tests for rental schedule sync and mixed-type occupancy.
2026-07-06 17:55:08 +08:00
8bd59b8ac6 feat: complete student archive subsystem — 7 entities, PDF report, frontend profile page 2026-07-06 15:58:36 +08:00
1c097dc230 feat: new classrooms default to 'reserved' status instead of 'available' 2026-07-06 15:26:35 +08:00
8d810374f0 feat: add source tracking fields to Department for sync idempotency 2026-07-06 15:10:11 +08:00
94251b66ce fix: TypeORM rejects string|null union type for mysql 2026-07-06 10:49:59 +08:00
6ba7213cc4 feat(deposits): add refund rejection path with reason 2026-07-06 09:48:20 +08:00
ad24c9ef23 feat: add department_id to all business entities 2026-07-05 23:45:05 +08:00
7d945029eb feat: add Department and UserDepartment entities 2026-07-05 23:43:57 +08:00
9d9d4719b5 feat: add Student-User association and activate all notification TODOs 2026-07-05 23:42:22 +08:00
bb11ca1880 feat: add Notification entity 2026-07-05 22:56:54 +08:00
6d589f6faa fix: remove null union types causing TypeORM Object inference on Deposit columns 2026-07-05 20:58:49 +08:00
f7cb7a9599 fix: add explicit datetime type to Deposit refund columns 2026-07-05 20:57:45 +08:00
2357db31dd fix: remove broken Department relation from Class entity 2026-07-05 20:56:23 +08:00
09580e4a4e feat: P2-15 cron-based DingTalk/WeCom sync with logging and incremental sync
- Add @nestjs/schedule dependency
- Create SyncLog entity (platform, syncType, status, recordsCount, errorMessage, timestamps)
- Create SyncState entity for tracking lastSyncAt per platform
- SyncService with @Cron('0 2 * * *') daily scheduled sync
- Incremental sync: tracks last_sync_at per platform, passes to integration APIs
- Full/incremental mode determined by existence of prior sync
- SyncController: POST /sync/trigger (manual), GET /sync/logs (history)
- Register SyncModule in AppModule with ScheduleModule
2026-07-05 20:48:43 +08:00
ab4adf1174 P2-14: Deposit installment tracking + refund approval flow
- Add DepositInstallment entity (id, depositId, amount, dueDate, paidDate, status, createdAt)
- Add installments OneToMany relation to Deposit entity with cascade+eager
- Add refund approval fields: refundStatus, refundRequestedAt, refundApprovedBy, refundApprovedAt
- Add installment DTOs (CreateInstallmentDto, UpdateInstallmentDto)
- Add refund approval DTOs (ApproveRefundDto, CreateDepositWithInstallmentsDto)
- Service: add/create/update/delete installments, requestRefund, approveRefund, findPendingRefunds
- Controller: GET deposits/:id, GET pending-refunds, POST :id/installments, PUT installments/:id, DELETE installments/:id, POST :id/request-refund, PUT :id/approve-refund
- Frontend: detail modal with installment list, refund request button, pending refunds tab with approve actions
2026-07-05 20:46:05 +08:00
5df70a8af0 feat: P2-12 Teacher profile/workspace + P2-13 Multi-class comparison
P2-12 Teacher Management:
- Add profile JSON field (subjects, joinedAt, qualifications) to User entity
- Add GET/PUT /rbac/users/:id/profile endpoints with UpdateProfileDto
- Add GET /rbac/teacher-workspace endpoint returning assignedClasses,
  todaySchedules, and myStudents
- Create /teacher-workspace page with tabs (My Classes, Today's Schedule,
  My Students)
- Add route with PermissionRoute and menu item in MainLayout

P2-13 Student Archive Multi-class:
- Add GET /students/:id/compare-classes endpoint returning side-by-side
  enrollment data with per-class attendance statistics
- Students module now includes ClassStudent and AttendanceRecord entities
- No 2-enrollment cap existed in the codebase; student enrollments
  already return all records via class-student table
2026-07-05 20:42:27 +08:00
80ce911b88 fix: add studentNo field to Student entity 2026-07-05 20:35:47 +08:00
41f381e941 feat: attendance frontend page + backend list/classes endpoints
- Create AttendancePage with filter bar, table, calendar view toggle, batch add modal
- Register /attendance route with PermissionRoute (attendance:view)
- Add menu item in MainLayout with CheckCircleOutlined icon
- Add GET /attendance-records with pagination and filters
- Add GET /attendance-records/classes for class dropdown
- Add source column to AttendanceRecord entity (default: manual)
- Frontend tsc --noEmit: clean; backend: only pre-existing test errors
2026-07-05 19:49:53 +08:00
b6e308ae2a feat: add Attendance module with batch, summary, calendar, and dingtalk endpoints 2026-07-05 19:44:10 +08:00
881e9c6175 feat: add rental_category/rate to Room, rental_type/tenant_id to Occupancy, tenant_id to Student 2026-07-05 19:31:03 +08:00
78320b8682 feat: add ClassSchedule entity 2026-07-05 19:18:31 +08:00
e1d9ce9709 feat: add Class, ClassStudent, ClassTeacher entities 2026-07-05 18:53:12 +08:00
4f4cee157a chore: commit oxfmt formatting changes and verify artifacts 2026-07-02 15:55:09 +08:00
46a817503e feat(task1): restructure directories for turborepo monorepo
- Move backend/ to apps/server/ via git mv
- Move frontend/ to apps/admin/ via git mv
- Create packages/typescript-config/ with base, nestjs, and react-vite presets
2026-07-02 15:05:12 +08:00