use serde::{Deserialize, Serialize};
#[derive(Deserialize, Debug)]
pub struct TargetResponse {
pub data: Vec<Target>,
}
#[derive(Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct Target {
pub description: String,
pub blogger_id: i64,
pub priority: u32,
pub created_at: i64,
pub id: u64,
pub target_sum: f64,
pub current_sum: f64,
pub finish_time: Option<i64>,
pub blogger_url: String,
#[serde(rename = "type")]
pub type_: TargetType,
}
#[derive(Serialize, Debug)]
pub struct NewTarget {
pub blog_url: String,
pub description: String,
pub target_sum: f64,
}
#[derive(Serialize, Debug)]
pub struct UpdateTarget {
pub target_id: u64,
pub description: String,
pub target_sum: f64,
}
#[derive(Deserialize, Debug)]
#[serde(rename_all = "lowercase")]
pub enum TargetType {
Money,
Subscribers,
}