feat: add friends!

This commit is contained in:
Radical 2025-07-10 15:37:38 +02:00
parent ac3e7e242b
commit e8b8b49643
13 changed files with 439 additions and 39 deletions

24
src/objects/friends.rs Normal file
View file

@ -0,0 +1,24 @@
use chrono::{DateTime, Utc};
use diesel::{Queryable, Selectable};
use serde::Serialize;
use uuid::Uuid;
use crate::schema::{friend_requests, friends};
#[derive(Serialize, Queryable, Selectable, Clone)]
#[diesel(table_name = friends)]
#[diesel(check_for_backend(diesel::pg::Pg))]
pub struct Friend {
pub uuid1: Uuid,
pub uuid2: Uuid,
pub accepted_at: DateTime<Utc>,
}
#[derive(Serialize, Queryable, Selectable, Clone)]
#[diesel(table_name = friend_requests)]
#[diesel(check_for_backend(diesel::pg::Pg))]
pub struct FriendRequest {
pub sender: Uuid,
pub receiver: Uuid,
pub requested_at: DateTime<Utc>,
}