bazzar/crates/model/src/v4/tracking_links.rs

27 lines
2.3 KiB
Rust
Raw Normal View History

2023-06-03 13:31:57 +02:00
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ;
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ;
impl EntityName for Entity { fn table_name (& self) -> & str { "tracking_links" } }
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub id : String , pub url : Option < String > , pub tracking_number : String , pub fulfillment_id : String , pub created_at : DateTimeWithTimeZone , pub updated_at : DateTimeWithTimeZone , pub deleted_at : Option < DateTimeWithTimeZone > , pub metadata : Option < Json > , pub idempotency_key : Option < String > , }
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { Id , Url , TrackingNumber , FulfillmentId , CreatedAt , UpdatedAt , DeletedAt , Metadata , IdempotencyKey , }
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { Id , }
impl PrimaryKeyTrait for PrimaryKey { type ValueType = String ; fn auto_increment () -> bool { false } }
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { Fulfillments , }
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: Id => ColumnType :: String (None) . def () , Self :: Url => ColumnType :: String (None) . def () . null () , Self :: TrackingNumber => ColumnType :: String (None) . def () , Self :: FulfillmentId => ColumnType :: String (None) . def () , Self :: CreatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: UpdatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: DeletedAt => ColumnType :: TimestampWithTimeZone . def () . null () , Self :: Metadata => ColumnType :: JsonBinary . def () . null () , Self :: IdempotencyKey => ColumnType :: String (None) . def () . null () , } } }
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: Fulfillments => Entity :: belongs_to (super :: fulfillments :: Entity) . from (Column :: FulfillmentId) . to (super :: fulfillments :: Column :: Id) . into () , } } }
impl Related < super :: fulfillments :: Entity > for Entity { fn to () -> RelationDef { Relation :: Fulfillments . def () } }
impl ActiveModelBehavior for ActiveModel { }