use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use utoipa::ToSchema;
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
#[schema(example = json!({
"src_cortical_area": "v1",
"dst_cortical_area": "v2",
"mapping_type": "one_to_many",
"mapping_data": {
"type": "topological",
"parameters": {}
}
}))]
pub struct MappingInfo {
pub src_cortical_area: String,
pub dst_cortical_area: String,
pub mapping_type: String,
pub mapping_data: serde_json::Value,
}
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
pub struct CreateMappingRequest {
pub src_cortical_area: String,
pub dst_cortical_area: String,
pub mapping_type: String,
#[serde(default)]
pub mapping_data: Option<serde_json::Value>,
}
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
pub struct MappingListResponse {
pub mappings: Vec<MappingInfo>,
pub total_count: usize,
}
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
#[schema(example = json!({
"cortical_area_id": "v1",
"total_synapses": 1000000,
"active_synapses": 45000,
"inactive_synapses": 955000,
"total_neurons": 10000
}))]
pub struct SynapseStats {
pub cortical_area_id: String,
pub total_synapses: usize,
pub active_synapses: usize,
pub inactive_synapses: usize,
pub total_neurons: usize,
}
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
pub struct ConnectomeStatsResponse {
pub total_cortical_areas: usize,
pub total_mappings: usize,
pub total_synapses: usize,
pub per_area_stats: HashMap<String, SynapseStats>,
}