mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-10 03:09:50 +08:00
style: format wallet fallback reporting and postgres test
This commit is contained in:
@@ -11,8 +11,7 @@ pub(crate) use aether_usage_runtime::{
|
||||
};
|
||||
pub(crate) use aether_usage_runtime::{UsageQueueHealthSnapshot, UsageRuntimeMetricsSnapshot};
|
||||
pub(crate) use reporting::{
|
||||
attach_plan_wallet_fallback_context,
|
||||
attach_internal_gateway_report_capability, resolve_bound_internal_gateway_report_context,
|
||||
spawn_sync_report, submit_stream_report, submit_sync_report, GatewayStreamReportRequest,
|
||||
GatewaySyncReportRequest,
|
||||
attach_internal_gateway_report_capability, attach_plan_wallet_fallback_context,
|
||||
resolve_bound_internal_gateway_report_context, spawn_sync_report, submit_stream_report,
|
||||
submit_sync_report, GatewayStreamReportRequest, GatewaySyncReportRequest,
|
||||
};
|
||||
|
||||
@@ -15,8 +15,8 @@ use crate::{AppState, GatewayError};
|
||||
mod context;
|
||||
pub(crate) mod failure;
|
||||
pub(crate) use context::{
|
||||
attach_plan_wallet_fallback_context,
|
||||
attach_internal_gateway_report_capability, resolve_bound_internal_gateway_report_context,
|
||||
attach_internal_gateway_report_capability, attach_plan_wallet_fallback_context,
|
||||
resolve_bound_internal_gateway_report_context,
|
||||
};
|
||||
use context::{report_context_is_locally_actionable, resolve_locally_actionable_report_context};
|
||||
|
||||
|
||||
@@ -665,8 +665,13 @@ async fn live_overview_settlement_allocations_preserve_unlimited_and_finite_wall
|
||||
_ => 0.0,
|
||||
};
|
||||
if quota > 0.0 {
|
||||
sqlx::query("INSERT INTO user_preferences(id,user_id,allow_wallet_overage) VALUES($1,$1,true)")
|
||||
.bind(&user).execute(&pool).await.unwrap();
|
||||
sqlx::query(
|
||||
"INSERT INTO user_preferences(id,user_id,allow_wallet_overage) VALUES($1,$1,true)",
|
||||
)
|
||||
.bind(&user)
|
||||
.execute(&pool)
|
||||
.await
|
||||
.unwrap();
|
||||
let grant = serde_json::json!([{"type":"daily_quota","daily_quota_usd":quota,"reset_timezone":"UTC","allow_wallet_overage":true}]);
|
||||
sqlx::query("INSERT INTO billing_plans(id,title,price_amount,duration_unit,duration_value,entitlements_json,created_at,updated_at) VALUES($1,'test',1,'month',1,$2,NOW(),NOW())").bind(&user).bind(&grant).execute(&pool).await.unwrap();
|
||||
sqlx::query("INSERT INTO payment_orders(id,order_no,wallet_id,user_id,amount_usd,payment_method,created_at) VALUES($1,$1,$2,$1,1,'test',NOW())").bind(&user).bind(&wallet).execute(&pool).await.unwrap();
|
||||
|
||||
Reference in New Issue
Block a user