This commit is contained in:
parent
2facdcb2ea
commit
c667608fbb
7 changed files with 109 additions and 101 deletions
|
|
@ -9,10 +9,22 @@ pub struct Model {
|
|||
pub id: u32,
|
||||
pub user_id: u32,
|
||||
pub name: String,
|
||||
pub state: BalState,
|
||||
pub start_timestamp: i64,
|
||||
pub end_timestamp: i64
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize, utoipa::ToSchema)]
|
||||
#[sea_orm(rs_type = "String", db_type = "String(StringLen::N(1))")]
|
||||
pub enum BalState {
|
||||
#[sea_orm(string_value = "P")]
|
||||
Pending,
|
||||
#[sea_orm(string_value = "O")]
|
||||
Ongoing,
|
||||
#[sea_orm(string_value = "E")]
|
||||
Ended
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {
|
||||
#[sea_orm(has_many = "super::book_instance::Entity")]
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ pub struct Model {
|
|||
pub username: String,
|
||||
pub hashed_password: String,
|
||||
pub owner_id: Option<u32>,
|
||||
pub current_bal_id: Option<u32>,
|
||||
}
|
||||
|
||||
impl Model {
|
||||
|
|
|
|||
Reference in a new issue