2026-03-19 10:05:38 -04:00
|
|
|
use chrono::{DateTime, Utc};
|
|
|
|
|
use sqlx::prelude::FromRow;
|
|
|
|
|
use uuid::Uuid;
|
|
|
|
|
|
|
|
|
|
/// Struct representing a single vote (row) in the votes table
|
|
|
|
|
#[derive(Debug, FromRow)]
|
|
|
|
|
pub struct Vote {
|
|
|
|
|
pub slug: String,
|
|
|
|
|
pub voter_id: Uuid,
|
|
|
|
|
pub created_at: DateTime<Utc>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Struct representing the best slug posts
|
|
|
|
|
#[derive(Debug, FromRow)]
|
|
|
|
|
pub struct BestSlugs {
|
|
|
|
|
pub slug: String,
|
|
|
|
|
pub vote_count: i64,
|
|
|
|
|
}
|