use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Serialize, Deserialize)]
#[cfg_attr(feature = "sqlx", derive(sqlx::FromRow))]
pub struct LeaderboardRow {
pub user_id: i64,
pub scores: Vec<i32>,
pub total_score: i64,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct ContestRequest {
pub name_ru: String,
pub name_en: String,
pub starts_at: DateTime<Utc>,
pub ends_at: DateTime<Utc>,
pub statements_url_ru: String,
pub editorial_url_ru: String,
pub statements_url_en: String,
pub editorial_url_en: String,
pub hidden: bool,
pub upsolving_opened: bool,
pub hide_solutions: bool,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct PublicContestConfig {
pub id: i64,
pub owner_id: Option<i64>,
pub name_ru: String,
pub name_en: String,
pub statements_url_ru: String,
pub editorial_url_ru: String,
pub statements_url_en: String,
pub editorial_url_en: String,
pub starts_at: DateTime<Utc>,
pub ends_at: DateTime<Utc>,
pub hidden: bool,
pub upsolving_opened: bool,
pub hide_solutions: bool,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct ContestPostRequest {
pub title: String,
pub text: String,
pub created_at: DateTime<Utc>,
}
#[derive(Deserialize, Serialize, Clone, Debug)]
#[cfg_attr(feature = "sqlx", derive(sqlx::FromRow))]
pub struct ContestPost {
pub id: i64,
pub owner_id: i64,
pub contest_id: i64,
pub title: String,
pub text: String,
pub created_at: DateTime<Utc>,
}