refactor: extract PSA_Cost_Reporter from PSA_Cost_Tracker (337→171+136)

Monthly spend/token/estimate-count queries and recent-logs retrieval
moved to PSA_Cost_Reporter. Tracker retains table management, logging,
budget enforcement, and cost estimation. Shared month_range helper
in reporter eliminates duplicated date-range logic.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
peptiderepo
2026-04-17 02:44:33 +07:00
parent e8adce77e9
commit 33a1133cf4
3 changed files with 195 additions and 224 deletions

View File

@@ -26,6 +26,7 @@ require_once PSA_PLUGIN_DIR . 'includes/class-psa-post-type.php';
require_once PSA_PLUGIN_DIR . 'includes/class-psa-post-type-meta.php';
require_once PSA_PLUGIN_DIR . 'includes/class-psa-search-handler.php';
require_once PSA_PLUGIN_DIR . 'includes/class-psa-search.php';
require_once PSA_PLUGIN_DIR . 'includes/class-psa-cost-reporter.php';
require_once PSA_PLUGIN_DIR . 'includes/class-psa-cost-tracker.php';
require_once PSA_PLUGIN_DIR . 'includes/class-psa-openrouter.php';
require_once PSA_PLUGIN_DIR . 'includes/class-psa-kb-builder.php';