Features - User Management (Phase 4.1): - Database: Add user_modules table for fine-grained module permissions - Database: Add 4 user permissions (view/create/edit/delete) to role_permissions - Backend: UserService (780 lines) - CRUD with tenant isolation - Backend: UserController + UserRoutes (648 lines) - 13 API endpoints - Backend: Batch import users from Excel - Frontend: UserListPage (412 lines) - list/filter/search/pagination - Frontend: UserFormPage (341 lines) - create/edit with module config - Frontend: UserDetailPage (393 lines) - details/tenant/module management - Frontend: 3 modal components (592 lines) - import/assign/configure - API: GET/POST/PUT/DELETE /api/admin/users/* endpoints Architecture Upgrade - Module Permission System: - Backend: Add getUserModules() method in auth.service - Backend: Login API returns modules array in user object - Frontend: AuthContext adds hasModule() method - Frontend: Navigation filters modules based on user.modules - Frontend: RouteGuard checks requiredModule instead of requiredVersion - Frontend: Remove deprecated version-based permission system - UX: Only show accessible modules in navigation (clean UI) - UX: Smart redirect after login (avoid 403 for regular users) Fixes: - Fix UTF-8 encoding corruption in ~100 docs files - Fix pageSize type conversion in userService (String to Number) - Fix authUser undefined error in TopNavigation - Fix login redirect logic with role-based access check - Update Git commit guidelines v1.2 with UTF-8 safety rules Database Changes: - CREATE TABLE user_modules (user_id, tenant_id, module_code, is_enabled) - ADD UNIQUE CONSTRAINT (user_id, tenant_id, module_code) - INSERT 4 permissions + role assignments - UPDATE PUBLIC tenant with 8 module subscriptions Technical: - Backend: 5 new files (~2400 lines) - Frontend: 10 new files (~2500 lines) - Docs: 1 development record + 2 status updates + 1 guideline update - Total: ~4900 lines of code Status: User management 100% complete, module permission system operational
97 lines
3.0 KiB
PowerShell
97 lines
3.0 KiB
PowerShell
# Git Commit Script for IIT Manager Agent Day 1
|
|
# Encoding: UTF-8
|
|
|
|
cd D:\MyCursor\AIclinicalresearch
|
|
|
|
# Add all changes
|
|
git add .
|
|
|
|
# Commit with detailed message (English to avoid encoding issues)
|
|
git commit -m "feat(iit): Initialize IIT Manager Agent MVP - Day 1 foundation complete
|
|
|
|
Summary:
|
|
- Launch strategic new module: IIT Manager Agent (AI-driven IIT research assistant)
|
|
- Complete Day 1/14 MVP development: Database schema, module structure, and WeChat integration
|
|
|
|
Database Layer:
|
|
- Add iit_schema to Prisma with 5 tables (IitProject, IitPendingAction, IitTaskRun, IitUserMapping, IitAuditLog)
|
|
- Include V1.1 new fields: cachedRules, lastSyncAt, miniProgramOpenId
|
|
- Database sync successful (prisma db push)
|
|
- Prisma Client generated
|
|
- CRUD tests passed (all 5 tables verified)
|
|
|
|
Module Structure:
|
|
- Create backend/src/modules/iit-manager/ with 7 subdirectories
|
|
- Implement types/index.ts with 223 lines of TypeScript definitions
|
|
- Create routes/index.ts with health check endpoint (/api/v1/iit/health)
|
|
- Add test scripts: test-iit-database.ts (passed), test-wechat-push.ts (Access Token verified)
|
|
|
|
System Integration:
|
|
- Register IIT routes in backend/src/index.ts
|
|
- Add WeChat config to backend/src/config/env.ts (wechatCorpId, wechatCorpSecret, wechatAgentId)
|
|
- Health check endpoint working
|
|
|
|
WeChat Enterprise Integration:
|
|
- Successfully registered WeChat Enterprise app: IIT Manager Agent
|
|
- CorpID: ww6ab493470ab4f377, AgentID: 1000002
|
|
- Access Token retrieval successful (core verification passed)
|
|
- IP whitelist issue noted (does not affect development)
|
|
|
|
Documentation:
|
|
- Update system status doc (v2.3 -> v2.4, add IIT module overview)
|
|
- Create complete IIT Manager Agent doc structure (00-system-design, 02-tech-design, 04-dev-plan, 06-dev-log)
|
|
- Technical development plan V1.1 (2170 lines, architectural review corrections integrated)
|
|
- MVP development task list (615 lines, 14-day sprint plan)
|
|
- WeChat registration guide (209 lines)
|
|
|
|
Architecture Highlights (V1.1):
|
|
- Hybrid sync mode: Webhook + Polling (99.9% reliability)
|
|
- Postgres-Only architecture: Reuse platform cache and pg-boss queue
|
|
- Shadow state mechanism: PROPOSED -> APPROVED -> EXECUTED workflow
|
|
- Dify RAG integration: Protocol knowledge retrieval + rule pre-caching
|
|
- Frontend stack: Taro 4.x (React syntax, supports mini-program + H5)
|
|
|
|
Files Created:
|
|
- backend/prisma/schema.prisma (add iit_schema)
|
|
- backend/src/modules/iit-manager/* (complete module structure)
|
|
- backend/src/config/env.ts (add WeChat config)
|
|
- docs/03-业务模块/IIT Manager Agent/* (complete documentation)
|
|
- docs/00-系统总体设计/00-系统当前状态与开发指南.md (update to v2.4)
|
|
|
|
Testing Results:
|
|
- Database CRUD: All 5 tables passed
|
|
- System integration: Health check endpoint working
|
|
- WeChat API: Access Token retrieved successfully
|
|
|
|
Status: Day 1 complete (11/11 tasks, 100%), ready for Day 2 REDCap integration"
|
|
|
|
# Push to remote
|
|
git push origin master
|
|
|
|
Write-Host "Git commit and push completed!" -ForegroundColor Green
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|