use serde::{Deserialize, Serialize};
use mongodb::bson::{oid::ObjectId, DateTime};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RefreshToken {
    #[serde(rename = "_id", skip_serializing_if = "Option::is_none")]
    pub id: Option<ObjectId>,
    #[serde(rename = "tokenId")]
    pub token_id: String,
    #[serde(rename = "userId")]
    pub user_id: String,
    #[serde(rename = "tokenHash")]
    pub token_hash: String,
    #[serde(rename = "expiresAt")]
    pub expires_at: DateTime,
    #[serde(rename = "createdAt")]
    pub created_at: DateTime,
    #[serde(rename = "revoked")]
    pub revoked: bool,
    #[serde(rename = "revokedAt")]
    pub revoked_at: Option<DateTime>,
}
