feat: current bal field on users and corresponding API routes
This commit is contained in:
parent
5d4ece3c34
commit
9bbdb9decb
5 changed files with 78 additions and 3 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Reference in a new issue