Commit Graph

3 Commits

Author SHA1 Message Date
Misaka
a7da49ee6f Task 12: Create MaterialsToDeleteDAO with SQL injection protection
Implement MaterialsToDeleteDAO class with secure parameterized queries following
the pattern established in Task 11 (commit 5aafb23).

Features:
- getMaterialsToDeleteByManagers(): Query materials_to_delete table with
  optional filtering by manager_names using parameterized queries
- getAllMaterialsToDelete(): Wrapper to retrieve all materials without filtering

Security:
- Uses parameterized queries (@param0, @param1, etc.) to prevent SQL injection
- Parameters passed separately from query string via executeSQLServerQuery()
- Input validation for empty arrays
- Comprehensive test coverage including SQL injection attempt scenarios

Testing:
- 11 comprehensive unit tests covering all methods and edge cases
- Tests verify parameterized query pattern prevents SQL injection
- All tests passing (12/12 including existing tests)

Files:
- src/main/dao/materials-to-delete.dao.ts: DAO implementation
- tests/unit/dao/materials-to-delete.dao.test.ts: Unit tests

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-28 23:04:43 +08:00
Misaka
351c7857cb feat: implement database service with SQL Server and MySQL support
- Add database types (QueryResult, TransactionResult)
- Implement DatabaseService with connection management for SQL Server and MySQL
- Add query execution methods for both database types
- Include comprehensive error handling and logging
- Add unit test for error handling
- Configure Jest for testing

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-28 22:28:02 +08:00
Misaka
7704c0c067 feat: create project directory structure
- Create main process structure (services, dao, controllers, models, utils, config)
- Create preload script directory with .gitkeep
- Create renderer structure (pages, components, hooks, styles)
- Add placeholder App.tsx for React (to be implemented in later tasks)
- Create config, tests, logs directories
- Create data directories (temp, output, reports)
- Update .gitignore to exclude logs, data files, and environment configs

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-28 21:39:52 +08:00