mirror of
https://github.com/Xe138/AI-Trader.git
synced 2026-04-01 17:17:24 -04:00
Remove job_id filter from get_starting_holdings() SQL JOIN to enable holdings continuity across jobs. This completes the cross-job portfolio continuity fix started in the previous commit. Root cause: get_starting_holdings() joined on job_id, preventing it from finding previous day's holdings when queried from a different job. This caused starting_position.holdings to be empty in API results for new jobs even though starting_cash was correctly retrieved. Changes: - api/database.py: Remove job_id from JOIN condition in get_starting_holdings() - tests/unit/test_database_helpers.py: Add test for cross-job holdings retrieval Together with the previous commit fixing get_previous_trading_day(), this ensures complete portfolio continuity (both cash and holdings) across jobs.
24 KiB
24 KiB