Commit Graph

89 Commits

Author SHA1 Message Date
Misaka
180f4aab0a docs: add developer guides 2026-03-21 20:48:09 +08:00
Misaka
31a32db899 docs: add module handbook index 2026-03-21 20:39:28 +08:00
Misaka
14e7abe11e docs: add developer module guides 2026-03-21 20:37:50 +08:00
Misaka
57ca1d5650 docs: add developer architecture handbook 2026-03-21 20:25:45 +08:00
Misaka
f40512449a docs: add developer docs index 2026-03-21 20:10:50 +08:00
Misaka
957cfbda46 docs: add react optimization plan 2026-03-21 18:40:55 +08:00
Misaka
325e6fcc89 docs: add electron optimization plan 2026-03-21 10:28:11 +08:00
Misaka
0e77479955 style: format codebase files 2026-03-21 09:34:44 +08:00
Misaka
08bd2cb7d5 docs: add refactor overview documents 2026-03-21 09:07:13 +08:00
Misaka
63ff32817e docs: add 1.4.1 release notes 2026-03-20 23:29:55 +08:00
Misaka
4add295e44 docs: add 1.4.0 release notes 2026-03-20 23:22:45 +08:00
Misaka
c8ce67dc75 docs: update agent and release guides 2026-03-20 23:15:41 +08:00
Misaka
2216720e24 docs: refine browser deployment docs 2026-03-20 21:47:55 +08:00
Misaka
36304b88e1 docs: add portable update architecture guide 2026-03-20 21:31:52 +08:00
Misaka
6ad9463e73 feat: rebuild portable auto-update flow 2026-03-20 21:20:28 +08:00
Misaka_Company
29f29f6a9e feat(cleaner): expand protected row number range to 2000-7999
Change the protected row number range from 7000-7999 to 2000-7999 to prevent deletion of materials in this broader range.

- Updated isMaterialDeletable() method logic
- Updated getSkipReason() error messages
- Updated test cases to reflect new range boundaries
- Updated documentation templates and error collection guide

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 13:14:09 +08:00
test
975bee6ce8 docs(cleaner): add comprehensive order error collection analysis
Add complete technical documentation for the material cleaning module's order error collection mechanism, including:
- System architecture and error collection flow diagrams
- Complete checklist of 52 error points across all layers
- Multi-layer error handling (IPC/service/retry layers)
- Frontend error display flow
- Retry mechanism and audit trail

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 22:30:45 +08:00
test
8e0c37bf74 feat: add ERP login debug tool with documentation
Add interactive debugging tool for ERP login flow analysis:
- Add tsx dependency for TypeScript script execution
- Add npm scripts: debug:erp-login and debug:config-path
- Add erp-login-debug.ts with automated login and element inspection
- Add comprehensive usage guide and quick reference documentation

The debug tool automates ERP login and provides pause points for
manual element inspection using browser DevTools or Playwright Inspector.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-07 13:16:43 +08:00
test
c13be9e19a refactor: migrate configuration to YAML-based system 2026-03-07 11:30:09 +08:00
Misaka
5977254180 feat: migrate ERP configuration from .env to per-user database storage
- Moved ERP credentials (URL, username, password) from environment variables to dbo_BIPUsers table
- Each user now has their own ERP configuration stored in the database
- Added UserErpConfigService for managing per-user ERP settings
- Updated cleaner and extractor handlers to fetch ERP config from database instead of .env
- Removed ERP fields from ConfigManager UI editable fields
- Added new IPC handlers and preload APIs for user ERP config management
- Includes migration script to transfer existing .env ERP settings to database
- Added migration guide documentation

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-05 21:52:54 +08:00
Misaka_Company
224a42e44b docs: update cleaner execution report error details section 2026-03-05 15:07:17 +08:00
Misaka_Company
121d49bfe8 docs: add configuration system architecture analysis 2026-03-05 10:55:15 +08:00
Misaka_Company
974eaac6dd docs: update extractor-start-button-flow.md to v1.3
- Add file merging functionality (ExcelParser merges batch files)
- Add database auto-import feature (DataImportService)
- Update architecture diagrams to include ExtractorCore separation
- Update sequence diagram with 76-step workflow
- Add DataImportService and DiscreteMaterialPlanDAO to flow
- Document ImportResult type and import statistics
- Update error handling to include merge and import errors
- Add temporary file cleanup after merging
2026-03-04 17:01:50 +08:00
Misaka_Company
8dbdf6f394 docs: move IMPLEMENTATION_PLAN.md to docs/plans directory
Co-Authored-By: Claude (glm-5) <noreply@anthropic.com>
2026-03-04 14:27:01 +08:00
Misaka
e23cf71f78 feat: add material type management feature
- Add MaterialTypeManagementDialog component for managing material type keywords
- Add MaterialsTypeToBeDeletedDAO for database operations
- Add material-type-handler IPC handlers
- Update CleanerPage with type management button
- Add database fix scripts for AUTO_INCREMENT
- Update documentation for settings partial save and validation flow

Co-Authored-By: Claude (glm-5) <noreply@anthropic.com>
2026-03-03 22:51:11 +08:00
Misaka
00b120c762 docs: update extractor-start-button-flow.md for database architecture changes
- Update version to 1.2
- Add database factory pattern documentation
- Add IDatabaseService interface documentation
- Update architecture diagram with Database Layer (MySQL/SQL Server)
- Update sequence diagram with DatabaseFactory and IDatabaseService
- Fix Mermaid syntax (replace <br/> with multiline strings)
- Update error handling flowchart for dual database support
- Add DB_TYPE environment variable documentation

Co-Authored-By: Claude (glm-5) <noreply@anthropic.com>
2026-03-03 20:55:56 +08:00
Misaka
6698d82d6b docs: update extractor-start-button-flow.md to match current implementation
- Update version to 1.1 with new related files list
- Fix sequence diagram step numbers and add IPC serialization note
- Add note about progress state not receiving backend updates
- Add code references for real-time sync useEffect and preload API
- Update summary with custom error types and sessionStorage details
- Add new section for known limitations and pending features
- Document progress update and file merge as unimplemented

Co-Authored-By: Claude (glm-5) <noreply@anthropic.com>
2026-03-03 19:01:48 +08:00
Misaka_Company
73a49f9de3 docs: add settings partial save feature documentation
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-03 15:12:39 +08:00
Misaka_Company
429357ae8c docs: add implementation plan for settings partial save feature
- 8 detailed tasks with step-by-step instructions
- TDD approach with failing tests first
- Complete code snippets provided
- Manual testing procedures included
- Estimated 2-3 hours implementation time
2026-03-03 12:25:59 +08:00
Misaka_Company
79934a58d0 docs: add settings partial save design document
- Problem: Settings page overwrites unmodified .env fields
- Solution: Deep merge + whitelist validation approach
- Added backup mechanism for safe rollback
- Designed extensible whitelist for future UI expansion
2026-03-03 12:24:27 +08:00
Misaka_Company
6ecf03ce11 fix: scope User operations to visible data only in CleanerPage
Fix critical bug where non-Admin users could affect other users' data
when using "取消" (Uncheck All) and "确认删除" (Confirm Deletion) buttons.

Problem:
- User users see only their filtered materials in table (filteredResults)
- "取消" button was unchecking ALL materials in validationResults
- "确认删除" was processing ALL materials, not just visible ones
- This caused User A to delete/modify User B's invisible data

Solution:
1. Modified "取消" button to only uncheck visible filteredResults
   - Now removes selectedItems only for visible material codes
   - Preserves selections for other users' invisible data

2. Modified handleConfirmDeletion to process only visible items for non-Admin users
   - Admin: processes all validationResults (unchanged behavior)
   - User: processes only filteredResults (scoped to their data)

Security Impact:
- Prevents cross-user data interference
- Ensures User scope isolation
- Maintains Admin full access to all data

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-03 11:13:39 +08:00
Misaka_Company
77311edce0 feat: add user override match for material validation in cleaner page
Add Priority 3 matching logic that allows User type users to override
material assignments with their own typeKeywords from MaterialsTypeToBeDeleted.

Changes:
- Add session manager integration to get current user context
- Implement Priority 3: User Override Match (only for non-admin users)
- Filter typeKeywords by current username and force override on match
- Maintain existing Priority 1 (exact match) and Priority 2 (type match) behavior
- Admin users bypass override logic and see original matching results
- Update cleaner-validation-flow.md with new matching algorithm flow

This ensures User users see materials assigned to themselves first when
their configured typeKeywords match, while Admin users maintain full visibility.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-03 10:45:25 +08:00
Misaka_Company
edf696ab39 docs: fix Mermaid syntax error in settings save flow diagram
Replace pipe character in dbType union notation with 'or' to resolve Mermaid parse error.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-03 09:11:35 +08:00
Misaka_Company
6ec422f357 docs: add UI flow analysis documentation and update gitignore
Add documentation for extractor start button and settings save button flows with detailed Mermaid diagrams. Also add logs directory to gitignore.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-03 09:06:33 +08:00
Misaka
a05c8a9037 feat: add TypeORM, logger, schemas, hooks and stores
- Add TypeORM integration with data-source, entities and repositories
- Add logger service for structured logging
- Add Zod validation schemas for auth, cleaner and extractor
- Add custom React hooks (useAuth, useCleaner, useExtractor, useValidation)
- Add Zustand stores (useAppStore, useUserStore)
- Add UI components (Button, Modal, Toast)
- Add error types and ErpBrowserManager
- Refactor IPC handlers and services
- Add unit tests for new modules

Co-Authored-By: Claude (glm-5) <noreply@anthropic.com>
2026-03-02 23:10:15 +08:00
Misaka_Company
11aec6d238 docs: fix Mermaid diagram syntax in deleteByMaterialCodes flow
- Remove problematic edge labels with special characters
- Move database type identifiers into node labels
- Replace ellipsis with clearer text descriptions
- Fix parse error caused by spaces and special chars in edge labels

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-02 13:17:38 +08:00
Misaka_Company
9fbf75a8a0 docs: add confirm deletion button flow analysis to cleaner validation docs
Add comprehensive documentation for the "确认删除 (同步数据库)" button
flow, including:

- Core flow overview with Mermaid diagram
- Frontend interaction layer analysis (handleConfirmDeletion)
- IPC handler layer details (upsertBatch, delete handlers)
- Database DAO layer implementation with MySQL vs SQL Server differences
- Data flow diagram showing all layers
- Key data structures and error handling
- Comparison table with validation status flow

The document now covers both core business flows in the cleaner page:
1. Get and validate material status (read operation)
2. Confirm deletion/sync to database (write operation)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-02 12:49:31 +08:00
Misaka_Company
10e07cdf93 docs: add cleaner validation flow analysis with Mermaid diagrams
Add comprehensive technical documentation for the cleaner page
"get validation status" functionality, including:
- Complete flow analysis from UI click to database queries
- Mermaid flowcharts and sequence diagrams
- Material matching algorithm (priority-based)
- Database interaction details (MySQL/SQL Server)
- IPC handler logic
- Shared Production IDs mechanism

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-02 12:29:53 +08:00
Misaka
e794470d69 docs: add comprehensive user documentation
- Add README.md with installation, configuration, and usage guide
- Add docs/USER_GUIDE.md with detailed step-by-step workflows
- Include database setup scripts for MySQL and SQL Server
- Add troubleshooting section with common issues
2026-03-01 15:57:07 +08:00