//! `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 { "line_item_tax_lines" } } #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Serialize, Deserialize)] pub struct Model { pub id: String, pub rate: f32, pub name: String, pub code: Option, pub created_at: DateTimeWithTimeZone, pub updated_at: DateTimeWithTimeZone, pub metadata: Option, pub item_id: String, } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)] pub enum Column { Id, Rate, Name, Code, CreatedAt, UpdatedAt, Metadata, ItemId, } #[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 { LineItems, } impl ColumnTrait for Column { type EntityName = Entity; fn def(&self) -> ColumnDef { match self { Self::Id => ColumnType::String(None).def(), Self::Rate => ColumnType::Float.def(), Self::Name => ColumnType::String(None).def(), Self::Code => ColumnType::String(None).def().null(), Self::CreatedAt => ColumnType::TimestampWithTimeZone.def(), Self::UpdatedAt => ColumnType::TimestampWithTimeZone.def(), Self::Metadata => ColumnType::JsonBinary.def().null(), Self::ItemId => ColumnType::String(None).def(), } } } impl RelationTrait for Relation { fn def(&self) -> RelationDef { match self { Self::LineItems => Entity::belongs_to(super::line_items::Entity) .from(Column::ItemId) .to(super::line_items::Column::Id) .into(), } } } impl Related for Entity { fn to() -> RelationDef { Relation::LineItems.def() } } impl ActiveModelBehavior for ActiveModel {}