Add repository commands for handling votes

This commit is contained in:
Alex Selimov 2026-03-19 10:05:38 -04:00
parent 4b16f39b4d
commit 40331451ca
9 changed files with 647 additions and 4 deletions

View file

@ -1 +1,18 @@
pub struct Vote {}
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,
}