Spaces:
Sleeping
Sleeping
| use serde::{Deserialize, Serialize}; | |
| pub struct DailyMetric { | |
| pub day: String, | |
| pub revenue: f64, | |
| pub order_count: i64, | |
| pub high_risk_count: i64, | |
| pub risk_weighted_volume: f64, | |
| } | |
| pub struct RiskDistribution { | |
| pub low: i64, | |
| pub medium: i64, | |
| pub high: i64, | |
| pub critical: i64, | |
| } | |
| pub struct RegionalMetric { | |
| pub pincode_prefix: String, | |
| pub order_count: i64, | |
| pub total_revenue: f64, | |
| pub avg_distance: f64, | |
| } | |
| pub struct AnalyticsResponse { | |
| pub daily_metrics: Vec<DailyMetric>, | |
| pub total_revenue: f64, | |
| pub total_orders: i64, | |
| pub risk_mitigation_count: i64, | |
| pub risk_distribution: RiskDistribution, | |
| pub abandoned_cart_rate: f64, | |
| pub average_order_value: f64, | |
| pub platform_fee_total: f64, | |
| pub avg_distance: f64, | |
| pub total_views: i64, | |
| pub conversion_rate: f64, | |
| pub regional_metrics: Vec<RegionalMetric>, | |
| pub plan: String, | |
| } | |
| pub struct RiskForensic { | |
| pub factor: String, | |
| pub score_contribution: f64, | |
| pub description: String, | |
| pub severity: String, | |
| } | |
| pub struct OrderForensics { | |
| pub transaction_id: String, | |
| pub overall_risk_score: f64, | |
| pub factors: Vec<RiskForensic>, | |
| pub timestamp: String, | |
| pub status: String, | |
| pub device_fingerprint: Option<String>, | |
| } | |