Add multi-database support allowing selection between SQL Server and
PostgreSQL via database.active config. Changes include dialect-aware
SQL generation, cross-database timestamp functions, PostgreSQL connection
URL builder, and psycopg dependency.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Migrate FastAPI configuration from environment files (.env) to YAML
using pydantic-yaml library for better readability and maintainability.
Changes:
- Add pydantic-yaml dependency
- Create config/ module with Settings, SqlServerConfig classes
- Add config/settings.yaml for database configuration
- Update all imports from app.core.config to config.settings
- Add error handling for config loading on startup
- Remove old .env and app/core/config.py
- Update README with YAML configuration documentation
- Add test coverage for config loading
Test results:
- All 15 tests passing
- 88% code coverage maintained
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove deprecated app/core/config.py as configuration is now managed
through the new YAML-based config module (app/config/).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add error handling for configuration loading at application startup.
If the config file is missing or invalid, the app will exit with
a clear error message instead of crashing later.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Ensure config/settings.yaml can be found when running from any working
directory by resolving the path relative to the settings.py file location
rather than the current working directory.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update import statement from app.core.config to config.settings as part
of YAML configuration migration.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add test_config.py with tests for load_settings function
- Add test_config.yaml fixture with test database configuration
- Tests cover: successful loading, file not found error, database URL generation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Created config directory with settings.py, __init__.py, and settings.yaml
- Implemented SqlServerConfig and DatabaseConfig classes for SQL Server connections
- Added Settings class with database_url property for SQLAlchemy URL construction
- Uses parse_yaml_raw_as for UTF-8 safe YAML loading on Windows
- Configuration validated successfully via import test
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add detailed step-by-step implementation plan for migrating
from .env to YAML configuration using pydantic-yaml.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add design document for migrating from .env to YAML configuration
using pydantic-yaml.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add box schemas (BoxInfoResponse, BoxSaveRequest, BoxSaveResponse)
- Add box service with ERP view query and save logic (supports many2one append)
- Add box router with GET /box/info and POST /box endpoints
- Register exception handlers for InvalidZongpaiError, ZongpaiNotFoundError, DuplicateBoxItemError
- Update RequestValidationError handler to cover INVALID_BOX_NO and INVALID_QUANTITY
- Add 7 integration tests for box API
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>