use chrono::DateTime;
use chrono::Utc;
use r2d2_sqlite::SqliteConnectionManager;
use typemap::Key;
#[derive(Debug, Clone)]
pub struct User {
pub id: i64,
pub first_name: String,
pub last_name: Option<String>,
pub username: Option<String>,
}
#[derive(Debug)]
pub struct Channel {
pub id: i64,
pub registered_by: i64,
pub link: String,
pub name: String,
}
#[derive(Debug)]
pub struct BeingManagedChannel {
pub chan: i64,
}
#[derive(Debug)]
pub struct Invite {
pub id: i64,
pub date: DateTime<Utc>,
pub source: i64,
pub dest: i64,
pub chan: i64,
}
#[derive(Debug)]
pub struct Contest {
pub id: i64,
pub name: String,
pub prize: String,
pub end: DateTime<Utc>,
pub started_at: Option<DateTime<Utc>>,
pub stopped: bool,
pub chan: i64,
}
#[derive(Debug)]
pub struct RankContest {
pub rank: i64,
pub c: Contest,
}
#[derive(Debug, Clone)]
pub struct Rank {
pub rank: i64,
pub invites: i64,
pub user: User,
}
pub struct DBKey;
impl Key for DBKey {
type Value = r2d2::Pool<SqliteConnectionManager>;
}
pub struct NameKey;
impl Key for NameKey {
type Value = String;
}