feat: implement provider credit tracking and balance management
- Added 'credit_balance' and 'low_credit_threshold' to 'provider_configs' table. - Updated dashboard backend to support reading and updating provider credits. - Implemented real-time credit deduction from provider balances on successful requests. - Added visual balance indicators and configuration modal to the 'Providers' dashboard tab.
This commit is contained in:
@@ -87,6 +87,8 @@ async fn run_migrations(pool: &DbPool) -> Result<()> {
|
||||
enabled BOOLEAN DEFAULT TRUE,
|
||||
base_url TEXT,
|
||||
api_key TEXT,
|
||||
credit_balance REAL DEFAULT 0.0,
|
||||
low_credit_threshold REAL DEFAULT 5.0,
|
||||
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
||||
)
|
||||
"#
|
||||
|
||||
Reference in New Issue
Block a user