feat: bal state
All checks were successful
/ test (push) Successful in 16m18s

This commit is contained in:
Ninjdai 2025-08-11 11:15:27 +02:00
parent 2facdcb2ea
commit c667608fbb
7 changed files with 109 additions and 101 deletions

View file

@ -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")]

View file

@ -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 {