use rocket::serde::{Deserialize, Serialize};
use chrono::{DateTime, Utc};

#[derive(Serialize, Deserialize)]
pub struct SignupCredentials {
    pub email: String,
    pub username: String,
    pub password: String,
    pub access_token: String,
}

#[derive(Serialize, Deserialize)]
pub struct LoginCredentials {
    pub username: String,
    pub password: String,
}

#[derive(Serialize, Deserialize)]
pub struct AuthResponse {
    pub token: String,
    pub totp_required: bool,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AccessTokenForm {
    pub name: String,
    pub max_uses: i32,
    pub expiry_date: DateTime<Utc>,
    pub start_date: DateTime<Utc>,
}

pub struct AccessToken {
    pub id: i64,
    pub code: String,
}