feat: replace book instance status with available boolean
This commit is contained in:
parent
7c7bda5f94
commit
528f40c58a
2 changed files with 4 additions and 20 deletions
|
|
@ -9,7 +9,7 @@ pub struct Model {
|
|||
pub id: u32,
|
||||
pub price: f32,
|
||||
pub sold_price: Option<f32>,
|
||||
pub status: BookStatus,
|
||||
pub available: bool,
|
||||
pub book_id: u32,
|
||||
pub owner_id: u32,
|
||||
pub bal_id: u32
|
||||
|
|
@ -26,17 +26,6 @@ impl Entity {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(EnumIter, DeriveActiveEnum, PartialEq, Eq ,Deserialize, Serialize, Clone, Copy, Debug, utoipa::ToSchema)]
|
||||
#[sea_orm(rs_type = "String", db_type = "String(StringLen::N(1))")]
|
||||
pub enum BookStatus {
|
||||
#[sea_orm(string_value = "A")]
|
||||
Available,
|
||||
#[sea_orm(string_value = "S")]
|
||||
Sold,
|
||||
#[sea_orm(string_value = "D")]
|
||||
Damaged
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {
|
||||
#[sea_orm(
|
||||
|
|
|
|||
Reference in a new issue