feat: current bal field on users and corresponding API routes

This commit is contained in:
Ninjdai 2025-08-09 02:11:07 +02:00
parent 5d4ece3c34
commit 9bbdb9decb
5 changed files with 78 additions and 3 deletions

View file

@ -15,6 +15,12 @@ pub struct Model {
pub enum Relation {
#[sea_orm(has_many = "super::book_instance::Entity")]
BookInstance,
#[sea_orm(
belongs_to = "super::user::Entity",
from = "Column::Id",
to = "super::user::Column::CurrentBalId"
)]
User,
}
impl Related<super::book_instance::Entity> for Entity {

View file

@ -10,6 +10,7 @@ pub struct Model {
#[sea_orm(unique)]
pub username: String,
pub hashed_password: String,
pub current_bal_id: Option<u32>,
}
impl Model {