use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct InputRecord {
pub id: String,
#[serde(default)]
pub text: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EmbeddedTextInput {
pub id: String,
#[serde(default)]
pub text: Option<String>,
pub embedding: Vec<f32>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EmbeddedText {
pub id: String,
#[serde(default)]
pub text: Option<String>,
pub embedding: Vec<f32>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CandidateRoundVotes {
pub id: String,
pub first_votes: u32,
pub second_votes: u32,
pub third_votes: u32,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CandidateBestResult {
pub id: String,
pub full_round_index: usize,
pub active_candidates: usize,
pub rank: usize,
pub first_votes: u32,
pub second_votes: u32,
pub third_votes: u32,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RoundSummary {
pub round_index: usize,
pub active_candidates: usize,
pub eliminated_candidate_ids: Vec<String>,
pub votes: Vec<CandidateRoundVotes>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ElectionResult {
pub winner_id: String,
pub representative_ids: Vec<String>,
pub all_ranked_ids: Vec<String>,
pub rounds: Vec<RoundSummary>,
pub candidate_best_results: Vec<CandidateBestResult>,
pub embeddings: Vec<EmbeddedText>,
}