Commit Graph

17 Commits

Author SHA1 Message Date
Misaka_Company
da567a2679 feat(extractor): Add DiscreteMaterialPlanExtractor class for batch data extraction
- Create DiscreteMaterialPlanExtractor class orchestrating web operations and post-processing
- Implement extract_and_process() combining download + Excel conversion
- Implement post_process_downloads() using ExcelConverter for merge
- Add extract_from_file() convenience function for file-based ID input
- Add component test file verifying class structure and methods
- Follow existing patterns: verbose logging, explicit parameters, English comments
2026-03-27 13:48:07 +08:00
Misaka_Company
bbf335c376 fix: add missing ERP_AUTO_CLOSE_BROWSER to .env.example
- Document ERP_AUTO_CLOSE_BROWSER environment variable
- This variable is used in test scripts to control browser auto-close behavior
- Ensures template is complete with all used variables

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 12:53:50 +08:00
Misaka_Company
6a8500133b docs: add .env.example template
- Provide template for required environment variables
- Document all configuration options
- Help users set up their local environment

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 12:52:43 +08:00
Misaka_Company
8d59fc6ef8 fix: correct login() return value documentation in CLAUDE.md
- Fix return value from 2-tuple to 4-tuple (browser, context, page, main_frame)
- Correct function signature to match actual implementation
- Documentation now matches the actual API

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 12:50:44 +08:00
Misaka_Company
f0d21e62c9 docs: update CLAUDE.md for refactored auth module
- Clarify that auth module is pure with no environment access
- Document URL construction pattern for callers
- Update module structure documentation
- Emphasize caller responsibility for configuration

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 12:49:27 +08:00
Misaka_Company
8048f2e669 fix: add null safety check to URL construction in test_login.py
- Add explicit check for ERP_URL environment variable
- Prevent AttributeError when ERP_URL is not set
- Provide clear error message for missing configuration

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 12:47:10 +08:00
Misaka_Company
fa33bee3e1 refactor: update test_login.py to use new auth API
- Import only login and logout (remove close_session)
- Add explicit URL construction before login call
- Pass all required parameters to login()
- Replace close_session() with direct context.close() and browser.close()

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 12:45:56 +08:00
Misaka_Company
acc4664409 refactor: remove close_session() function
- Remove close_session() wrapper function entirely
- Callers now directly manage browser/context lifecycle
- Reduces module to pure authentication functions only

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 12:45:04 +08:00
Misaka_Company
38aa122f9b fix: improve parameter validation to reject whitespace-only strings
- Add .strip() check to username, password, url validation
- Update error messages to clarify whitespace rejection
- Prevents bugs where whitespace-only strings pass validation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 12:44:17 +08:00
Misaka_Company
eb9ed0b606 refactor: remove environment variable reading from login()
- Remove all os.getenv() calls from login() function
- Remove URL construction logic (caller provides complete URL)
- Add parameter validation with clear error messages
- Function is now pure with no side effects

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 12:25:46 +08:00
Misaka_Company
9fe6cfe8e1 refactor: update login() signature to require all parameters
- Remove default values for username, password, url, headless, ignore_https_errors
- Update docstring to reflect required parameters
- Maintain backward compatibility with 4-tuple return value

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 12:24:57 +08:00
Misaka_Company
0af2c85abe refactor: remove environment variable imports from auth module
- Remove os, dotenv, and pathlib imports
- Remove module-level environment setup code
- Prepare for pure function implementation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 12:24:04 +08:00
Misaka_Company
ce5be18dd7 Add auth module refactoring implementation plan
- Create detailed step-by-step implementation plan
- 9 tasks covering all refactoring aspects
- TDD approach with explicit verification steps
- Include test updates and documentation changes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 12:22:54 +08:00
Misaka_Company
cd851b5170 Add auth module refactoring design document
- Document decoupling approach for utils/auth.py
- Remove all environment variable dependencies
- Make login() a pure function with required parameters
- Remove close_session() function
- Provide migration guide for test scripts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 12:22:20 +08:00
Misaka_Company
a05a4c2ba3 Add CLAUDE.md with project documentation and test coverage requirement
- Document project overview and architecture
- Add development environment setup instructions
- Specify environment configuration requirements
- Document module structure and page interaction patterns
- Add common commands for testing
- Establish code conventions including mandatory test coverage for new components

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 11:15:40 +08:00
Misaka_Company
90e38821a5 Add Yonyou BIP automation framework with authentication
Features:
- Add auth module (utils/auth.py) for Yonyou BIP login/logout
- Add environment configuration support with python-dotenv
- Add Playwright browser automation with customizable path
- Add comprehensive test suite (tests/) with login/logout tests
- Add dependency management (requirements.txt)
- Add environment variable template (.env.example)

Key capabilities:
- Login with username/password from environment variables
- Auto-handle force login popup
- Logout with confirmation dialog handling
- Configurable headless mode and HTTPS error handling
- Auto-close browser option

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 11:11:15 +08:00
Misaka_Company
492c98d4cc Initial commit: Add .gitignore for Python project
Configured standard Python .gitignore with patterns for virtual environments, compiled files, packages, testing, IDEs, and AI agent directories.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 09:20:58 +08:00