Delete legacy code that used old company_ai_usage/job_seeker_ai_usage tables: - Remove has_active_ai_pack() - old AI_PACK pricing package check - Remove check_and_increment_usage() - legacy daily quota tracking - Remove BASE_AI_LIMIT, get_ai_limit_for_package constants/functions - Remove legacy queries from ai_auto_apply() and ai_usage_status() - Update auto_apply.rs to use user_ai_subscriptions.daily_actions_used instead of job_seeker_ai_usage table - Inline apply_scheduled_downgrades() and expire_trials() in cron tasks to remove dependency on users crate internal modules The new system uses user_ai_subscriptions with: - daily_actions_used / daily_credits_used counters - monthly_credits_total / monthly_credits_used - purchased_credits_total / purchased_credits_used All AI billing now flows through the wallet/ledger system with LiteLLM integration (Tasks 1-10). |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| Dockerfile | ||