Finish items and shipping

This commit is contained in:
eraden 2023-06-12 15:11:59 +02:00
parent b8ff7fe65b
commit 25732c8511
45 changed files with 4316 additions and 903 deletions

View File

@ -86,6 +86,7 @@ pub mod return_reasons ;
pub mod returns; pub mod returns;
pub mod sales_channel_locations; pub mod sales_channel_locations;
pub mod sales_channels; pub mod sales_channels;
pub mod sea_orm_active_enums;
pub mod shipping_method_tax_lines; pub mod shipping_method_tax_lines;
pub mod shipping_methods; pub mod shipping_methods;
pub mod shipping_option_requirements; pub mod shipping_option_requirements;
@ -100,4 +101,3 @@ pub mod tax_providers ;
pub mod tax_rates; pub mod tax_rates;
pub mod tracking_links; pub mod tracking_links;
pub mod users; pub mod users;
pub mod sea_orm_active_enums ;

View File

@ -1,29 +1 @@
//! `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 { "product_category_products" } }
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub product_category_id : String , pub product_id : String , }
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { ProductCategoryId , ProductId , }
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { }
impl PrimaryKeyTrait for PrimaryKey { type ValueType = ; fn auto_increment () -> bool { false } }
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { ProductCategories , Products , }
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: ProductCategoryId => ColumnType :: String (None) . def () , Self :: ProductId => ColumnType :: String (None) . def () , } } }
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: ProductCategories => Entity :: belongs_to (super :: product_categories :: Entity) . from (Column :: ProductCategoryId) . to (super :: product_categories :: Column :: Id) . into () , Self :: Products => Entity :: belongs_to (super :: products :: Entity) . from (Column :: ProductId) . to (super :: products :: Column :: Id) . into () , } } }
impl Related < super :: product_categories :: Entity > for Entity { fn to () -> RelationDef { Relation :: ProductCategories . def () } }
impl Related < super :: products :: Entity > for Entity { fn to () -> RelationDef { Relation :: Products . def () } }
impl ActiveModelBehavior for ActiveModel { }

View File

@ -1,29 +1,96 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `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;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"product_collections"
}
}
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub id: String,
pub title: String,
pub handle: Option<String>,
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
pub deleted_at: Option<DateTimeWithTimeZone>,
pub metadata: Option<Json>,
}
impl EntityName for Entity { fn table_name (& self) -> & str { "product_collections" } } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
Id,
Title,
Handle,
CreatedAt,
UpdatedAt,
DeletedAt,
Metadata,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub id : String , pub title : String , pub handle : Option < String > , pub created_at : DateTimeWithTimeZone , pub updated_at : DateTimeWithTimeZone , pub deleted_at : Option < DateTimeWithTimeZone > , pub metadata : Option < Json > , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
Id,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { Id , Title , Handle , CreatedAt , UpdatedAt , DeletedAt , Metadata , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = String;
fn auto_increment() -> bool {
false
}
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { Id , } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
Products,
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = String ; fn auto_increment () -> bool { false } } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::Id => ColumnType::String(None).def(),
Self::Title => ColumnType::String(None).def(),
Self::Handle => ColumnType::String(None).def().null(),
Self::CreatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::UpdatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::DeletedAt => ColumnType::TimestampWithTimeZone.def().null(),
Self::Metadata => ColumnType::JsonBinary.def().null(),
}
}
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { Products , } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
match self {
Self::Products => Entity::has_many(super::products::Entity).into(),
}
}
}
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: Id => ColumnType :: String (None) . def () , Self :: Title => ColumnType :: String (None) . def () , Self :: Handle => ColumnType :: String (None) . def () . null () , Self :: CreatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: UpdatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: DeletedAt => ColumnType :: TimestampWithTimeZone . def () . null () , Self :: Metadata => ColumnType :: JsonBinary . def () . null () , } } } impl Related<super::products::Entity> for Entity {
fn to() -> RelationDef {
Relation::Products.def()
}
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: Products => Entity :: has_many (super :: products :: Entity) . into () , } } } impl Related<super::discount_conditions::Entity> for Entity {
fn to() -> RelationDef {
impl Related < super :: products :: Entity > for Entity { fn to () -> RelationDef { Relation :: Products . def () } } super::discount_condition_product_collections::Relation::DiscountConditions.def()
}
impl Related < super :: discount_conditions :: Entity > for Entity { fn to () -> RelationDef { super :: discount_condition_product_collections :: Relation :: DiscountConditions . def () } fn via () -> Option < RelationDef > { Some (super :: discount_condition_product_collections :: Relation :: ProductCollections . def () . rev ()) } } fn via() -> Option<RelationDef> {
Some(
super::discount_condition_product_collections::Relation::ProductCollections
.def()
.rev(),
)
}
}
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,29 +1,83 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `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;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"product_images"
}
}
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub product_id: String,
pub image_id: String,
}
impl EntityName for Entity { fn table_name (& self) -> & str { "product_images" } } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
ProductId,
ImageId,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub product_id : String , pub image_id : String , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
ProductId,
ImageId,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { ProductId , ImageId , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = (String, String);
fn auto_increment() -> bool {
false
}
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { ProductId , ImageId , } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
Images,
Products,
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = (String , String) ; fn auto_increment () -> bool { false } } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::ProductId => ColumnType::String(None).def(),
Self::ImageId => ColumnType::String(None).def(),
}
}
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { Images , Products , } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
match self {
Self::Images => Entity::belongs_to(super::images::Entity)
.from(Column::ImageId)
.to(super::images::Column::Id)
.into(),
Self::Products => Entity::belongs_to(super::products::Entity)
.from(Column::ProductId)
.to(super::products::Column::Id)
.into(),
}
}
}
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: ProductId => ColumnType :: String (None) . def () , Self :: ImageId => ColumnType :: String (None) . def () , } } } impl Related<super::images::Entity> for Entity {
fn to() -> RelationDef {
Relation::Images.def()
}
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: Images => Entity :: belongs_to (super :: images :: Entity) . from (Column :: ImageId) . to (super :: images :: Column :: Id) . into () , Self :: Products => Entity :: belongs_to (super :: products :: Entity) . from (Column :: ProductId) . to (super :: products :: Column :: Id) . into () , } } } impl Related<super::products::Entity> for Entity {
fn to() -> RelationDef {
impl Related < super :: images :: Entity > for Entity { fn to () -> RelationDef { Relation :: Images . def () } } Relation::Products.def()
}
impl Related < super :: products :: Entity > for Entity { fn to () -> RelationDef { Relation :: Products . def () } } }
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,29 +1,100 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `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;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"product_option_values"
}
}
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub id: String,
pub value: String,
pub option_id: String,
pub variant_id: String,
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
pub deleted_at: Option<DateTimeWithTimeZone>,
pub metadata: Option<Json>,
}
impl EntityName for Entity { fn table_name (& self) -> & str { "product_option_values" } } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
Id,
Value,
OptionId,
VariantId,
CreatedAt,
UpdatedAt,
DeletedAt,
Metadata,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub id : String , pub value : String , pub option_id : String , pub variant_id : String , pub created_at : DateTimeWithTimeZone , pub updated_at : DateTimeWithTimeZone , pub deleted_at : Option < DateTimeWithTimeZone > , pub metadata : Option < Json > , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
Id,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { Id , Value , OptionId , VariantId , CreatedAt , UpdatedAt , DeletedAt , Metadata , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = String;
fn auto_increment() -> bool {
false
}
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { Id , } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
ProductOptions,
ProductVariants,
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = String ; fn auto_increment () -> bool { false } } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::Id => ColumnType::String(None).def(),
Self::Value => ColumnType::String(None).def(),
Self::OptionId => ColumnType::String(None).def(),
Self::VariantId => 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(),
}
}
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { ProductOptions , ProductVariants , } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
match self {
Self::ProductOptions => Entity::belongs_to(super::product_options::Entity)
.from(Column::OptionId)
.to(super::product_options::Column::Id)
.into(),
Self::ProductVariants => Entity::belongs_to(super::product_variants::Entity)
.from(Column::VariantId)
.to(super::product_variants::Column::Id)
.into(),
}
}
}
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: Id => ColumnType :: String (None) . def () , Self :: Value => ColumnType :: String (None) . def () , Self :: OptionId => ColumnType :: String (None) . def () , Self :: VariantId => 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 () , } } } impl Related<super::product_options::Entity> for Entity {
fn to() -> RelationDef {
Relation::ProductOptions.def()
}
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: ProductOptions => Entity :: belongs_to (super :: product_options :: Entity) . from (Column :: OptionId) . to (super :: product_options :: Column :: Id) . into () , Self :: ProductVariants => Entity :: belongs_to (super :: product_variants :: Entity) . from (Column :: VariantId) . to (super :: product_variants :: Column :: Id) . into () , } } } impl Related<super::product_variants::Entity> for Entity {
fn to() -> RelationDef {
impl Related < super :: product_options :: Entity > for Entity { fn to () -> RelationDef { Relation :: ProductOptions . def () } } Relation::ProductVariants.def()
}
impl Related < super :: product_variants :: Entity > for Entity { fn to () -> RelationDef { Relation :: ProductVariants . def () } } }
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,29 +1,96 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `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;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"product_options"
}
}
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub id: String,
pub title: String,
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
pub deleted_at: Option<DateTimeWithTimeZone>,
pub metadata: Option<Json>,
pub product_id: Option<String>,
}
impl EntityName for Entity { fn table_name (& self) -> & str { "product_options" } } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
Id,
Title,
CreatedAt,
UpdatedAt,
DeletedAt,
Metadata,
ProductId,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub id : String , pub title : String , pub created_at : DateTimeWithTimeZone , pub updated_at : DateTimeWithTimeZone , pub deleted_at : Option < DateTimeWithTimeZone > , pub metadata : Option < Json > , pub product_id : Option < String > , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
Id,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { Id , Title , CreatedAt , UpdatedAt , DeletedAt , Metadata , ProductId , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = String;
fn auto_increment() -> bool {
false
}
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { Id , } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
ProductOptionValues,
Products,
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = String ; fn auto_increment () -> bool { false } } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::Id => ColumnType::String(None).def(),
Self::Title => 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::ProductId => ColumnType::String(None).def().null(),
}
}
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { ProductOptionValues , Products , } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
match self {
Self::ProductOptionValues => {
Entity::has_many(super::product_option_values::Entity).into()
}
Self::Products => Entity::belongs_to(super::products::Entity)
.from(Column::ProductId)
.to(super::products::Column::Id)
.into(),
}
}
}
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: Id => ColumnType :: String (None) . def () , Self :: Title => 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 :: ProductId => ColumnType :: String (None) . def () . null () , } } } impl Related<super::product_option_values::Entity> for Entity {
fn to() -> RelationDef {
Relation::ProductOptionValues.def()
}
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: ProductOptionValues => Entity :: has_many (super :: product_option_values :: Entity) . into () , Self :: Products => Entity :: belongs_to (super :: products :: Entity) . from (Column :: ProductId) . to (super :: products :: Column :: Id) . into () , } } } impl Related<super::products::Entity> for Entity {
fn to() -> RelationDef {
impl Related < super :: product_option_values :: Entity > for Entity { fn to () -> RelationDef { Relation :: ProductOptionValues . def () } } Relation::Products.def()
}
impl Related < super :: products :: Entity > for Entity { fn to () -> RelationDef { Relation :: Products . def () } } }
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,29 +1,83 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `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;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"product_sales_channels"
}
}
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub product_id: String,
pub sales_channel_id: String,
}
impl EntityName for Entity { fn table_name (& self) -> & str { "product_sales_channels" } } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
ProductId,
SalesChannelId,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub product_id : String , pub sales_channel_id : String , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
ProductId,
SalesChannelId,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { ProductId , SalesChannelId , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = (String, String);
fn auto_increment() -> bool {
false
}
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { ProductId , SalesChannelId , } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
Products,
SalesChannels,
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = (String , String) ; fn auto_increment () -> bool { false } } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::ProductId => ColumnType::String(None).def(),
Self::SalesChannelId => ColumnType::String(None).def(),
}
}
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { Products , SalesChannels , } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
match self {
Self::Products => Entity::belongs_to(super::products::Entity)
.from(Column::ProductId)
.to(super::products::Column::Id)
.into(),
Self::SalesChannels => Entity::belongs_to(super::sales_channels::Entity)
.from(Column::SalesChannelId)
.to(super::sales_channels::Column::Id)
.into(),
}
}
}
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: ProductId => ColumnType :: String (None) . def () , Self :: SalesChannelId => ColumnType :: String (None) . def () , } } } impl Related<super::products::Entity> for Entity {
fn to() -> RelationDef {
Relation::Products.def()
}
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: Products => Entity :: belongs_to (super :: products :: Entity) . from (Column :: ProductId) . to (super :: products :: Column :: Id) . into () , Self :: SalesChannels => Entity :: belongs_to (super :: sales_channels :: Entity) . from (Column :: SalesChannelId) . to (super :: sales_channels :: Column :: Id) . into () , } } } impl Related<super::sales_channels::Entity> for Entity {
fn to() -> RelationDef {
impl Related < super :: products :: Entity > for Entity { fn to () -> RelationDef { Relation :: Products . def () } } Relation::SalesChannels.def()
}
impl Related < super :: sales_channels :: Entity > for Entity { fn to () -> RelationDef { Relation :: SalesChannels . def () } } }
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,29 +1,92 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `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;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"product_tags"
}
}
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub id: String,
pub value: String,
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
pub deleted_at: Option<DateTimeWithTimeZone>,
pub metadata: Option<Json>,
}
impl EntityName for Entity { fn table_name (& self) -> & str { "product_tags" } } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
Id,
Value,
CreatedAt,
UpdatedAt,
DeletedAt,
Metadata,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub id : String , pub value : String , pub created_at : DateTimeWithTimeZone , pub updated_at : DateTimeWithTimeZone , pub deleted_at : Option < DateTimeWithTimeZone > , pub metadata : Option < Json > , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
Id,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { Id , Value , CreatedAt , UpdatedAt , DeletedAt , Metadata , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = String;
fn auto_increment() -> bool {
false
}
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { Id , } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = String ; fn auto_increment () -> bool { false } } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::Id => ColumnType::String(None).def(),
Self::Value => 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(),
}
}
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
panic!("No RelationDef")
}
}
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: Id => ColumnType :: String (None) . def () , Self :: Value => 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 () , } } } impl Related<super::discount_conditions::Entity> for Entity {
fn to() -> RelationDef {
super::discount_condition_product_tags::Relation::DiscountConditions.def()
}
fn via() -> Option<RelationDef> {
Some(
super::discount_condition_product_tags::Relation::ProductTags
.def()
.rev(),
)
}
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { panic ! ("No RelationDef") } } impl Related<super::products::Entity> for Entity {
fn to() -> RelationDef {
impl Related < super :: discount_conditions :: Entity > for Entity { fn to () -> RelationDef { super :: discount_condition_product_tags :: Relation :: DiscountConditions . def () } fn via () -> Option < RelationDef > { Some (super :: discount_condition_product_tags :: Relation :: ProductTags . def () . rev ()) } } super::product_to_tags::Relation::Products.def()
}
impl Related < super :: products :: Entity > for Entity { fn to () -> RelationDef { super :: product_to_tags :: Relation :: Products . def () } fn via () -> Option < RelationDef > { Some (super :: product_to_tags :: Relation :: ProductTags . def () . rev ()) } } fn via() -> Option<RelationDef> {
Some(super::product_to_tags::Relation::ProductTags.def().rev())
}
}
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,29 +1,92 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `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;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"product_tax_rates"
}
}
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub product_id: String,
pub rate_id: String,
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
pub metadata: Option<Json>,
}
impl EntityName for Entity { fn table_name (& self) -> & str { "product_tax_rates" } } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
ProductId,
RateId,
CreatedAt,
UpdatedAt,
Metadata,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub product_id : String , pub rate_id : String , pub created_at : DateTimeWithTimeZone , pub updated_at : DateTimeWithTimeZone , pub metadata : Option < Json > , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
ProductId,
RateId,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { ProductId , RateId , CreatedAt , UpdatedAt , Metadata , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = (String, String);
fn auto_increment() -> bool {
false
}
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { ProductId , RateId , } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
Products,
TaxRates,
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = (String , String) ; fn auto_increment () -> bool { false } } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::ProductId => ColumnType::String(None).def(),
Self::RateId => ColumnType::String(None).def(),
Self::CreatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::UpdatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::Metadata => ColumnType::JsonBinary.def().null(),
}
}
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { Products , TaxRates , } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
match self {
Self::Products => Entity::belongs_to(super::products::Entity)
.from(Column::ProductId)
.to(super::products::Column::Id)
.into(),
Self::TaxRates => Entity::belongs_to(super::tax_rates::Entity)
.from(Column::RateId)
.to(super::tax_rates::Column::Id)
.into(),
}
}
}
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: ProductId => ColumnType :: String (None) . def () , Self :: RateId => ColumnType :: String (None) . def () , Self :: CreatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: UpdatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: Metadata => ColumnType :: JsonBinary . def () . null () , } } } impl Related<super::products::Entity> for Entity {
fn to() -> RelationDef {
Relation::Products.def()
}
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: Products => Entity :: belongs_to (super :: products :: Entity) . from (Column :: ProductId) . to (super :: products :: Column :: Id) . into () , Self :: TaxRates => Entity :: belongs_to (super :: tax_rates :: Entity) . from (Column :: RateId) . to (super :: tax_rates :: Column :: Id) . into () , } } } impl Related<super::tax_rates::Entity> for Entity {
fn to() -> RelationDef {
impl Related < super :: products :: Entity > for Entity { fn to () -> RelationDef { Relation :: Products . def () } } Relation::TaxRates.def()
}
impl Related < super :: tax_rates :: Entity > for Entity { fn to () -> RelationDef { Relation :: TaxRates . def () } } }
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,29 +1,83 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `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;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"product_to_tags"
}
}
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub product_id: String,
pub product_tag_id: String,
}
impl EntityName for Entity { fn table_name (& self) -> & str { "product_to_tags" } } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
ProductId,
ProductTagId,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub product_id : String , pub product_tag_id : String , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
ProductId,
ProductTagId,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { ProductId , ProductTagId , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = (String, String);
fn auto_increment() -> bool {
false
}
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { ProductId , ProductTagId , } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
ProductTags,
Products,
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = (String , String) ; fn auto_increment () -> bool { false } } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::ProductId => ColumnType::String(None).def(),
Self::ProductTagId => ColumnType::String(None).def(),
}
}
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { ProductTags , Products , } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
match self {
Self::ProductTags => Entity::belongs_to(super::product_tags::Entity)
.from(Column::ProductTagId)
.to(super::product_tags::Column::Id)
.into(),
Self::Products => Entity::belongs_to(super::products::Entity)
.from(Column::ProductId)
.to(super::products::Column::Id)
.into(),
}
}
}
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: ProductId => ColumnType :: String (None) . def () , Self :: ProductTagId => ColumnType :: String (None) . def () , } } } impl Related<super::product_tags::Entity> for Entity {
fn to() -> RelationDef {
Relation::ProductTags.def()
}
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: ProductTags => Entity :: belongs_to (super :: product_tags :: Entity) . from (Column :: ProductTagId) . to (super :: product_tags :: Column :: Id) . into () , Self :: Products => Entity :: belongs_to (super :: products :: Entity) . from (Column :: ProductId) . to (super :: products :: Column :: Id) . into () , } } } impl Related<super::products::Entity> for Entity {
fn to() -> RelationDef {
impl Related < super :: product_tags :: Entity > for Entity { fn to () -> RelationDef { Relation :: ProductTags . def () } } Relation::Products.def()
}
impl Related < super :: products :: Entity > for Entity { fn to () -> RelationDef { Relation :: Products . def () } } }
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,29 +1,92 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `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;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"product_type_tax_rates"
}
}
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub product_type_id: String,
pub rate_id: String,
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
pub metadata: Option<Json>,
}
impl EntityName for Entity { fn table_name (& self) -> & str { "product_type_tax_rates" } } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
ProductTypeId,
RateId,
CreatedAt,
UpdatedAt,
Metadata,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub product_type_id : String , pub rate_id : String , pub created_at : DateTimeWithTimeZone , pub updated_at : DateTimeWithTimeZone , pub metadata : Option < Json > , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
ProductTypeId,
RateId,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { ProductTypeId , RateId , CreatedAt , UpdatedAt , Metadata , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = (String, String);
fn auto_increment() -> bool {
false
}
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { ProductTypeId , RateId , } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
ProductTypes,
TaxRates,
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = (String , String) ; fn auto_increment () -> bool { false } } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::ProductTypeId => ColumnType::String(None).def(),
Self::RateId => ColumnType::String(None).def(),
Self::CreatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::UpdatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::Metadata => ColumnType::JsonBinary.def().null(),
}
}
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { ProductTypes , TaxRates , } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
match self {
Self::ProductTypes => Entity::belongs_to(super::product_types::Entity)
.from(Column::ProductTypeId)
.to(super::product_types::Column::Id)
.into(),
Self::TaxRates => Entity::belongs_to(super::tax_rates::Entity)
.from(Column::RateId)
.to(super::tax_rates::Column::Id)
.into(),
}
}
}
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: ProductTypeId => ColumnType :: String (None) . def () , Self :: RateId => ColumnType :: String (None) . def () , Self :: CreatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: UpdatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: Metadata => ColumnType :: JsonBinary . def () . null () , } } } impl Related<super::product_types::Entity> for Entity {
fn to() -> RelationDef {
Relation::ProductTypes.def()
}
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: ProductTypes => Entity :: belongs_to (super :: product_types :: Entity) . from (Column :: ProductTypeId) . to (super :: product_types :: Column :: Id) . into () , Self :: TaxRates => Entity :: belongs_to (super :: tax_rates :: Entity) . from (Column :: RateId) . to (super :: tax_rates :: Column :: Id) . into () , } } } impl Related<super::tax_rates::Entity> for Entity {
fn to() -> RelationDef {
impl Related < super :: product_types :: Entity > for Entity { fn to () -> RelationDef { Relation :: ProductTypes . def () } } Relation::TaxRates.def()
}
impl Related < super :: tax_rates :: Entity > for Entity { fn to () -> RelationDef { Relation :: TaxRates . def () } } }
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,31 +1,106 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `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;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"product_types"
}
}
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub id: String,
pub value: String,
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
pub deleted_at: Option<DateTimeWithTimeZone>,
pub metadata: Option<Json>,
}
impl EntityName for Entity { fn table_name (& self) -> & str { "product_types" } } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
Id,
Value,
CreatedAt,
UpdatedAt,
DeletedAt,
Metadata,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub id : String , pub value : String , pub created_at : DateTimeWithTimeZone , pub updated_at : DateTimeWithTimeZone , pub deleted_at : Option < DateTimeWithTimeZone > , pub metadata : Option < Json > , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
Id,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { Id , Value , CreatedAt , UpdatedAt , DeletedAt , Metadata , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = String;
fn auto_increment() -> bool {
false
}
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { Id , } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
Products,
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = String ; fn auto_increment () -> bool { false } } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::Id => ColumnType::String(None).def(),
Self::Value => 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(),
}
}
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { Products , } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
match self {
Self::Products => Entity::has_many(super::products::Entity).into(),
}
}
}
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: Id => ColumnType :: String (None) . def () , Self :: Value => 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 () , } } } impl Related<super::products::Entity> for Entity {
fn to() -> RelationDef {
Relation::Products.def()
}
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: Products => Entity :: has_many (super :: products :: Entity) . into () , } } } impl Related<super::tax_rates::Entity> for Entity {
fn to() -> RelationDef {
super::product_type_tax_rates::Relation::TaxRates.def()
}
fn via() -> Option<RelationDef> {
Some(
super::product_type_tax_rates::Relation::ProductTypes
.def()
.rev(),
)
}
}
impl Related < super :: products :: Entity > for Entity { fn to () -> RelationDef { Relation :: Products . def () } } impl Related<super::discount_conditions::Entity> for Entity {
fn to() -> RelationDef {
impl Related < super :: tax_rates :: Entity > for Entity { fn to () -> RelationDef { super :: product_type_tax_rates :: Relation :: TaxRates . def () } fn via () -> Option < RelationDef > { Some (super :: product_type_tax_rates :: Relation :: ProductTypes . def () . rev ()) } } super::discount_condition_product_types::Relation::DiscountConditions.def()
}
impl Related < super :: discount_conditions :: Entity > for Entity { fn to () -> RelationDef { super :: discount_condition_product_types :: Relation :: DiscountConditions . def () } fn via () -> Option < RelationDef > { Some (super :: discount_condition_product_types :: Relation :: ProductTypes . def () . rev ()) } } fn via() -> Option<RelationDef> {
Some(
super::discount_condition_product_types::Relation::ProductTypes
.def()
.rev(),
)
}
}
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,25 +1,73 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `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;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"product_variant_inventory_items"
}
}
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub id: String,
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
pub inventory_item_id: String,
pub variant_id: String,
pub required_quantity: i32,
pub deleted_at: Option<DateTimeWithTimeZone>,
}
impl EntityName for Entity { fn table_name (& self) -> & str { "product_variant_inventory_items" } } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
Id,
CreatedAt,
UpdatedAt,
InventoryItemId,
VariantId,
RequiredQuantity,
DeletedAt,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub id : String , pub created_at : DateTimeWithTimeZone , pub updated_at : DateTimeWithTimeZone , pub inventory_item_id : String , pub variant_id : String , pub required_quantity : i32 , pub deleted_at : Option < DateTimeWithTimeZone > , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
Id,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { Id , CreatedAt , UpdatedAt , InventoryItemId , VariantId , RequiredQuantity , DeletedAt , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = String;
fn auto_increment() -> bool {
false
}
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { Id , } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = String ; fn auto_increment () -> bool { false } } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::Id => ColumnType::String(None).def(),
Self::CreatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::UpdatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::InventoryItemId => ColumnType::Text.def(),
Self::VariantId => ColumnType::Text.def(),
Self::RequiredQuantity => ColumnType::Integer.def(),
Self::DeletedAt => ColumnType::TimestampWithTimeZone.def().null(),
}
}
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: Id => ColumnType :: String (None) . def () , Self :: CreatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: UpdatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: InventoryItemId => ColumnType :: Text . def () , Self :: VariantId => ColumnType :: Text . def () , Self :: RequiredQuantity => ColumnType :: Integer . def () , Self :: DeletedAt => ColumnType :: TimestampWithTimeZone . def () . null () , } } } panic!("No RelationDef")
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { panic ! ("No RelationDef") } } }
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,35 +1,168 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `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;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"product_variants"
}
}
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub id: String,
pub title: String,
pub product_id: String,
pub sku: Option<String>,
pub barcode: Option<String>,
pub ean: Option<String>,
pub upc: Option<String>,
pub inventory_quantity: i32,
pub allow_backorder: bool,
pub manage_inventory: bool,
pub hs_code: Option<String>,
pub origin_country: Option<String>,
pub mid_code: Option<String>,
pub material: Option<String>,
pub weight: Option<i32>,
pub length: Option<i32>,
pub height: Option<i32>,
pub width: Option<i32>,
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
pub deleted_at: Option<DateTimeWithTimeZone>,
pub metadata: Option<Json>,
pub variant_rank: Option<i32>,
}
impl EntityName for Entity { fn table_name (& self) -> & str { "product_variants" } } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
Id,
Title,
ProductId,
Sku,
Barcode,
Ean,
Upc,
InventoryQuantity,
AllowBackorder,
ManageInventory,
HsCode,
OriginCountry,
MidCode,
Material,
Weight,
Length,
Height,
Width,
CreatedAt,
UpdatedAt,
DeletedAt,
Metadata,
VariantRank,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub id : String , pub title : String , pub product_id : String , pub sku : Option < String > , pub barcode : Option < String > , pub ean : Option < String > , pub upc : Option < String > , pub inventory_quantity : i32 , pub allow_backorder : bool , pub manage_inventory : bool , pub hs_code : Option < String > , pub origin_country : Option < String > , pub mid_code : Option < String > , pub material : Option < String > , pub weight : Option < i32 > , pub length : Option < i32 > , pub height : Option < i32 > , pub width : Option < i32 > , pub created_at : DateTimeWithTimeZone , pub updated_at : DateTimeWithTimeZone , pub deleted_at : Option < DateTimeWithTimeZone > , pub metadata : Option < Json > , pub variant_rank : Option < i32 > , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
Id,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { Id , Title , ProductId , Sku , Barcode , Ean , Upc , InventoryQuantity , AllowBackorder , ManageInventory , HsCode , OriginCountry , MidCode , Material , Weight , Length , Height , Width , CreatedAt , UpdatedAt , DeletedAt , Metadata , VariantRank , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = String;
fn auto_increment() -> bool {
false
}
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { Id , } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
ClaimItems,
LineItems,
MoneyAmounts,
ProductOptionValues,
Products,
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = String ; fn auto_increment () -> bool { false } } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::Id => ColumnType::String(None).def(),
Self::Title => ColumnType::String(None).def(),
Self::ProductId => ColumnType::String(None).def(),
Self::Sku => ColumnType::String(None).def().null(),
Self::Barcode => ColumnType::String(None).def().null(),
Self::Ean => ColumnType::String(None).def().null(),
Self::Upc => ColumnType::String(None).def().null(),
Self::InventoryQuantity => ColumnType::Integer.def(),
Self::AllowBackorder => ColumnType::Boolean.def(),
Self::ManageInventory => ColumnType::Boolean.def(),
Self::HsCode => ColumnType::String(None).def().null(),
Self::OriginCountry => ColumnType::String(None).def().null(),
Self::MidCode => ColumnType::String(None).def().null(),
Self::Material => ColumnType::String(None).def().null(),
Self::Weight => ColumnType::Integer.def().null(),
Self::Length => ColumnType::Integer.def().null(),
Self::Height => ColumnType::Integer.def().null(),
Self::Width => ColumnType::Integer.def().null(),
Self::CreatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::UpdatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::DeletedAt => ColumnType::TimestampWithTimeZone.def().null(),
Self::Metadata => ColumnType::JsonBinary.def().null(),
Self::VariantRank => ColumnType::Integer.def().null(),
}
}
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { ClaimItems , LineItems , MoneyAmounts , ProductOptionValues , Products , } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
match self {
Self::ClaimItems => Entity::has_many(super::claim_items::Entity).into(),
Self::LineItems => Entity::has_many(super::line_items::Entity).into(),
Self::MoneyAmounts => Entity::has_many(super::money_amounts::Entity).into(),
Self::ProductOptionValues => {
Entity::has_many(super::product_option_values::Entity).into()
}
Self::Products => Entity::belongs_to(super::products::Entity)
.from(Column::ProductId)
.to(super::products::Column::Id)
.into(),
}
}
}
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: Id => ColumnType :: String (None) . def () , Self :: Title => ColumnType :: String (None) . def () , Self :: ProductId => ColumnType :: String (None) . def () , Self :: Sku => ColumnType :: String (None) . def () . null () , Self :: Barcode => ColumnType :: String (None) . def () . null () , Self :: Ean => ColumnType :: String (None) . def () . null () , Self :: Upc => ColumnType :: String (None) . def () . null () , Self :: InventoryQuantity => ColumnType :: Integer . def () , Self :: AllowBackorder => ColumnType :: Boolean . def () , Self :: ManageInventory => ColumnType :: Boolean . def () , Self :: HsCode => ColumnType :: String (None) . def () . null () , Self :: OriginCountry => ColumnType :: String (None) . def () . null () , Self :: MidCode => ColumnType :: String (None) . def () . null () , Self :: Material => ColumnType :: String (None) . def () . null () , Self :: Weight => ColumnType :: Integer . def () . null () , Self :: Length => ColumnType :: Integer . def () . null () , Self :: Height => ColumnType :: Integer . def () . null () , Self :: Width => ColumnType :: Integer . def () . null () , Self :: CreatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: UpdatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: DeletedAt => ColumnType :: TimestampWithTimeZone . def () . null () , Self :: Metadata => ColumnType :: JsonBinary . def () . null () , Self :: VariantRank => ColumnType :: Integer . def () . null () , } } } impl Related<super::claim_items::Entity> for Entity {
fn to() -> RelationDef {
Relation::ClaimItems.def()
}
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: ClaimItems => Entity :: has_many (super :: claim_items :: Entity) . into () , Self :: LineItems => Entity :: has_many (super :: line_items :: Entity) . into () , Self :: MoneyAmounts => Entity :: has_many (super :: money_amounts :: Entity) . into () , Self :: ProductOptionValues => Entity :: has_many (super :: product_option_values :: Entity) . into () , Self :: Products => Entity :: belongs_to (super :: products :: Entity) . from (Column :: ProductId) . to (super :: products :: Column :: Id) . into () , } } } impl Related<super::line_items::Entity> for Entity {
fn to() -> RelationDef {
Relation::LineItems.def()
}
}
impl Related < super :: claim_items :: Entity > for Entity { fn to () -> RelationDef { Relation :: ClaimItems . def () } } impl Related<super::money_amounts::Entity> for Entity {
fn to() -> RelationDef {
Relation::MoneyAmounts.def()
}
}
impl Related < super :: line_items :: Entity > for Entity { fn to () -> RelationDef { Relation :: LineItems . def () } } impl Related<super::product_option_values::Entity> for Entity {
fn to() -> RelationDef {
Relation::ProductOptionValues.def()
}
}
impl Related < super :: money_amounts :: Entity > for Entity { fn to () -> RelationDef { Relation :: MoneyAmounts . def () } } impl Related<super::products::Entity> for Entity {
fn to() -> RelationDef {
impl Related < super :: product_option_values :: Entity > for Entity { fn to () -> RelationDef { Relation :: ProductOptionValues . def () } } Relation::Products.def()
}
impl Related < super :: products :: Entity > for Entity { fn to () -> RelationDef { Relation :: Products . def () } } }
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,49 +1,256 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
use super::sea_orm_active_enums::ProductStatuses;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; use super :: sea_orm_active_enums :: ProductStatuses ; #[derive(Copy, Clone, Default, Debug, DeriveEntity)]
pub struct Entity;
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"products"
}
}
impl EntityName for Entity { fn table_name (& self) -> & str { "products" } } #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub id: String,
pub title: String,
pub subtitle: Option<String>,
pub description: Option<String>,
pub handle: Option<String>,
pub is_giftcard: bool,
pub thumbnail: Option<String>,
pub profile_id: String,
pub weight: Option<i32>,
pub length: Option<i32>,
pub height: Option<i32>,
pub width: Option<i32>,
pub hs_code: Option<String>,
pub origin_country: Option<String>,
pub mid_code: Option<String>,
pub material: Option<String>,
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
pub deleted_at: Option<DateTimeWithTimeZone>,
pub metadata: Option<Json>,
pub collection_id: Option<String>,
pub type_id: Option<String>,
pub discountable: bool,
pub status: ProductStatuses,
pub external_id: Option<String>,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub id : String , pub title : String , pub subtitle : Option < String > , pub description : Option < String > , pub handle : Option < String > , pub is_giftcard : bool , pub thumbnail : Option < String > , pub profile_id : String , pub weight : Option < i32 > , pub length : Option < i32 > , pub height : Option < i32 > , pub width : Option < i32 > , pub hs_code : Option < String > , pub origin_country : Option < String > , pub mid_code : Option < String > , pub material : Option < String > , pub created_at : DateTimeWithTimeZone , pub updated_at : DateTimeWithTimeZone , pub deleted_at : Option < DateTimeWithTimeZone > , pub metadata : Option < Json > , pub collection_id : Option < String > , pub type_id : Option < String > , pub discountable : bool , pub status : ProductStatuses , pub external_id : Option < String > , } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
Id,
Title,
Subtitle,
Description,
Handle,
IsGiftcard,
Thumbnail,
ProfileId,
Weight,
Length,
Height,
Width,
HsCode,
OriginCountry,
MidCode,
Material,
CreatedAt,
UpdatedAt,
DeletedAt,
Metadata,
CollectionId,
TypeId,
Discountable,
Status,
ExternalId,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { Id , Title , Subtitle , Description , Handle , IsGiftcard , Thumbnail , ProfileId , Weight , Length , Height , Width , HsCode , OriginCountry , MidCode , Material , CreatedAt , UpdatedAt , DeletedAt , Metadata , CollectionId , TypeId , Discountable , Status , ExternalId , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
Id,
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { Id , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = String;
fn auto_increment() -> bool {
false
}
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = String ; fn auto_increment () -> bool { false } } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
ProductCategoryProducts,
ProductCollections,
ProductOptions,
ProductTypes,
ProductVariants,
ShippingProfiles,
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { ProductCategoryProducts , ProductCollections , ProductOptions , ProductTypes , ProductVariants , ShippingProfiles , } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::Id => ColumnType::String(None).def(),
Self::Title => ColumnType::String(None).def(),
Self::Subtitle => ColumnType::String(None).def().null(),
Self::Description => ColumnType::String(None).def().null(),
Self::Handle => ColumnType::String(None).def().null(),
Self::IsGiftcard => ColumnType::Boolean.def(),
Self::Thumbnail => ColumnType::String(None).def().null(),
Self::ProfileId => ColumnType::String(None).def(),
Self::Weight => ColumnType::Integer.def().null(),
Self::Length => ColumnType::Integer.def().null(),
Self::Height => ColumnType::Integer.def().null(),
Self::Width => ColumnType::Integer.def().null(),
Self::HsCode => ColumnType::String(None).def().null(),
Self::OriginCountry => ColumnType::String(None).def().null(),
Self::MidCode => ColumnType::String(None).def().null(),
Self::Material => ColumnType::String(None).def().null(),
Self::CreatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::UpdatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::DeletedAt => ColumnType::TimestampWithTimeZone.def().null(),
Self::Metadata => ColumnType::JsonBinary.def().null(),
Self::CollectionId => ColumnType::String(None).def().null(),
Self::TypeId => ColumnType::String(None).def().null(),
Self::Discountable => ColumnType::Boolean.def(),
Self::Status => ProductStatuses::db_type().def(),
Self::ExternalId => ColumnType::String(None).def().null(),
}
}
}
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: Id => ColumnType :: String (None) . def () , Self :: Title => ColumnType :: String (None) . def () , Self :: Subtitle => ColumnType :: String (None) . def () . null () , Self :: Description => ColumnType :: String (None) . def () . null () , Self :: Handle => ColumnType :: String (None) . def () . null () , Self :: IsGiftcard => ColumnType :: Boolean . def () , Self :: Thumbnail => ColumnType :: String (None) . def () . null () , Self :: ProfileId => ColumnType :: String (None) . def () , Self :: Weight => ColumnType :: Integer . def () . null () , Self :: Length => ColumnType :: Integer . def () . null () , Self :: Height => ColumnType :: Integer . def () . null () , Self :: Width => ColumnType :: Integer . def () . null () , Self :: HsCode => ColumnType :: String (None) . def () . null () , Self :: OriginCountry => ColumnType :: String (None) . def () . null () , Self :: MidCode => ColumnType :: String (None) . def () . null () , Self :: Material => ColumnType :: String (None) . def () . null () , Self :: CreatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: UpdatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: DeletedAt => ColumnType :: TimestampWithTimeZone . def () . null () , Self :: Metadata => ColumnType :: JsonBinary . def () . null () , Self :: CollectionId => ColumnType :: String (None) . def () . null () , Self :: TypeId => ColumnType :: String (None) . def () . null () , Self :: Discountable => ColumnType :: Boolean . def () , Self :: Status => ProductStatuses :: db_type () . def () , Self :: ExternalId => ColumnType :: String (None) . def () . null () , } } } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
match self {
Self::ProductCategoryProducts => {
Entity::has_many(super::product_category_products::Entity).into()
}
Self::ProductCollections => Entity::belongs_to(super::product_collections::Entity)
.from(Column::CollectionId)
.to(super::product_collections::Column::Id)
.into(),
Self::ProductOptions => Entity::has_many(super::product_options::Entity).into(),
Self::ProductTypes => Entity::belongs_to(super::product_types::Entity)
.from(Column::TypeId)
.to(super::product_types::Column::Id)
.into(),
Self::ProductVariants => Entity::has_many(super::product_variants::Entity).into(),
Self::ShippingProfiles => Entity::belongs_to(super::shipping_profiles::Entity)
.from(Column::ProfileId)
.to(super::shipping_profiles::Column::Id)
.into(),
}
}
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: ProductCategoryProducts => Entity :: has_many (super :: product_category_products :: Entity) . into () , Self :: ProductCollections => Entity :: belongs_to (super :: product_collections :: Entity) . from (Column :: CollectionId) . to (super :: product_collections :: Column :: Id) . into () , Self :: ProductOptions => Entity :: has_many (super :: product_options :: Entity) . into () , Self :: ProductTypes => Entity :: belongs_to (super :: product_types :: Entity) . from (Column :: TypeId) . to (super :: product_types :: Column :: Id) . into () , Self :: ProductVariants => Entity :: has_many (super :: product_variants :: Entity) . into () , Self :: ShippingProfiles => Entity :: belongs_to (super :: shipping_profiles :: Entity) . from (Column :: ProfileId) . to (super :: shipping_profiles :: Column :: Id) . into () , } } } impl Related<super::product_category_products::Entity> for Entity {
fn to() -> RelationDef {
Relation::ProductCategoryProducts.def()
}
}
impl Related < super :: product_category_products :: Entity > for Entity { fn to () -> RelationDef { Relation :: ProductCategoryProducts . def () } } impl Related<super::product_collections::Entity> for Entity {
fn to() -> RelationDef {
Relation::ProductCollections.def()
}
}
impl Related < super :: product_collections :: Entity > for Entity { fn to () -> RelationDef { Relation :: ProductCollections . def () } } impl Related<super::product_options::Entity> for Entity {
fn to() -> RelationDef {
Relation::ProductOptions.def()
}
}
impl Related < super :: product_options :: Entity > for Entity { fn to () -> RelationDef { Relation :: ProductOptions . def () } } impl Related<super::product_types::Entity> for Entity {
fn to() -> RelationDef {
Relation::ProductTypes.def()
}
}
impl Related < super :: product_types :: Entity > for Entity { fn to () -> RelationDef { Relation :: ProductTypes . def () } } impl Related<super::product_variants::Entity> for Entity {
fn to() -> RelationDef {
Relation::ProductVariants.def()
}
}
impl Related < super :: product_variants :: Entity > for Entity { fn to () -> RelationDef { Relation :: ProductVariants . def () } } impl Related<super::shipping_profiles::Entity> for Entity {
fn to() -> RelationDef {
Relation::ShippingProfiles.def()
}
}
impl Related < super :: shipping_profiles :: Entity > for Entity { fn to () -> RelationDef { Relation :: ShippingProfiles . def () } } impl Related<super::tax_rates::Entity> for Entity {
fn to() -> RelationDef {
super::product_tax_rates::Relation::TaxRates.def()
}
fn via() -> Option<RelationDef> {
Some(super::product_tax_rates::Relation::Products.def().rev())
}
}
impl Related < super :: tax_rates :: Entity > for Entity { fn to () -> RelationDef { super :: product_tax_rates :: Relation :: TaxRates . def () } fn via () -> Option < RelationDef > { Some (super :: product_tax_rates :: Relation :: Products . def () . rev ()) } } impl Related<super::product_tags::Entity> for Entity {
fn to() -> RelationDef {
super::product_to_tags::Relation::ProductTags.def()
}
fn via() -> Option<RelationDef> {
Some(super::product_to_tags::Relation::Products.def().rev())
}
}
impl Related < super :: product_tags :: Entity > for Entity { fn to () -> RelationDef { super :: product_to_tags :: Relation :: ProductTags . def () } fn via () -> Option < RelationDef > { Some (super :: product_to_tags :: Relation :: Products . def () . rev ()) } } impl Related<super::images::Entity> for Entity {
fn to() -> RelationDef {
super::product_images::Relation::Images.def()
}
fn via() -> Option<RelationDef> {
Some(super::product_images::Relation::Products.def().rev())
}
}
impl Related < super :: images :: Entity > for Entity { fn to () -> RelationDef { super :: product_images :: Relation :: Images . def () } fn via () -> Option < RelationDef > { Some (super :: product_images :: Relation :: Products . def () . rev ()) } } impl Related<super::sales_channels::Entity> for Entity {
fn to() -> RelationDef {
super::product_sales_channels::Relation::SalesChannels.def()
}
fn via() -> Option<RelationDef> {
Some(
super::product_sales_channels::Relation::Products
.def()
.rev(),
)
}
}
impl Related < super :: sales_channels :: Entity > for Entity { fn to () -> RelationDef { super :: product_sales_channels :: Relation :: SalesChannels . def () } fn via () -> Option < RelationDef > { Some (super :: product_sales_channels :: Relation :: Products . def () . rev ()) } } impl Related<super::discount_rules::Entity> for Entity {
fn to() -> RelationDef {
super::discount_rule_products::Relation::DiscountRules.def()
}
fn via() -> Option<RelationDef> {
Some(
super::discount_rule_products::Relation::Products
.def()
.rev(),
)
}
}
impl Related < super :: discount_rules :: Entity > for Entity { fn to () -> RelationDef { super :: discount_rule_products :: Relation :: DiscountRules . def () } fn via () -> Option < RelationDef > { Some (super :: discount_rule_products :: Relation :: Products . def () . rev ()) } } impl Related<super::discount_conditions::Entity> for Entity {
fn to() -> RelationDef {
impl Related < super :: discount_conditions :: Entity > for Entity { fn to () -> RelationDef { super :: discount_condition_products :: Relation :: DiscountConditions . def () } fn via () -> Option < RelationDef > { Some (super :: discount_condition_products :: Relation :: Products . def () . rev ()) } } super::discount_condition_products::Relation::DiscountConditions.def()
}
fn via() -> Option<RelationDef> {
Some(
super::discount_condition_products::Relation::Products
.def()
.rev(),
)
}
}
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,25 +1,59 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `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;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"publishable_api_key_sales_channels"
}
}
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub sales_channel_id: String,
pub publishable_key_id: String,
}
impl EntityName for Entity { fn table_name (& self) -> & str { "publishable_api_key_sales_channels" } } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
SalesChannelId,
PublishableKeyId,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub sales_channel_id : String , pub publishable_key_id : String , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
SalesChannelId,
PublishableKeyId,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { SalesChannelId , PublishableKeyId , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = (String, String);
fn auto_increment() -> bool {
false
}
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { SalesChannelId , PublishableKeyId , } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = (String , String) ; fn auto_increment () -> bool { false } } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::SalesChannelId => ColumnType::String(None).def(),
Self::PublishableKeyId => ColumnType::String(None).def(),
}
}
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: SalesChannelId => ColumnType :: String (None) . def () , Self :: PublishableKeyId => ColumnType :: String (None) . def () , } } } panic!("No RelationDef")
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { panic ! ("No RelationDef") } } }
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,25 +1,73 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `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;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"publishable_api_keys"
}
}
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub id: String,
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
pub created_by: Option<String>,
pub revoked_by: Option<String>,
pub revoked_at: Option<DateTimeWithTimeZone>,
pub title: String,
}
impl EntityName for Entity { fn table_name (& self) -> & str { "publishable_api_keys" } } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
Id,
CreatedAt,
UpdatedAt,
CreatedBy,
RevokedBy,
RevokedAt,
Title,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub id : String , pub created_at : DateTimeWithTimeZone , pub updated_at : DateTimeWithTimeZone , pub created_by : Option < String > , pub revoked_by : Option < String > , pub revoked_at : Option < DateTimeWithTimeZone > , pub title : String , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
Id,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { Id , CreatedAt , UpdatedAt , CreatedBy , RevokedBy , RevokedAt , Title , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = String;
fn auto_increment() -> bool {
false
}
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { Id , } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = String ; fn auto_increment () -> bool { false } } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::Id => ColumnType::String(None).def(),
Self::CreatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::UpdatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::CreatedBy => ColumnType::String(None).def().null(),
Self::RevokedBy => ColumnType::String(None).def().null(),
Self::RevokedAt => ColumnType::TimestampWithTimeZone.def().null(),
Self::Title => ColumnType::String(None).def(),
}
}
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: Id => ColumnType :: String (None) . def () , Self :: CreatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: UpdatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: CreatedBy => ColumnType :: String (None) . def () . null () , Self :: RevokedBy => ColumnType :: String (None) . def () . null () , Self :: RevokedAt => ColumnType :: TimestampWithTimeZone . def () . null () , Self :: Title => ColumnType :: String (None) . def () , } } } panic!("No RelationDef")
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { panic ! ("No RelationDef") } } }
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,29 +1,108 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
use super::sea_orm_active_enums::RefundReasons;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; use super :: sea_orm_active_enums :: RefundReasons ; #[derive(Copy, Clone, Default, Debug, DeriveEntity)]
pub struct Entity;
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"refunds"
}
}
impl EntityName for Entity { fn table_name (& self) -> & str { "refunds" } } #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub id: String,
pub order_id: Option<String>,
pub amount: i32,
pub note: Option<String>,
pub reason: RefundReasons,
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
pub metadata: Option<Json>,
pub idempotency_key: Option<String>,
pub payment_id: Option<String>,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub id : String , pub order_id : Option < String > , pub amount : i32 , pub note : Option < String > , pub reason : RefundReasons , pub created_at : DateTimeWithTimeZone , pub updated_at : DateTimeWithTimeZone , pub metadata : Option < Json > , pub idempotency_key : Option < String > , pub payment_id : Option < String > , } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
Id,
OrderId,
Amount,
Note,
Reason,
CreatedAt,
UpdatedAt,
Metadata,
IdempotencyKey,
PaymentId,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { Id , OrderId , Amount , Note , Reason , CreatedAt , UpdatedAt , Metadata , IdempotencyKey , PaymentId , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
Id,
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { Id , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = String;
fn auto_increment() -> bool {
false
}
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = String ; fn auto_increment () -> bool { false } } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
Orders,
Payments,
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { Orders , Payments , } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::Id => ColumnType::String(None).def(),
Self::OrderId => ColumnType::String(None).def().null(),
Self::Amount => ColumnType::Integer.def(),
Self::Note => ColumnType::String(None).def().null(),
Self::Reason => RefundReasons::db_type().def(),
Self::CreatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::UpdatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::Metadata => ColumnType::JsonBinary.def().null(),
Self::IdempotencyKey => ColumnType::String(None).def().null(),
Self::PaymentId => ColumnType::String(None).def().null(),
}
}
}
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: Id => ColumnType :: String (None) . def () , Self :: OrderId => ColumnType :: String (None) . def () . null () , Self :: Amount => ColumnType :: Integer . def () , Self :: Note => ColumnType :: String (None) . def () . null () , Self :: Reason => RefundReasons :: db_type () . def () , Self :: CreatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: UpdatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: Metadata => ColumnType :: JsonBinary . def () . null () , Self :: IdempotencyKey => ColumnType :: String (None) . def () . null () , Self :: PaymentId => ColumnType :: String (None) . def () . null () , } } } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
match self {
Self::Orders => Entity::belongs_to(super::orders::Entity)
.from(Column::OrderId)
.to(super::orders::Column::Id)
.into(),
Self::Payments => Entity::belongs_to(super::payments::Entity)
.from(Column::PaymentId)
.to(super::payments::Column::Id)
.into(),
}
}
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: Orders => Entity :: belongs_to (super :: orders :: Entity) . from (Column :: OrderId) . to (super :: orders :: Column :: Id) . into () , Self :: Payments => Entity :: belongs_to (super :: payments :: Entity) . from (Column :: PaymentId) . to (super :: payments :: Column :: Id) . into () , } } } impl Related<super::orders::Entity> for Entity {
fn to() -> RelationDef {
Relation::Orders.def()
}
}
impl Related < super :: orders :: Entity > for Entity { fn to () -> RelationDef { Relation :: Orders . def () } } impl Related<super::payments::Entity> for Entity {
fn to() -> RelationDef {
impl Related < super :: payments :: Entity > for Entity { fn to () -> RelationDef { Relation :: Payments . def () } } Relation::Payments.def()
}
}
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,29 +1,83 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `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;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"region_fulfillment_providers"
}
}
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub region_id: String,
pub provider_id: String,
}
impl EntityName for Entity { fn table_name (& self) -> & str { "region_fulfillment_providers" } } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
RegionId,
ProviderId,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub region_id : String , pub provider_id : String , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
RegionId,
ProviderId,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { RegionId , ProviderId , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = (String, String);
fn auto_increment() -> bool {
false
}
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { RegionId , ProviderId , } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
FulfillmentProviders,
Regions,
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = (String , String) ; fn auto_increment () -> bool { false } } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::RegionId => ColumnType::String(None).def(),
Self::ProviderId => ColumnType::String(None).def(),
}
}
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { FulfillmentProviders , Regions , } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
match self {
Self::FulfillmentProviders => Entity::belongs_to(super::fulfillment_providers::Entity)
.from(Column::ProviderId)
.to(super::fulfillment_providers::Column::Id)
.into(),
Self::Regions => Entity::belongs_to(super::regions::Entity)
.from(Column::RegionId)
.to(super::regions::Column::Id)
.into(),
}
}
}
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: RegionId => ColumnType :: String (None) . def () , Self :: ProviderId => ColumnType :: String (None) . def () , } } } impl Related<super::fulfillment_providers::Entity> for Entity {
fn to() -> RelationDef {
Relation::FulfillmentProviders.def()
}
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: FulfillmentProviders => Entity :: belongs_to (super :: fulfillment_providers :: Entity) . from (Column :: ProviderId) . to (super :: fulfillment_providers :: Column :: Id) . into () , Self :: Regions => Entity :: belongs_to (super :: regions :: Entity) . from (Column :: RegionId) . to (super :: regions :: Column :: Id) . into () , } } } impl Related<super::regions::Entity> for Entity {
fn to() -> RelationDef {
impl Related < super :: fulfillment_providers :: Entity > for Entity { fn to () -> RelationDef { Relation :: FulfillmentProviders . def () } } Relation::Regions.def()
}
impl Related < super :: regions :: Entity > for Entity { fn to () -> RelationDef { Relation :: Regions . def () } } }
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,29 +1,83 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `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;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"region_payment_providers"
}
}
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub region_id: String,
pub provider_id: String,
}
impl EntityName for Entity { fn table_name (& self) -> & str { "region_payment_providers" } } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
RegionId,
ProviderId,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub region_id : String , pub provider_id : String , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
RegionId,
ProviderId,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { RegionId , ProviderId , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = (String, String);
fn auto_increment() -> bool {
false
}
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { RegionId , ProviderId , } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
PaymentProviders,
Regions,
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = (String , String) ; fn auto_increment () -> bool { false } } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::RegionId => ColumnType::String(None).def(),
Self::ProviderId => ColumnType::String(None).def(),
}
}
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { PaymentProviders , Regions , } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
match self {
Self::PaymentProviders => Entity::belongs_to(super::payment_providers::Entity)
.from(Column::ProviderId)
.to(super::payment_providers::Column::Id)
.into(),
Self::Regions => Entity::belongs_to(super::regions::Entity)
.from(Column::RegionId)
.to(super::regions::Column::Id)
.into(),
}
}
}
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: RegionId => ColumnType :: String (None) . def () , Self :: ProviderId => ColumnType :: String (None) . def () , } } } impl Related<super::payment_providers::Entity> for Entity {
fn to() -> RelationDef {
Relation::PaymentProviders.def()
}
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: PaymentProviders => Entity :: belongs_to (super :: payment_providers :: Entity) . from (Column :: ProviderId) . to (super :: payment_providers :: Column :: Id) . into () , Self :: Regions => Entity :: belongs_to (super :: regions :: Entity) . from (Column :: RegionId) . to (super :: regions :: Column :: Id) . into () , } } } impl Related<super::regions::Entity> for Entity {
fn to() -> RelationDef {
impl Related < super :: payment_providers :: Entity > for Entity { fn to () -> RelationDef { Relation :: PaymentProviders . def () } } Relation::Regions.def()
}
impl Related < super :: regions :: Entity > for Entity { fn to () -> RelationDef { Relation :: Regions . def () } } }
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,51 +1,211 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `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;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"regions"
}
}
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Serialize, Deserialize)]
pub struct Model {
pub id: String,
pub name: String,
pub currency_code: String,
pub tax_rate: f32,
pub tax_code: Option<String>,
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
pub deleted_at: Option<DateTimeWithTimeZone>,
pub metadata: Option<Json>,
pub gift_cards_taxable: bool,
pub automatic_taxes: bool,
pub tax_provider_id: Option<String>,
}
impl EntityName for Entity { fn table_name (& self) -> & str { "regions" } } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
Id,
Name,
CurrencyCode,
TaxRate,
TaxCode,
CreatedAt,
UpdatedAt,
DeletedAt,
Metadata,
GiftCardsTaxable,
AutomaticTaxes,
TaxProviderId,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Serialize , Deserialize)] pub struct Model { pub id : String , pub name : String , pub currency_code : String , pub tax_rate : f32 , pub tax_code : Option < String > , pub created_at : DateTimeWithTimeZone , pub updated_at : DateTimeWithTimeZone , pub deleted_at : Option < DateTimeWithTimeZone > , pub metadata : Option < Json > , pub gift_cards_taxable : bool , pub automatic_taxes : bool , pub tax_provider_id : Option < String > , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
Id,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { Id , Name , CurrencyCode , TaxRate , TaxCode , CreatedAt , UpdatedAt , DeletedAt , Metadata , GiftCardsTaxable , AutomaticTaxes , TaxProviderId , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = String;
fn auto_increment() -> bool {
false
}
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { Id , } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
Carts,
Countries,
Currencies,
GiftCards,
MoneyAmounts,
Orders,
PaymentCollections,
ShippingOptions,
TaxProviders,
TaxRates,
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = String ; fn auto_increment () -> bool { false } } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::Id => ColumnType::String(None).def(),
Self::Name => ColumnType::String(None).def(),
Self::CurrencyCode => ColumnType::String(None).def(),
Self::TaxRate => ColumnType::Float.def(),
Self::TaxCode => ColumnType::String(None).def().null(),
Self::CreatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::UpdatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::DeletedAt => ColumnType::TimestampWithTimeZone.def().null(),
Self::Metadata => ColumnType::JsonBinary.def().null(),
Self::GiftCardsTaxable => ColumnType::Boolean.def(),
Self::AutomaticTaxes => ColumnType::Boolean.def(),
Self::TaxProviderId => ColumnType::String(None).def().null(),
}
}
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { Carts , Countries , Currencies , GiftCards , MoneyAmounts , Orders , PaymentCollections , ShippingOptions , TaxProviders , TaxRates , } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
match self {
Self::Carts => Entity::has_many(super::carts::Entity).into(),
Self::Countries => Entity::has_many(super::countries::Entity).into(),
Self::Currencies => Entity::belongs_to(super::currencies::Entity)
.from(Column::CurrencyCode)
.to(super::currencies::Column::Code)
.into(),
Self::GiftCards => Entity::has_many(super::gift_cards::Entity).into(),
Self::MoneyAmounts => Entity::has_many(super::money_amounts::Entity).into(),
Self::Orders => Entity::has_many(super::orders::Entity).into(),
Self::PaymentCollections => Entity::has_many(super::payment_collections::Entity).into(),
Self::ShippingOptions => Entity::has_many(super::shipping_options::Entity).into(),
Self::TaxProviders => Entity::belongs_to(super::tax_providers::Entity)
.from(Column::TaxProviderId)
.to(super::tax_providers::Column::Id)
.into(),
Self::TaxRates => Entity::has_many(super::tax_rates::Entity).into(),
}
}
}
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: Id => ColumnType :: String (None) . def () , Self :: Name => ColumnType :: String (None) . def () , Self :: CurrencyCode => ColumnType :: String (None) . def () , Self :: TaxRate => ColumnType :: Float . def () , Self :: TaxCode => ColumnType :: String (None) . def () . null () , Self :: CreatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: UpdatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: DeletedAt => ColumnType :: TimestampWithTimeZone . def () . null () , Self :: Metadata => ColumnType :: JsonBinary . def () . null () , Self :: GiftCardsTaxable => ColumnType :: Boolean . def () , Self :: AutomaticTaxes => ColumnType :: Boolean . def () , Self :: TaxProviderId => ColumnType :: String (None) . def () . null () , } } } impl Related<super::carts::Entity> for Entity {
fn to() -> RelationDef {
Relation::Carts.def()
}
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: Carts => Entity :: has_many (super :: carts :: Entity) . into () , Self :: Countries => Entity :: has_many (super :: countries :: Entity) . into () , Self :: Currencies => Entity :: belongs_to (super :: currencies :: Entity) . from (Column :: CurrencyCode) . to (super :: currencies :: Column :: Code) . into () , Self :: GiftCards => Entity :: has_many (super :: gift_cards :: Entity) . into () , Self :: MoneyAmounts => Entity :: has_many (super :: money_amounts :: Entity) . into () , Self :: Orders => Entity :: has_many (super :: orders :: Entity) . into () , Self :: PaymentCollections => Entity :: has_many (super :: payment_collections :: Entity) . into () , Self :: ShippingOptions => Entity :: has_many (super :: shipping_options :: Entity) . into () , Self :: TaxProviders => Entity :: belongs_to (super :: tax_providers :: Entity) . from (Column :: TaxProviderId) . to (super :: tax_providers :: Column :: Id) . into () , Self :: TaxRates => Entity :: has_many (super :: tax_rates :: Entity) . into () , } } } impl Related<super::countries::Entity> for Entity {
fn to() -> RelationDef {
Relation::Countries.def()
}
}
impl Related < super :: carts :: Entity > for Entity { fn to () -> RelationDef { Relation :: Carts . def () } } impl Related<super::currencies::Entity> for Entity {
fn to() -> RelationDef {
Relation::Currencies.def()
}
}
impl Related < super :: countries :: Entity > for Entity { fn to () -> RelationDef { Relation :: Countries . def () } } impl Related<super::gift_cards::Entity> for Entity {
fn to() -> RelationDef {
Relation::GiftCards.def()
}
}
impl Related < super :: currencies :: Entity > for Entity { fn to () -> RelationDef { Relation :: Currencies . def () } } impl Related<super::money_amounts::Entity> for Entity {
fn to() -> RelationDef {
Relation::MoneyAmounts.def()
}
}
impl Related < super :: gift_cards :: Entity > for Entity { fn to () -> RelationDef { Relation :: GiftCards . def () } } impl Related<super::orders::Entity> for Entity {
fn to() -> RelationDef {
Relation::Orders.def()
}
}
impl Related < super :: money_amounts :: Entity > for Entity { fn to () -> RelationDef { Relation :: MoneyAmounts . def () } } impl Related<super::payment_collections::Entity> for Entity {
fn to() -> RelationDef {
Relation::PaymentCollections.def()
}
}
impl Related < super :: orders :: Entity > for Entity { fn to () -> RelationDef { Relation :: Orders . def () } } impl Related<super::shipping_options::Entity> for Entity {
fn to() -> RelationDef {
Relation::ShippingOptions.def()
}
}
impl Related < super :: payment_collections :: Entity > for Entity { fn to () -> RelationDef { Relation :: PaymentCollections . def () } } impl Related<super::tax_providers::Entity> for Entity {
fn to() -> RelationDef {
Relation::TaxProviders.def()
}
}
impl Related < super :: shipping_options :: Entity > for Entity { fn to () -> RelationDef { Relation :: ShippingOptions . def () } } impl Related<super::tax_rates::Entity> for Entity {
fn to() -> RelationDef {
Relation::TaxRates.def()
}
}
impl Related < super :: tax_providers :: Entity > for Entity { fn to () -> RelationDef { Relation :: TaxProviders . def () } } impl Related<super::fulfillment_providers::Entity> for Entity {
fn to() -> RelationDef {
super::region_fulfillment_providers::Relation::FulfillmentProviders.def()
}
fn via() -> Option<RelationDef> {
Some(
super::region_fulfillment_providers::Relation::Regions
.def()
.rev(),
)
}
}
impl Related < super :: tax_rates :: Entity > for Entity { fn to () -> RelationDef { Relation :: TaxRates . def () } } impl Related<super::payment_providers::Entity> for Entity {
fn to() -> RelationDef {
super::region_payment_providers::Relation::PaymentProviders.def()
}
fn via() -> Option<RelationDef> {
Some(
super::region_payment_providers::Relation::Regions
.def()
.rev(),
)
}
}
impl Related < super :: fulfillment_providers :: Entity > for Entity { fn to () -> RelationDef { super :: region_fulfillment_providers :: Relation :: FulfillmentProviders . def () } fn via () -> Option < RelationDef > { Some (super :: region_fulfillment_providers :: Relation :: Regions . def () . rev ()) } } impl Related<super::discounts::Entity> for Entity {
fn to() -> RelationDef {
impl Related < super :: payment_providers :: Entity > for Entity { fn to () -> RelationDef { super :: region_payment_providers :: Relation :: PaymentProviders . def () } fn via () -> Option < RelationDef > { Some (super :: region_payment_providers :: Relation :: Regions . def () . rev ()) } } super::discount_regions::Relation::Discounts.def()
}
impl Related < super :: discounts :: Entity > for Entity { fn to () -> RelationDef { super :: discount_regions :: Relation :: Discounts . def () } fn via () -> Option < RelationDef > { Some (super :: discount_regions :: Relation :: Regions . def () . rev ()) } } fn via() -> Option<RelationDef> {
Some(super::discount_regions::Relation::Regions.def().rev())
}
}
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,31 +1,115 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `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;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"return_items"
}
}
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub return_id: String,
pub item_id: String,
pub quantity: i32,
pub is_requested: bool,
pub requested_quantity: Option<i32>,
pub received_quantity: Option<i32>,
pub metadata: Option<Json>,
pub reason_id: Option<String>,
pub note: Option<String>,
}
impl EntityName for Entity { fn table_name (& self) -> & str { "return_items" } } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
ReturnId,
ItemId,
Quantity,
IsRequested,
RequestedQuantity,
ReceivedQuantity,
Metadata,
ReasonId,
Note,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub return_id : String , pub item_id : String , pub quantity : i32 , pub is_requested : bool , pub requested_quantity : Option < i32 > , pub received_quantity : Option < i32 > , pub metadata : Option < Json > , pub reason_id : Option < String > , pub note : Option < String > , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
ReturnId,
ItemId,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { ReturnId , ItemId , Quantity , IsRequested , RequestedQuantity , ReceivedQuantity , Metadata , ReasonId , Note , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = (String, String);
fn auto_increment() -> bool {
false
}
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { ReturnId , ItemId , } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
LineItems,
ReturnReasons,
Returns,
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = (String , String) ; fn auto_increment () -> bool { false } } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::ReturnId => ColumnType::String(None).def(),
Self::ItemId => ColumnType::String(None).def(),
Self::Quantity => ColumnType::Integer.def(),
Self::IsRequested => ColumnType::Boolean.def(),
Self::RequestedQuantity => ColumnType::Integer.def().null(),
Self::ReceivedQuantity => ColumnType::Integer.def().null(),
Self::Metadata => ColumnType::JsonBinary.def().null(),
Self::ReasonId => ColumnType::String(None).def().null(),
Self::Note => ColumnType::String(None).def().null(),
}
}
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { LineItems , ReturnReasons , Returns , } 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(),
Self::ReturnReasons => Entity::belongs_to(super::return_reasons::Entity)
.from(Column::ReasonId)
.to(super::return_reasons::Column::Id)
.into(),
Self::Returns => Entity::belongs_to(super::returns::Entity)
.from(Column::ReturnId)
.to(super::returns::Column::Id)
.into(),
}
}
}
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: ReturnId => ColumnType :: String (None) . def () , Self :: ItemId => ColumnType :: String (None) . def () , Self :: Quantity => ColumnType :: Integer . def () , Self :: IsRequested => ColumnType :: Boolean . def () , Self :: RequestedQuantity => ColumnType :: Integer . def () . null () , Self :: ReceivedQuantity => ColumnType :: Integer . def () . null () , Self :: Metadata => ColumnType :: JsonBinary . def () . null () , Self :: ReasonId => ColumnType :: String (None) . def () . null () , Self :: Note => ColumnType :: String (None) . def () . null () , } } } impl Related<super::line_items::Entity> for Entity {
fn to() -> RelationDef {
Relation::LineItems.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 () , Self :: ReturnReasons => Entity :: belongs_to (super :: return_reasons :: Entity) . from (Column :: ReasonId) . to (super :: return_reasons :: Column :: Id) . into () , Self :: Returns => Entity :: belongs_to (super :: returns :: Entity) . from (Column :: ReturnId) . to (super :: returns :: Column :: Id) . into () , } } } impl Related<super::return_reasons::Entity> for Entity {
fn to() -> RelationDef {
Relation::ReturnReasons.def()
}
}
impl Related < super :: line_items :: Entity > for Entity { fn to () -> RelationDef { Relation :: LineItems . def () } } impl Related<super::returns::Entity> for Entity {
fn to() -> RelationDef {
impl Related < super :: return_reasons :: Entity > for Entity { fn to () -> RelationDef { Relation :: ReturnReasons . def () } } Relation::Returns.def()
}
impl Related < super :: returns :: Entity > for Entity { fn to () -> RelationDef { Relation :: Returns . def () } } }
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,27 +1,94 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `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;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"return_reasons"
}
}
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub id: String,
pub value: String,
pub label: String,
pub description: Option<String>,
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
pub deleted_at: Option<DateTimeWithTimeZone>,
pub metadata: Option<Json>,
pub parent_return_reason_id: Option<String>,
}
impl EntityName for Entity { fn table_name (& self) -> & str { "return_reasons" } } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
Id,
Value,
Label,
Description,
CreatedAt,
UpdatedAt,
DeletedAt,
Metadata,
ParentReturnReasonId,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub id : String , pub value : String , pub label : String , pub description : Option < String > , pub created_at : DateTimeWithTimeZone , pub updated_at : DateTimeWithTimeZone , pub deleted_at : Option < DateTimeWithTimeZone > , pub metadata : Option < Json > , pub parent_return_reason_id : Option < String > , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
Id,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { Id , Value , Label , Description , CreatedAt , UpdatedAt , DeletedAt , Metadata , ParentReturnReasonId , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = String;
fn auto_increment() -> bool {
false
}
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { Id , } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
ReturnItems,
SelfRef,
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = String ; fn auto_increment () -> bool { false } } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::Id => ColumnType::String(None).def(),
Self::Value => ColumnType::String(None).def(),
Self::Label => ColumnType::String(None).def(),
Self::Description => ColumnType::String(None).def().null(),
Self::CreatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::UpdatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::DeletedAt => ColumnType::TimestampWithTimeZone.def().null(),
Self::Metadata => ColumnType::JsonBinary.def().null(),
Self::ParentReturnReasonId => ColumnType::String(None).def().null(),
}
}
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { ReturnItems , SelfRef , } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
match self {
Self::ReturnItems => Entity::has_many(super::return_items::Entity).into(),
Self::SelfRef => Entity::belongs_to(Entity)
.from(Column::ParentReturnReasonId)
.to(Column::Id)
.into(),
}
}
}
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: Id => ColumnType :: String (None) . def () , Self :: Value => ColumnType :: String (None) . def () , Self :: Label => ColumnType :: String (None) . def () , Self :: Description => ColumnType :: String (None) . def () . null () , Self :: CreatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: UpdatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: DeletedAt => ColumnType :: TimestampWithTimeZone . def () . null () , Self :: Metadata => ColumnType :: JsonBinary . def () . null () , Self :: ParentReturnReasonId => ColumnType :: String (None) . def () . null () , } } } impl Related<super::return_items::Entity> for Entity {
fn to() -> RelationDef {
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: ReturnItems => Entity :: has_many (super :: return_items :: Entity) . into () , Self :: SelfRef => Entity :: belongs_to (Entity) . from (Column :: ParentReturnReasonId) . to (Column :: Id) . into () , } } } Relation::ReturnItems.def()
}
impl Related < super :: return_items :: Entity > for Entity { fn to () -> RelationDef { Relation :: ReturnItems . def () } } }
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,35 +1,147 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
use super::sea_orm_active_enums::ReturnStatuses;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; use super :: sea_orm_active_enums :: ReturnStatuses ; #[derive(Copy, Clone, Default, Debug, DeriveEntity)]
pub struct Entity;
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"returns"
}
}
impl EntityName for Entity { fn table_name (& self) -> & str { "returns" } } #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub id: String,
pub status: ReturnStatuses,
pub swap_id: Option<String>,
pub order_id: Option<String>,
pub shipping_data: Option<Json>,
pub refund_amount: i32,
pub received_at: Option<DateTimeWithTimeZone>,
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
pub metadata: Option<Json>,
pub idempotency_key: Option<String>,
pub claim_order_id: Option<String>,
pub no_notification: Option<bool>,
pub location_id: Option<String>,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub id : String , pub status : ReturnStatuses , pub swap_id : Option < String > , pub order_id : Option < String > , pub shipping_data : Option < Json > , pub refund_amount : i32 , pub received_at : Option < DateTimeWithTimeZone > , pub created_at : DateTimeWithTimeZone , pub updated_at : DateTimeWithTimeZone , pub metadata : Option < Json > , pub idempotency_key : Option < String > , pub claim_order_id : Option < String > , pub no_notification : Option < bool > , pub location_id : Option < String > , } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
Id,
Status,
SwapId,
OrderId,
ShippingData,
RefundAmount,
ReceivedAt,
CreatedAt,
UpdatedAt,
Metadata,
IdempotencyKey,
ClaimOrderId,
NoNotification,
LocationId,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { Id , Status , SwapId , OrderId , ShippingData , RefundAmount , ReceivedAt , CreatedAt , UpdatedAt , Metadata , IdempotencyKey , ClaimOrderId , NoNotification , LocationId , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
Id,
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { Id , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = String;
fn auto_increment() -> bool {
false
}
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = String ; fn auto_increment () -> bool { false } } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
ClaimOrders,
Orders,
ReturnItems,
ShippingMethods,
Swaps,
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { ClaimOrders , Orders , ReturnItems , ShippingMethods , Swaps , } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::Id => ColumnType::String(None).def(),
Self::Status => ReturnStatuses::db_type().def(),
Self::SwapId => ColumnType::String(None).def().null().unique(),
Self::OrderId => ColumnType::String(None).def().null(),
Self::ShippingData => ColumnType::JsonBinary.def().null(),
Self::RefundAmount => ColumnType::Integer.def(),
Self::ReceivedAt => ColumnType::TimestampWithTimeZone.def().null(),
Self::CreatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::UpdatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::Metadata => ColumnType::JsonBinary.def().null(),
Self::IdempotencyKey => ColumnType::String(None).def().null(),
Self::ClaimOrderId => ColumnType::String(None).def().null().unique(),
Self::NoNotification => ColumnType::Boolean.def().null(),
Self::LocationId => ColumnType::String(None).def().null(),
}
}
}
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: Id => ColumnType :: String (None) . def () , Self :: Status => ReturnStatuses :: db_type () . def () , Self :: SwapId => ColumnType :: String (None) . def () . null () . unique () , Self :: OrderId => ColumnType :: String (None) . def () . null () , Self :: ShippingData => ColumnType :: JsonBinary . def () . null () , Self :: RefundAmount => ColumnType :: Integer . def () , Self :: ReceivedAt => ColumnType :: TimestampWithTimeZone . def () . null () , Self :: CreatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: UpdatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: Metadata => ColumnType :: JsonBinary . def () . null () , Self :: IdempotencyKey => ColumnType :: String (None) . def () . null () , Self :: ClaimOrderId => ColumnType :: String (None) . def () . null () . unique () , Self :: NoNotification => ColumnType :: Boolean . def () . null () , Self :: LocationId => ColumnType :: String (None) . def () . null () , } } } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
match self {
Self::ClaimOrders => Entity::belongs_to(super::claim_orders::Entity)
.from(Column::ClaimOrderId)
.to(super::claim_orders::Column::Id)
.into(),
Self::Orders => Entity::belongs_to(super::orders::Entity)
.from(Column::OrderId)
.to(super::orders::Column::Id)
.into(),
Self::ReturnItems => Entity::has_many(super::return_items::Entity).into(),
Self::ShippingMethods => Entity::has_one(super::shipping_methods::Entity).into(),
Self::Swaps => Entity::belongs_to(super::swaps::Entity)
.from(Column::SwapId)
.to(super::swaps::Column::Id)
.into(),
}
}
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: ClaimOrders => Entity :: belongs_to (super :: claim_orders :: Entity) . from (Column :: ClaimOrderId) . to (super :: claim_orders :: Column :: Id) . into () , Self :: Orders => Entity :: belongs_to (super :: orders :: Entity) . from (Column :: OrderId) . to (super :: orders :: Column :: Id) . into () , Self :: ReturnItems => Entity :: has_many (super :: return_items :: Entity) . into () , Self :: ShippingMethods => Entity :: has_one (super :: shipping_methods :: Entity) . into () , Self :: Swaps => Entity :: belongs_to (super :: swaps :: Entity) . from (Column :: SwapId) . to (super :: swaps :: Column :: Id) . into () , } } } impl Related<super::claim_orders::Entity> for Entity {
fn to() -> RelationDef {
Relation::ClaimOrders.def()
}
}
impl Related < super :: claim_orders :: Entity > for Entity { fn to () -> RelationDef { Relation :: ClaimOrders . def () } } impl Related<super::orders::Entity> for Entity {
fn to() -> RelationDef {
Relation::Orders.def()
}
}
impl Related < super :: orders :: Entity > for Entity { fn to () -> RelationDef { Relation :: Orders . def () } } impl Related<super::return_items::Entity> for Entity {
fn to() -> RelationDef {
Relation::ReturnItems.def()
}
}
impl Related < super :: return_items :: Entity > for Entity { fn to () -> RelationDef { Relation :: ReturnItems . def () } } impl Related<super::shipping_methods::Entity> for Entity {
fn to() -> RelationDef {
Relation::ShippingMethods.def()
}
}
impl Related < super :: shipping_methods :: Entity > for Entity { fn to () -> RelationDef { Relation :: ShippingMethods . def () } } impl Related<super::swaps::Entity> for Entity {
fn to() -> RelationDef {
impl Related < super :: swaps :: Entity > for Entity { fn to () -> RelationDef { Relation :: Swaps . def () } } Relation::Swaps.def()
}
}
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,25 +1,70 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `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;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"sales_channel_locations"
}
}
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub id: String,
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
pub sales_channel_id: String,
pub location_id: String,
pub deleted_at: Option<DateTimeWithTimeZone>,
}
impl EntityName for Entity { fn table_name (& self) -> & str { "sales_channel_locations" } } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
Id,
CreatedAt,
UpdatedAt,
SalesChannelId,
LocationId,
DeletedAt,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub id : String , pub created_at : DateTimeWithTimeZone , pub updated_at : DateTimeWithTimeZone , pub sales_channel_id : String , pub location_id : String , pub deleted_at : Option < DateTimeWithTimeZone > , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
Id,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { Id , CreatedAt , UpdatedAt , SalesChannelId , LocationId , DeletedAt , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = String;
fn auto_increment() -> bool {
false
}
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { Id , } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = String ; fn auto_increment () -> bool { false } } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::Id => ColumnType::String(None).def(),
Self::CreatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::UpdatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::SalesChannelId => ColumnType::Text.def(),
Self::LocationId => ColumnType::Text.def(),
Self::DeletedAt => ColumnType::TimestampWithTimeZone.def().null(),
}
}
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: Id => ColumnType :: String (None) . def () , Self :: CreatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: UpdatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: SalesChannelId => ColumnType :: Text . def () , Self :: LocationId => ColumnType :: Text . def () , Self :: DeletedAt => ColumnType :: TimestampWithTimeZone . def () . null () , } } } panic!("No RelationDef")
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { panic ! ("No RelationDef") } } }
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,33 +1,115 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `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;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"sales_channels"
}
}
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub id: String,
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
pub deleted_at: Option<DateTimeWithTimeZone>,
pub name: String,
pub description: Option<String>,
pub is_disabled: bool,
pub metadata: Option<Json>,
}
impl EntityName for Entity { fn table_name (& self) -> & str { "sales_channels" } } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
Id,
CreatedAt,
UpdatedAt,
DeletedAt,
Name,
Description,
IsDisabled,
Metadata,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub id : String , pub created_at : DateTimeWithTimeZone , pub updated_at : DateTimeWithTimeZone , pub deleted_at : Option < DateTimeWithTimeZone > , pub name : String , pub description : Option < String > , pub is_disabled : bool , pub metadata : Option < Json > , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
Id,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { Id , CreatedAt , UpdatedAt , DeletedAt , Name , Description , IsDisabled , Metadata , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = String;
fn auto_increment() -> bool {
false
}
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { Id , } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
Carts,
Orders,
Stores,
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = String ; fn auto_increment () -> bool { false } } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::Id => ColumnType::String(None).def(),
Self::CreatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::UpdatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::DeletedAt => ColumnType::TimestampWithTimeZone.def().null(),
Self::Name => ColumnType::String(None).def(),
Self::Description => ColumnType::String(None).def().null(),
Self::IsDisabled => ColumnType::Boolean.def(),
Self::Metadata => ColumnType::JsonBinary.def().null(),
}
}
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { Carts , Orders , Stores , } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
match self {
Self::Carts => Entity::has_many(super::carts::Entity).into(),
Self::Orders => Entity::has_many(super::orders::Entity).into(),
Self::Stores => Entity::has_one(super::stores::Entity).into(),
}
}
}
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: Id => ColumnType :: String (None) . def () , Self :: CreatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: UpdatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: DeletedAt => ColumnType :: TimestampWithTimeZone . def () . null () , Self :: Name => ColumnType :: String (None) . def () , Self :: Description => ColumnType :: String (None) . def () . null () , Self :: IsDisabled => ColumnType :: Boolean . def () , Self :: Metadata => ColumnType :: JsonBinary . def () . null () , } } } impl Related<super::carts::Entity> for Entity {
fn to() -> RelationDef {
Relation::Carts.def()
}
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: Carts => Entity :: has_many (super :: carts :: Entity) . into () , Self :: Orders => Entity :: has_many (super :: orders :: Entity) . into () , Self :: Stores => Entity :: has_one (super :: stores :: Entity) . into () , } } } impl Related<super::orders::Entity> for Entity {
fn to() -> RelationDef {
Relation::Orders.def()
}
}
impl Related < super :: carts :: Entity > for Entity { fn to () -> RelationDef { Relation :: Carts . def () } } impl Related<super::stores::Entity> for Entity {
fn to() -> RelationDef {
Relation::Stores.def()
}
}
impl Related < super :: orders :: Entity > for Entity { fn to () -> RelationDef { Relation :: Orders . def () } } impl Related<super::products::Entity> for Entity {
fn to() -> RelationDef {
impl Related < super :: stores :: Entity > for Entity { fn to () -> RelationDef { Relation :: Stores . def () } } super::product_sales_channels::Relation::Products.def()
}
impl Related < super :: products :: Entity > for Entity { fn to () -> RelationDef { super :: product_sales_channels :: Relation :: Products . def () } fn via () -> Option < RelationDef > { Some (super :: product_sales_channels :: Relation :: SalesChannels . def () . rev ()) } } fn via() -> Option<RelationDef> {
Some(
super::product_sales_channels::Relation::SalesChannels
.def()
.rev(),
)
}
}
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,33 +1,431 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
# [derive (Debug , Clone , PartialEq , Eq , EnumIter , DeriveActiveEnum , Serialize , Deserialize)] # [sea_orm (rs_type = "String" , db_type = "Enum" , enum_name = "cart_types")] pub enum CartTypes { # [sea_orm (string_value = "claim")] Claim , # [sea_orm (string_value = "default")] Default , # [sea_orm (string_value = "draft_order")] DraftOrder , # [sea_orm (string_value = "payment_link")] PaymentLink , # [sea_orm (string_value = "swap")] Swap , } #[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
# [derive (Debug , Clone , PartialEq , Eq , EnumIter , DeriveActiveEnum , Serialize , Deserialize)] # [sea_orm (rs_type = "String" , db_type = "Enum" , enum_name = "claim_item_reasons")] pub enum ClaimItemReasons { # [sea_orm (string_value = "missing_item")] MissingItem , # [sea_orm (string_value = "other")] Other , # [sea_orm (string_value = "production_failure")] ProductionFailure , # [sea_orm (string_value = "wrong_item")] WrongItem , } #[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "cart_types")]
# [derive (Debug , Clone , PartialEq , Eq , EnumIter , DeriveActiveEnum , Serialize , Deserialize)] # [sea_orm (rs_type = "String" , db_type = "Enum" , enum_name = "claim_order_fulfillment_statuses")] pub enum ClaimOrderFulfillmentStatuses { # [sea_orm (string_value = "canceled")] Canceled , # [sea_orm (string_value = "fulfilled")] Fulfilled , # [sea_orm (string_value = "not_fulfilled")] NotFulfilled , # [sea_orm (string_value = "partially_fulfilled")] PartiallyFulfilled , # [sea_orm (string_value = "partially_returned")] PartiallyReturned , # [sea_orm (string_value = "partially_shipped")] PartiallyShipped , # [sea_orm (string_value = "requires_action")] RequiresAction , # [sea_orm (string_value = "returned")] Returned , # [sea_orm (string_value = "shipped")] Shipped , } pub enum CartTypes {
# [derive (Debug , Clone , PartialEq , Eq , EnumIter , DeriveActiveEnum , Serialize , Deserialize)] # [sea_orm (rs_type = "String" , db_type = "Enum" , enum_name = "claim_order_payment_statuses")] pub enum ClaimOrderPaymentStatuses { # [sea_orm (string_value = "na")] Na , # [sea_orm (string_value = "not_refunded")] NotRefunded , # [sea_orm (string_value = "refunded")] Refunded , } #[sea_orm(string_value = "claim")]
# [derive (Debug , Clone , PartialEq , Eq , EnumIter , DeriveActiveEnum , Serialize , Deserialize)] # [sea_orm (rs_type = "String" , db_type = "Enum" , enum_name = "claim_order_types")] pub enum ClaimOrderTypes { # [sea_orm (string_value = "refund")] Refund , # [sea_orm (string_value = "replace")] Replace , } Claim,
# [derive (Debug , Clone , PartialEq , Eq , EnumIter , DeriveActiveEnum , Serialize , Deserialize)] # [sea_orm (rs_type = "String" , db_type = "Enum" , enum_name = "discount_condition_operators")] pub enum DiscountConditionOperators { # [sea_orm (string_value = "in")] In , # [sea_orm (string_value = "not_in")] NotIn , } #[sea_orm(string_value = "default")]
# [derive (Debug , Clone , PartialEq , Eq , EnumIter , DeriveActiveEnum , Serialize , Deserialize)] # [sea_orm (rs_type = "String" , db_type = "Enum" , enum_name = "discount_condition_types")] pub enum DiscountConditionTypes { # [sea_orm (string_value = "customer_groups")] CustomerGroups , # [sea_orm (string_value = "product_collections")] ProductCollections , # [sea_orm (string_value = "product_tags")] ProductTags , # [sea_orm (string_value = "product_types")] ProductTypes , # [sea_orm (string_value = "products")] Products , } Default,
# [derive (Debug , Clone , PartialEq , Eq , EnumIter , DeriveActiveEnum , Serialize , Deserialize)] # [sea_orm (rs_type = "String" , db_type = "Enum" , enum_name = "discount_rule_allocations")] pub enum DiscountRuleAllocations { # [sea_orm (string_value = "item")] Item , # [sea_orm (string_value = "total")] Total , } #[sea_orm(string_value = "draft_order")]
# [derive (Debug , Clone , PartialEq , Eq , EnumIter , DeriveActiveEnum , Serialize , Deserialize)] # [sea_orm (rs_type = "String" , db_type = "Enum" , enum_name = "discount_rule_types")] pub enum DiscountRuleTypes { # [sea_orm (string_value = "fixed")] Fixed , # [sea_orm (string_value = "free_shipping")] FreeShipping , # [sea_orm (string_value = "percentage")] Percentage , } DraftOrder,
# [derive (Debug , Clone , PartialEq , Eq , EnumIter , DeriveActiveEnum , Serialize , Deserialize)] # [sea_orm (rs_type = "String" , db_type = "Enum" , enum_name = "draft_order_statuses")] pub enum DraftOrderStatuses { # [sea_orm (string_value = "completed")] Completed , # [sea_orm (string_value = "open")] Open , } #[sea_orm(string_value = "payment_link")]
# [derive (Debug , Clone , PartialEq , Eq , EnumIter , DeriveActiveEnum , Serialize , Deserialize)] # [sea_orm (rs_type = "String" , db_type = "Enum" , enum_name = "invite_roles")] pub enum InviteRoles { # [sea_orm (string_value = "admin")] Admin , # [sea_orm (string_value = "developer")] Developer , # [sea_orm (string_value = "member")] Member , } PaymentLink,
# [derive (Debug , Clone , PartialEq , Eq , EnumIter , DeriveActiveEnum , Serialize , Deserialize)] # [sea_orm (rs_type = "String" , db_type = "Enum" , enum_name = "order_fulfillment_statuses")] pub enum OrderFulfillmentStatuses { # [sea_orm (string_value = "canceled")] Canceled , # [sea_orm (string_value = "fulfilled")] Fulfilled , # [sea_orm (string_value = "not_fulfilled")] NotFulfilled , # [sea_orm (string_value = "partially_fulfilled")] PartiallyFulfilled , # [sea_orm (string_value = "partially_returned")] PartiallyReturned , # [sea_orm (string_value = "partially_shipped")] PartiallyShipped , # [sea_orm (string_value = "requires_action")] RequiresAction , # [sea_orm (string_value = "returned")] Returned , # [sea_orm (string_value = "shipped")] Shipped , } #[sea_orm(string_value = "swap")]
# [derive (Debug , Clone , PartialEq , Eq , EnumIter , DeriveActiveEnum , Serialize , Deserialize)] # [sea_orm (rs_type = "String" , db_type = "Enum" , enum_name = "order_item_change_types")] pub enum OrderItemChangeTypes { # [sea_orm (string_value = "item_add")] ItemAdd , # [sea_orm (string_value = "item_remove")] ItemRemove , # [sea_orm (string_value = "item_update")] ItemUpdate , } Swap,
# [derive (Debug , Clone , PartialEq , Eq , EnumIter , DeriveActiveEnum , Serialize , Deserialize)] # [sea_orm (rs_type = "String" , db_type = "Enum" , enum_name = "order_payment_statuses")] pub enum OrderPaymentStatuses { # [sea_orm (string_value = "awaiting")] Awaiting , # [sea_orm (string_value = "canceled")] Canceled , # [sea_orm (string_value = "captured")] Captured , # [sea_orm (string_value = "not_paid")] NotPaid , # [sea_orm (string_value = "partially_refunded")] PartiallyRefunded , # [sea_orm (string_value = "refunded")] Refunded , # [sea_orm (string_value = "requires_action")] RequiresAction , } }
# [derive (Debug , Clone , PartialEq , Eq , EnumIter , DeriveActiveEnum , Serialize , Deserialize)] # [sea_orm (rs_type = "String" , db_type = "Enum" , enum_name = "order_statuses")] pub enum OrderStatuses { # [sea_orm (string_value = "archived")] Archived , # [sea_orm (string_value = "canceled")] Canceled , # [sea_orm (string_value = "completed")] Completed , # [sea_orm (string_value = "pending")] Pending , # [sea_orm (string_value = "requires_action")] RequiresAction , } #[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
# [derive (Debug , Clone , PartialEq , Eq , EnumIter , DeriveActiveEnum , Serialize , Deserialize)] # [sea_orm (rs_type = "String" , db_type = "Enum" , enum_name = "payment_collection_statuses")] pub enum PaymentCollectionStatuses { # [sea_orm (string_value = "authorized")] Authorized , # [sea_orm (string_value = "awaiting")] Awaiting , # [sea_orm (string_value = "canceled")] Canceled , # [sea_orm (string_value = "not_paid")] NotPaid , # [sea_orm (string_value = "partially_authorized")] PartiallyAuthorized , } #[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "claim_item_reasons")]
# [derive (Debug , Clone , PartialEq , Eq , EnumIter , DeriveActiveEnum , Serialize , Deserialize)] # [sea_orm (rs_type = "String" , db_type = "Enum" , enum_name = "payment_collection_types")] pub enum PaymentCollectionTypes { # [sea_orm (string_value = "order_edit")] OrderEdit , } pub enum ClaimItemReasons {
# [derive (Debug , Clone , PartialEq , Eq , EnumIter , DeriveActiveEnum , Serialize , Deserialize)] # [sea_orm (rs_type = "String" , db_type = "Enum" , enum_name = "payment_session_statuses")] pub enum PaymentSessionStatuses { # [sea_orm (string_value = "authorized")] Authorized , # [sea_orm (string_value = "canceled")] Canceled , # [sea_orm (string_value = "error")] Error , # [sea_orm (string_value = "pending")] Pending , # [sea_orm (string_value = "requires_more")] RequiresMore , } #[sea_orm(string_value = "missing_item")]
# [derive (Debug , Clone , PartialEq , Eq , EnumIter , DeriveActiveEnum , Serialize , Deserialize)] # [sea_orm (rs_type = "String" , db_type = "Enum" , enum_name = "price_list_statuses")] pub enum PriceListStatuses { # [sea_orm (string_value = "active")] Active , # [sea_orm (string_value = "draft")] Draft , } MissingItem,
# [derive (Debug , Clone , PartialEq , Eq , EnumIter , DeriveActiveEnum , Serialize , Deserialize)] # [sea_orm (rs_type = "String" , db_type = "Enum" , enum_name = "price_list_types")] pub enum PriceListTypes { # [sea_orm (string_value = "override")] Override , # [sea_orm (string_value = "sale")] Sale , } #[sea_orm(string_value = "other")]
# [derive (Debug , Clone , PartialEq , Eq , EnumIter , DeriveActiveEnum , Serialize , Deserialize)] # [sea_orm (rs_type = "String" , db_type = "Enum" , enum_name = "product_statuses")] pub enum ProductStatuses { # [sea_orm (string_value = "draft")] Draft , # [sea_orm (string_value = "proposed")] Proposed , # [sea_orm (string_value = "published")] Published , # [sea_orm (string_value = "rejected")] Rejected , } Other,
# [derive (Debug , Clone , PartialEq , Eq , EnumIter , DeriveActiveEnum , Serialize , Deserialize)] # [sea_orm (rs_type = "String" , db_type = "Enum" , enum_name = "refund_reasons")] pub enum RefundReasons { # [sea_orm (string_value = "claim")] Claim , # [sea_orm (string_value = "discount")] Discount , # [sea_orm (string_value = "other")] Other , # [sea_orm (string_value = "return")] Return , # [sea_orm (string_value = "swap")] Swap , } #[sea_orm(string_value = "production_failure")]
# [derive (Debug , Clone , PartialEq , Eq , EnumIter , DeriveActiveEnum , Serialize , Deserialize)] # [sea_orm (rs_type = "String" , db_type = "Enum" , enum_name = "return_statuses")] pub enum ReturnStatuses { # [sea_orm (string_value = "canceled")] Canceled , # [sea_orm (string_value = "received")] Received , # [sea_orm (string_value = "requested")] Requested , # [sea_orm (string_value = "requires_action")] RequiresAction , } ProductionFailure,
# [derive (Debug , Clone , PartialEq , Eq , EnumIter , DeriveActiveEnum , Serialize , Deserialize)] # [sea_orm (rs_type = "String" , db_type = "Enum" , enum_name = "shipping_option_price_types")] pub enum ShippingOptionPriceTypes { # [sea_orm (string_value = "calculated")] Calculated , # [sea_orm (string_value = "flat_rate")] FlatRate , } #[sea_orm(string_value = "wrong_item")]
# [derive (Debug , Clone , PartialEq , Eq , EnumIter , DeriveActiveEnum , Serialize , Deserialize)] # [sea_orm (rs_type = "String" , db_type = "Enum" , enum_name = "shipping_option_requirement_types")] pub enum ShippingOptionRequirementTypes { # [sea_orm (string_value = "max_subtotal")] MaxSubtotal , # [sea_orm (string_value = "min_subtotal")] MinSubtotal , } WrongItem,
# [derive (Debug , Clone , PartialEq , Eq , EnumIter , DeriveActiveEnum , Serialize , Deserialize)] # [sea_orm (rs_type = "String" , db_type = "Enum" , enum_name = "shipping_profile_types")] pub enum ShippingProfileTypes { # [sea_orm (string_value = "custom")] Custom , # [sea_orm (string_value = "default")] Default , # [sea_orm (string_value = "gift_card")] GiftCard , } }
# [derive (Debug , Clone , PartialEq , Eq , EnumIter , DeriveActiveEnum , Serialize , Deserialize)] # [sea_orm (rs_type = "String" , db_type = "Enum" , enum_name = "swap_fulfillment_statuses")] pub enum SwapFulfillmentStatuses { # [sea_orm (string_value = "canceled")] Canceled , # [sea_orm (string_value = "fulfilled")] Fulfilled , # [sea_orm (string_value = "not_fulfilled")] NotFulfilled , # [sea_orm (string_value = "partially_shipped")] PartiallyShipped , # [sea_orm (string_value = "requires_action")] RequiresAction , # [sea_orm (string_value = "shipped")] Shipped , } #[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
# [derive (Debug , Clone , PartialEq , Eq , EnumIter , DeriveActiveEnum , Serialize , Deserialize)] # [sea_orm (rs_type = "String" , db_type = "Enum" , enum_name = "swap_payment_statuses")] pub enum SwapPaymentStatuses { # [sea_orm (string_value = "awaiting")] Awaiting , # [sea_orm (string_value = "canceled")] Canceled , # [sea_orm (string_value = "captured")] Captured , # [sea_orm (string_value = "confirmed")] Confirmed , # [sea_orm (string_value = "difference_refunded")] DifferenceRefunded , # [sea_orm (string_value = "not_paid")] NotPaid , # [sea_orm (string_value = "partially_refunded")] PartiallyRefunded , # [sea_orm (string_value = "refunded")] Refunded , # [sea_orm (string_value = "requires_action")] RequiresAction , } #[sea_orm(
# [derive (Debug , Clone , PartialEq , Eq , EnumIter , DeriveActiveEnum , Serialize , Deserialize)] # [sea_orm (rs_type = "String" , db_type = "Enum" , enum_name = "user_roles")] pub enum UserRoles { # [sea_orm (string_value = "admin")] Admin , # [sea_orm (string_value = "developer")] Developer , # [sea_orm (string_value = "member")] Member , } rs_type = "String",
db_type = "Enum",
enum_name = "claim_order_fulfillment_statuses"
)]
pub enum ClaimOrderFulfillmentStatuses {
#[sea_orm(string_value = "canceled")]
Canceled,
#[sea_orm(string_value = "fulfilled")]
Fulfilled,
#[sea_orm(string_value = "not_fulfilled")]
NotFulfilled,
#[sea_orm(string_value = "partially_fulfilled")]
PartiallyFulfilled,
#[sea_orm(string_value = "partially_returned")]
PartiallyReturned,
#[sea_orm(string_value = "partially_shipped")]
PartiallyShipped,
#[sea_orm(string_value = "requires_action")]
RequiresAction,
#[sea_orm(string_value = "returned")]
Returned,
#[sea_orm(string_value = "shipped")]
Shipped,
}
#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
enum_name = "claim_order_payment_statuses"
)]
pub enum ClaimOrderPaymentStatuses {
#[sea_orm(string_value = "na")]
Na,
#[sea_orm(string_value = "not_refunded")]
NotRefunded,
#[sea_orm(string_value = "refunded")]
Refunded,
}
#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "claim_order_types")]
pub enum ClaimOrderTypes {
#[sea_orm(string_value = "refund")]
Refund,
#[sea_orm(string_value = "replace")]
Replace,
}
#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
enum_name = "discount_condition_operators"
)]
pub enum DiscountConditionOperators {
#[sea_orm(string_value = "in")]
In,
#[sea_orm(string_value = "not_in")]
NotIn,
}
#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
enum_name = "discount_condition_types"
)]
pub enum DiscountConditionTypes {
#[sea_orm(string_value = "customer_groups")]
CustomerGroups,
#[sea_orm(string_value = "product_collections")]
ProductCollections,
#[sea_orm(string_value = "product_tags")]
ProductTags,
#[sea_orm(string_value = "product_types")]
ProductTypes,
#[sea_orm(string_value = "products")]
Products,
}
#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
enum_name = "discount_rule_allocations"
)]
pub enum DiscountRuleAllocations {
#[sea_orm(string_value = "item")]
Item,
#[sea_orm(string_value = "total")]
Total,
}
#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
enum_name = "discount_rule_types"
)]
pub enum DiscountRuleTypes {
#[sea_orm(string_value = "fixed")]
Fixed,
#[sea_orm(string_value = "free_shipping")]
FreeShipping,
#[sea_orm(string_value = "percentage")]
Percentage,
}
#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
enum_name = "draft_order_statuses"
)]
pub enum DraftOrderStatuses {
#[sea_orm(string_value = "completed")]
Completed,
#[sea_orm(string_value = "open")]
Open,
}
#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "invite_roles")]
pub enum InviteRoles {
#[sea_orm(string_value = "admin")]
Admin,
#[sea_orm(string_value = "developer")]
Developer,
#[sea_orm(string_value = "member")]
Member,
}
#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
enum_name = "order_fulfillment_statuses"
)]
pub enum OrderFulfillmentStatuses {
#[sea_orm(string_value = "canceled")]
Canceled,
#[sea_orm(string_value = "fulfilled")]
Fulfilled,
#[sea_orm(string_value = "not_fulfilled")]
NotFulfilled,
#[sea_orm(string_value = "partially_fulfilled")]
PartiallyFulfilled,
#[sea_orm(string_value = "partially_returned")]
PartiallyReturned,
#[sea_orm(string_value = "partially_shipped")]
PartiallyShipped,
#[sea_orm(string_value = "requires_action")]
RequiresAction,
#[sea_orm(string_value = "returned")]
Returned,
#[sea_orm(string_value = "shipped")]
Shipped,
}
#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
enum_name = "order_item_change_types"
)]
pub enum OrderItemChangeTypes {
#[sea_orm(string_value = "item_add")]
ItemAdd,
#[sea_orm(string_value = "item_remove")]
ItemRemove,
#[sea_orm(string_value = "item_update")]
ItemUpdate,
}
#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
enum_name = "order_payment_statuses"
)]
pub enum OrderPaymentStatuses {
#[sea_orm(string_value = "awaiting")]
Awaiting,
#[sea_orm(string_value = "canceled")]
Canceled,
#[sea_orm(string_value = "captured")]
Captured,
#[sea_orm(string_value = "not_paid")]
NotPaid,
#[sea_orm(string_value = "partially_refunded")]
PartiallyRefunded,
#[sea_orm(string_value = "refunded")]
Refunded,
#[sea_orm(string_value = "requires_action")]
RequiresAction,
}
#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "order_statuses")]
pub enum OrderStatuses {
#[sea_orm(string_value = "archived")]
Archived,
#[sea_orm(string_value = "canceled")]
Canceled,
#[sea_orm(string_value = "completed")]
Completed,
#[sea_orm(string_value = "pending")]
Pending,
#[sea_orm(string_value = "requires_action")]
RequiresAction,
}
#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
enum_name = "payment_collection_statuses"
)]
pub enum PaymentCollectionStatuses {
#[sea_orm(string_value = "authorized")]
Authorized,
#[sea_orm(string_value = "awaiting")]
Awaiting,
#[sea_orm(string_value = "canceled")]
Canceled,
#[sea_orm(string_value = "not_paid")]
NotPaid,
#[sea_orm(string_value = "partially_authorized")]
PartiallyAuthorized,
}
#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
enum_name = "payment_collection_types"
)]
pub enum PaymentCollectionTypes {
#[sea_orm(string_value = "order_edit")]
OrderEdit,
}
#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
enum_name = "payment_session_statuses"
)]
pub enum PaymentSessionStatuses {
#[sea_orm(string_value = "authorized")]
Authorized,
#[sea_orm(string_value = "canceled")]
Canceled,
#[sea_orm(string_value = "error")]
Error,
#[sea_orm(string_value = "pending")]
Pending,
#[sea_orm(string_value = "requires_more")]
RequiresMore,
}
#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
enum_name = "price_list_statuses"
)]
pub enum PriceListStatuses {
#[sea_orm(string_value = "active")]
Active,
#[sea_orm(string_value = "draft")]
Draft,
}
#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "price_list_types")]
pub enum PriceListTypes {
#[sea_orm(string_value = "override")]
Override,
#[sea_orm(string_value = "sale")]
Sale,
}
#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "product_statuses")]
pub enum ProductStatuses {
#[sea_orm(string_value = "draft")]
Draft,
#[sea_orm(string_value = "proposed")]
Proposed,
#[sea_orm(string_value = "published")]
Published,
#[sea_orm(string_value = "rejected")]
Rejected,
}
#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "refund_reasons")]
pub enum RefundReasons {
#[sea_orm(string_value = "claim")]
Claim,
#[sea_orm(string_value = "discount")]
Discount,
#[sea_orm(string_value = "other")]
Other,
#[sea_orm(string_value = "return")]
Return,
#[sea_orm(string_value = "swap")]
Swap,
}
#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "return_statuses")]
pub enum ReturnStatuses {
#[sea_orm(string_value = "canceled")]
Canceled,
#[sea_orm(string_value = "received")]
Received,
#[sea_orm(string_value = "requested")]
Requested,
#[sea_orm(string_value = "requires_action")]
RequiresAction,
}
#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
enum_name = "shipping_option_price_types"
)]
pub enum ShippingOptionPriceTypes {
#[sea_orm(string_value = "calculated")]
Calculated,
#[sea_orm(string_value = "flat_rate")]
FlatRate,
}
#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
enum_name = "shipping_option_requirement_types"
)]
pub enum ShippingOptionRequirementTypes {
#[sea_orm(string_value = "max_subtotal")]
MaxSubtotal,
#[sea_orm(string_value = "min_subtotal")]
MinSubtotal,
}
#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
enum_name = "shipping_profile_types"
)]
pub enum ShippingProfileTypes {
#[sea_orm(string_value = "custom")]
Custom,
#[sea_orm(string_value = "default")]
Default,
#[sea_orm(string_value = "gift_card")]
GiftCard,
}
#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
enum_name = "swap_fulfillment_statuses"
)]
pub enum SwapFulfillmentStatuses {
#[sea_orm(string_value = "canceled")]
Canceled,
#[sea_orm(string_value = "fulfilled")]
Fulfilled,
#[sea_orm(string_value = "not_fulfilled")]
NotFulfilled,
#[sea_orm(string_value = "partially_shipped")]
PartiallyShipped,
#[sea_orm(string_value = "requires_action")]
RequiresAction,
#[sea_orm(string_value = "shipped")]
Shipped,
}
#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(
rs_type = "String",
db_type = "Enum",
enum_name = "swap_payment_statuses"
)]
pub enum SwapPaymentStatuses {
#[sea_orm(string_value = "awaiting")]
Awaiting,
#[sea_orm(string_value = "canceled")]
Canceled,
#[sea_orm(string_value = "captured")]
Captured,
#[sea_orm(string_value = "confirmed")]
Confirmed,
#[sea_orm(string_value = "difference_refunded")]
DifferenceRefunded,
#[sea_orm(string_value = "not_paid")]
NotPaid,
#[sea_orm(string_value = "partially_refunded")]
PartiallyRefunded,
#[sea_orm(string_value = "refunded")]
Refunded,
#[sea_orm(string_value = "requires_action")]
RequiresAction,
}
#[derive(Debug, Clone, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "user_roles")]
pub enum UserRoles {
#[sea_orm(string_value = "admin")]
Admin,
#[sea_orm(string_value = "developer")]
Developer,
#[sea_orm(string_value = "member")]
Member,
}

View File

@ -1,27 +1,89 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `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;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"shipping_method_tax_lines"
}
}
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Serialize, Deserialize)]
pub struct Model {
pub id: String,
pub rate: f32,
pub name: String,
pub code: Option<String>,
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
pub metadata: Option<Json>,
pub shipping_method_id: String,
}
impl EntityName for Entity { fn table_name (& self) -> & str { "shipping_method_tax_lines" } } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
Id,
Rate,
Name,
Code,
CreatedAt,
UpdatedAt,
Metadata,
ShippingMethodId,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Serialize , Deserialize)] pub struct Model { pub id : String , pub rate : f32 , pub name : String , pub code : Option < String > , pub created_at : DateTimeWithTimeZone , pub updated_at : DateTimeWithTimeZone , pub metadata : Option < Json > , pub shipping_method_id : String , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
Id,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { Id , Rate , Name , Code , CreatedAt , UpdatedAt , Metadata , ShippingMethodId , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = String;
fn auto_increment() -> bool {
false
}
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { Id , } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
ShippingMethods,
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = String ; fn auto_increment () -> bool { false } } 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::ShippingMethodId => ColumnType::String(None).def(),
}
}
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { ShippingMethods , } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
match self {
Self::ShippingMethods => Entity::belongs_to(super::shipping_methods::Entity)
.from(Column::ShippingMethodId)
.to(super::shipping_methods::Column::Id)
.into(),
}
}
}
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 :: ShippingMethodId => ColumnType :: String (None) . def () , } } } impl Related<super::shipping_methods::Entity> for Entity {
fn to() -> RelationDef {
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: ShippingMethods => Entity :: belongs_to (super :: shipping_methods :: Entity) . from (Column :: ShippingMethodId) . to (super :: shipping_methods :: Column :: Id) . into () , } } } Relation::ShippingMethods.def()
}
impl Related < super :: shipping_methods :: Entity > for Entity { fn to () -> RelationDef { Relation :: ShippingMethods . def () } } }
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,39 +1,157 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `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;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"shipping_methods"
}
}
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub id: String,
pub shipping_option_id: String,
pub order_id: Option<String>,
pub cart_id: Option<String>,
pub swap_id: Option<String>,
pub return_id: Option<String>,
pub price: i32,
pub data: Json,
pub claim_order_id: Option<String>,
}
impl EntityName for Entity { fn table_name (& self) -> & str { "shipping_methods" } } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
Id,
ShippingOptionId,
OrderId,
CartId,
SwapId,
ReturnId,
Price,
Data,
ClaimOrderId,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub id : String , pub shipping_option_id : String , pub order_id : Option < String > , pub cart_id : Option < String > , pub swap_id : Option < String > , pub return_id : Option < String > , pub price : i32 , pub data : Json , pub claim_order_id : Option < String > , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
Id,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { Id , ShippingOptionId , OrderId , CartId , SwapId , ReturnId , Price , Data , ClaimOrderId , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = String;
fn auto_increment() -> bool {
false
}
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { Id , } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
Carts,
ClaimOrders,
Orders,
Returns,
ShippingMethodTaxLines,
ShippingOptions,
Swaps,
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = String ; fn auto_increment () -> bool { false } } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::Id => ColumnType::String(None).def(),
Self::ShippingOptionId => ColumnType::String(None).def(),
Self::OrderId => ColumnType::String(None).def().null(),
Self::CartId => ColumnType::String(None).def().null(),
Self::SwapId => ColumnType::String(None).def().null(),
Self::ReturnId => ColumnType::String(None).def().null().unique(),
Self::Price => ColumnType::Integer.def(),
Self::Data => ColumnType::JsonBinary.def(),
Self::ClaimOrderId => ColumnType::String(None).def().null(),
}
}
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { Carts , ClaimOrders , Orders , Returns , ShippingMethodTaxLines , ShippingOptions , Swaps , } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
match self {
Self::Carts => Entity::belongs_to(super::carts::Entity)
.from(Column::CartId)
.to(super::carts::Column::Id)
.into(),
Self::ClaimOrders => Entity::belongs_to(super::claim_orders::Entity)
.from(Column::ClaimOrderId)
.to(super::claim_orders::Column::Id)
.into(),
Self::Orders => Entity::belongs_to(super::orders::Entity)
.from(Column::OrderId)
.to(super::orders::Column::Id)
.into(),
Self::Returns => Entity::belongs_to(super::returns::Entity)
.from(Column::ReturnId)
.to(super::returns::Column::Id)
.into(),
Self::ShippingMethodTaxLines => {
Entity::has_many(super::shipping_method_tax_lines::Entity).into()
}
Self::ShippingOptions => Entity::belongs_to(super::shipping_options::Entity)
.from(Column::ShippingOptionId)
.to(super::shipping_options::Column::Id)
.into(),
Self::Swaps => Entity::belongs_to(super::swaps::Entity)
.from(Column::SwapId)
.to(super::swaps::Column::Id)
.into(),
}
}
}
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: Id => ColumnType :: String (None) . def () , Self :: ShippingOptionId => ColumnType :: String (None) . def () , Self :: OrderId => ColumnType :: String (None) . def () . null () , Self :: CartId => ColumnType :: String (None) . def () . null () , Self :: SwapId => ColumnType :: String (None) . def () . null () , Self :: ReturnId => ColumnType :: String (None) . def () . null () . unique () , Self :: Price => ColumnType :: Integer . def () , Self :: Data => ColumnType :: JsonBinary . def () , Self :: ClaimOrderId => ColumnType :: String (None) . def () . null () , } } } impl Related<super::carts::Entity> for Entity {
fn to() -> RelationDef {
Relation::Carts.def()
}
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: Carts => Entity :: belongs_to (super :: carts :: Entity) . from (Column :: CartId) . to (super :: carts :: Column :: Id) . into () , Self :: ClaimOrders => Entity :: belongs_to (super :: claim_orders :: Entity) . from (Column :: ClaimOrderId) . to (super :: claim_orders :: Column :: Id) . into () , Self :: Orders => Entity :: belongs_to (super :: orders :: Entity) . from (Column :: OrderId) . to (super :: orders :: Column :: Id) . into () , Self :: Returns => Entity :: belongs_to (super :: returns :: Entity) . from (Column :: ReturnId) . to (super :: returns :: Column :: Id) . into () , Self :: ShippingMethodTaxLines => Entity :: has_many (super :: shipping_method_tax_lines :: Entity) . into () , Self :: ShippingOptions => Entity :: belongs_to (super :: shipping_options :: Entity) . from (Column :: ShippingOptionId) . to (super :: shipping_options :: Column :: Id) . into () , Self :: Swaps => Entity :: belongs_to (super :: swaps :: Entity) . from (Column :: SwapId) . to (super :: swaps :: Column :: Id) . into () , } } } impl Related<super::claim_orders::Entity> for Entity {
fn to() -> RelationDef {
Relation::ClaimOrders.def()
}
}
impl Related < super :: carts :: Entity > for Entity { fn to () -> RelationDef { Relation :: Carts . def () } } impl Related<super::orders::Entity> for Entity {
fn to() -> RelationDef {
Relation::Orders.def()
}
}
impl Related < super :: claim_orders :: Entity > for Entity { fn to () -> RelationDef { Relation :: ClaimOrders . def () } } impl Related<super::returns::Entity> for Entity {
fn to() -> RelationDef {
Relation::Returns.def()
}
}
impl Related < super :: orders :: Entity > for Entity { fn to () -> RelationDef { Relation :: Orders . def () } } impl Related<super::shipping_method_tax_lines::Entity> for Entity {
fn to() -> RelationDef {
Relation::ShippingMethodTaxLines.def()
}
}
impl Related < super :: returns :: Entity > for Entity { fn to () -> RelationDef { Relation :: Returns . def () } } impl Related<super::shipping_options::Entity> for Entity {
fn to() -> RelationDef {
Relation::ShippingOptions.def()
}
}
impl Related < super :: shipping_method_tax_lines :: Entity > for Entity { fn to () -> RelationDef { Relation :: ShippingMethodTaxLines . def () } } impl Related<super::swaps::Entity> for Entity {
fn to() -> RelationDef {
impl Related < super :: shipping_options :: Entity > for Entity { fn to () -> RelationDef { Relation :: ShippingOptions . def () } } Relation::Swaps.def()
}
impl Related < super :: swaps :: Entity > for Entity { fn to () -> RelationDef { Relation :: Swaps . def () } } }
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,27 +1,82 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
use super::sea_orm_active_enums::ShippingOptionRequirementTypes;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; use super :: sea_orm_active_enums :: ShippingOptionRequirementTypes ; #[derive(Copy, Clone, Default, Debug, DeriveEntity)]
pub struct Entity;
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"shipping_option_requirements"
}
}
impl EntityName for Entity { fn table_name (& self) -> & str { "shipping_option_requirements" } } #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub id: String,
pub shipping_option_id: String,
pub r#type: ShippingOptionRequirementTypes,
pub amount: i32,
pub deleted_at: Option<DateTimeWithTimeZone>,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub id : String , pub shipping_option_id : String , pub r#type : ShippingOptionRequirementTypes , pub amount : i32 , pub deleted_at : Option < DateTimeWithTimeZone > , } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
Id,
ShippingOptionId,
Type,
Amount,
DeletedAt,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { Id , ShippingOptionId , Type , Amount , DeletedAt , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
Id,
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { Id , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = String;
fn auto_increment() -> bool {
false
}
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = String ; fn auto_increment () -> bool { false } } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
ShippingOptions,
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { ShippingOptions , } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::Id => ColumnType::String(None).def(),
Self::ShippingOptionId => ColumnType::String(None).def(),
Self::Type => ShippingOptionRequirementTypes::db_type().def(),
Self::Amount => ColumnType::Integer.def(),
Self::DeletedAt => ColumnType::TimestampWithTimeZone.def().null(),
}
}
}
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: Id => ColumnType :: String (None) . def () , Self :: ShippingOptionId => ColumnType :: String (None) . def () , Self :: Type => ShippingOptionRequirementTypes :: db_type () . def () , Self :: Amount => ColumnType :: Integer . def () , Self :: DeletedAt => ColumnType :: TimestampWithTimeZone . def () . null () , } } } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
match self {
Self::ShippingOptions => Entity::belongs_to(super::shipping_options::Entity)
.from(Column::ShippingOptionId)
.to(super::shipping_options::Column::Id)
.into(),
}
}
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: ShippingOptions => Entity :: belongs_to (super :: shipping_options :: Entity) . from (Column :: ShippingOptionId) . to (super :: shipping_options :: Column :: Id) . into () , } } } impl Related<super::shipping_options::Entity> for Entity {
fn to() -> RelationDef {
impl Related < super :: shipping_options :: Entity > for Entity { fn to () -> RelationDef { Relation :: ShippingOptions . def () } } Relation::ShippingOptions.def()
}
}
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,39 +1,172 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
use super::sea_orm_active_enums::ShippingOptionPriceTypes;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; use super :: sea_orm_active_enums :: ShippingOptionPriceTypes ; #[derive(Copy, Clone, Default, Debug, DeriveEntity)]
pub struct Entity;
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"shipping_options"
}
}
impl EntityName for Entity { fn table_name (& self) -> & str { "shipping_options" } } #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub id: String,
pub name: String,
pub region_id: String,
pub profile_id: String,
pub provider_id: String,
pub price_type: ShippingOptionPriceTypes,
pub amount: Option<i32>,
pub is_return: bool,
pub data: Json,
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
pub deleted_at: Option<DateTimeWithTimeZone>,
pub metadata: Option<Json>,
pub admin_only: bool,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub id : String , pub name : String , pub region_id : String , pub profile_id : String , pub provider_id : String , pub price_type : ShippingOptionPriceTypes , pub amount : Option < i32 > , pub is_return : bool , pub data : Json , pub created_at : DateTimeWithTimeZone , pub updated_at : DateTimeWithTimeZone , pub deleted_at : Option < DateTimeWithTimeZone > , pub metadata : Option < Json > , pub admin_only : bool , } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
Id,
Name,
RegionId,
ProfileId,
ProviderId,
PriceType,
Amount,
IsReturn,
Data,
CreatedAt,
UpdatedAt,
DeletedAt,
Metadata,
AdminOnly,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { Id , Name , RegionId , ProfileId , ProviderId , PriceType , Amount , IsReturn , Data , CreatedAt , UpdatedAt , DeletedAt , Metadata , AdminOnly , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
Id,
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { Id , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = String;
fn auto_increment() -> bool {
false
}
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = String ; fn auto_increment () -> bool { false } } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
CustomShippingOptions,
FulfillmentProviders,
Regions,
ShippingMethods,
ShippingOptionRequirements,
ShippingProfiles,
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { CustomShippingOptions , FulfillmentProviders , Regions , ShippingMethods , ShippingOptionRequirements , ShippingProfiles , } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::Id => ColumnType::String(None).def(),
Self::Name => ColumnType::String(None).def(),
Self::RegionId => ColumnType::String(None).def(),
Self::ProfileId => ColumnType::String(None).def(),
Self::ProviderId => ColumnType::String(None).def(),
Self::PriceType => ShippingOptionPriceTypes::db_type().def(),
Self::Amount => ColumnType::Integer.def().null(),
Self::IsReturn => ColumnType::Boolean.def(),
Self::Data => ColumnType::JsonBinary.def(),
Self::CreatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::UpdatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::DeletedAt => ColumnType::TimestampWithTimeZone.def().null(),
Self::Metadata => ColumnType::JsonBinary.def().null(),
Self::AdminOnly => ColumnType::Boolean.def(),
}
}
}
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: Id => ColumnType :: String (None) . def () , Self :: Name => ColumnType :: String (None) . def () , Self :: RegionId => ColumnType :: String (None) . def () , Self :: ProfileId => ColumnType :: String (None) . def () , Self :: ProviderId => ColumnType :: String (None) . def () , Self :: PriceType => ShippingOptionPriceTypes :: db_type () . def () , Self :: Amount => ColumnType :: Integer . def () . null () , Self :: IsReturn => ColumnType :: Boolean . def () , Self :: Data => ColumnType :: JsonBinary . def () , Self :: CreatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: UpdatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: DeletedAt => ColumnType :: TimestampWithTimeZone . def () . null () , Self :: Metadata => ColumnType :: JsonBinary . def () . null () , Self :: AdminOnly => ColumnType :: Boolean . def () , } } } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
match self {
Self::CustomShippingOptions => {
Entity::has_many(super::custom_shipping_options::Entity).into()
}
Self::FulfillmentProviders => Entity::belongs_to(super::fulfillment_providers::Entity)
.from(Column::ProviderId)
.to(super::fulfillment_providers::Column::Id)
.into(),
Self::Regions => Entity::belongs_to(super::regions::Entity)
.from(Column::RegionId)
.to(super::regions::Column::Id)
.into(),
Self::ShippingMethods => Entity::has_many(super::shipping_methods::Entity).into(),
Self::ShippingOptionRequirements => {
Entity::has_many(super::shipping_option_requirements::Entity).into()
}
Self::ShippingProfiles => Entity::belongs_to(super::shipping_profiles::Entity)
.from(Column::ProfileId)
.to(super::shipping_profiles::Column::Id)
.into(),
}
}
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: CustomShippingOptions => Entity :: has_many (super :: custom_shipping_options :: Entity) . into () , Self :: FulfillmentProviders => Entity :: belongs_to (super :: fulfillment_providers :: Entity) . from (Column :: ProviderId) . to (super :: fulfillment_providers :: Column :: Id) . into () , Self :: Regions => Entity :: belongs_to (super :: regions :: Entity) . from (Column :: RegionId) . to (super :: regions :: Column :: Id) . into () , Self :: ShippingMethods => Entity :: has_many (super :: shipping_methods :: Entity) . into () , Self :: ShippingOptionRequirements => Entity :: has_many (super :: shipping_option_requirements :: Entity) . into () , Self :: ShippingProfiles => Entity :: belongs_to (super :: shipping_profiles :: Entity) . from (Column :: ProfileId) . to (super :: shipping_profiles :: Column :: Id) . into () , } } } impl Related<super::custom_shipping_options::Entity> for Entity {
fn to() -> RelationDef {
Relation::CustomShippingOptions.def()
}
}
impl Related < super :: custom_shipping_options :: Entity > for Entity { fn to () -> RelationDef { Relation :: CustomShippingOptions . def () } } impl Related<super::fulfillment_providers::Entity> for Entity {
fn to() -> RelationDef {
Relation::FulfillmentProviders.def()
}
}
impl Related < super :: fulfillment_providers :: Entity > for Entity { fn to () -> RelationDef { Relation :: FulfillmentProviders . def () } } impl Related<super::regions::Entity> for Entity {
fn to() -> RelationDef {
Relation::Regions.def()
}
}
impl Related < super :: regions :: Entity > for Entity { fn to () -> RelationDef { Relation :: Regions . def () } } impl Related<super::shipping_methods::Entity> for Entity {
fn to() -> RelationDef {
Relation::ShippingMethods.def()
}
}
impl Related < super :: shipping_methods :: Entity > for Entity { fn to () -> RelationDef { Relation :: ShippingMethods . def () } } impl Related<super::shipping_option_requirements::Entity> for Entity {
fn to() -> RelationDef {
Relation::ShippingOptionRequirements.def()
}
}
impl Related < super :: shipping_option_requirements :: Entity > for Entity { fn to () -> RelationDef { Relation :: ShippingOptionRequirements . def () } } impl Related<super::shipping_profiles::Entity> for Entity {
fn to() -> RelationDef {
Relation::ShippingProfiles.def()
}
}
impl Related < super :: shipping_profiles :: Entity > for Entity { fn to () -> RelationDef { Relation :: ShippingProfiles . def () } } impl Related<super::tax_rates::Entity> for Entity {
fn to() -> RelationDef {
impl Related < super :: tax_rates :: Entity > for Entity { fn to () -> RelationDef { super :: shipping_tax_rates :: Relation :: TaxRates . def () } fn via () -> Option < RelationDef > { Some (super :: shipping_tax_rates :: Relation :: ShippingOptions . def () . rev ()) } } super::shipping_tax_rates::Relation::TaxRates.def()
}
fn via() -> Option<RelationDef> {
Some(
super::shipping_tax_rates::Relation::ShippingOptions
.def()
.rev(),
)
}
}
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,29 +1,93 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
use super::sea_orm_active_enums::ShippingProfileTypes;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; use super :: sea_orm_active_enums :: ShippingProfileTypes ; #[derive(Copy, Clone, Default, Debug, DeriveEntity)]
pub struct Entity;
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"shipping_profiles"
}
}
impl EntityName for Entity { fn table_name (& self) -> & str { "shipping_profiles" } } #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub id: String,
pub name: String,
pub r#type: ShippingProfileTypes,
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
pub deleted_at: Option<DateTimeWithTimeZone>,
pub metadata: Option<Json>,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub id : String , pub name : String , pub r#type : ShippingProfileTypes , pub created_at : DateTimeWithTimeZone , pub updated_at : DateTimeWithTimeZone , pub deleted_at : Option < DateTimeWithTimeZone > , pub metadata : Option < Json > , } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
Id,
Name,
Type,
CreatedAt,
UpdatedAt,
DeletedAt,
Metadata,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { Id , Name , Type , CreatedAt , UpdatedAt , DeletedAt , Metadata , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
Id,
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { Id , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = String;
fn auto_increment() -> bool {
false
}
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = String ; fn auto_increment () -> bool { false } } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
Products,
ShippingOptions,
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { Products , ShippingOptions , } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::Id => ColumnType::String(None).def(),
Self::Name => ColumnType::String(None).def(),
Self::Type => ShippingProfileTypes::db_type().def(),
Self::CreatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::UpdatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::DeletedAt => ColumnType::TimestampWithTimeZone.def().null(),
Self::Metadata => ColumnType::JsonBinary.def().null(),
}
}
}
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: Id => ColumnType :: String (None) . def () , Self :: Name => ColumnType :: String (None) . def () , Self :: Type => ShippingProfileTypes :: db_type () . def () , Self :: CreatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: UpdatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: DeletedAt => ColumnType :: TimestampWithTimeZone . def () . null () , Self :: Metadata => ColumnType :: JsonBinary . def () . null () , } } } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
match self {
Self::Products => Entity::has_many(super::products::Entity).into(),
Self::ShippingOptions => Entity::has_many(super::shipping_options::Entity).into(),
}
}
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: Products => Entity :: has_many (super :: products :: Entity) . into () , Self :: ShippingOptions => Entity :: has_many (super :: shipping_options :: Entity) . into () , } } } impl Related<super::products::Entity> for Entity {
fn to() -> RelationDef {
Relation::Products.def()
}
}
impl Related < super :: products :: Entity > for Entity { fn to () -> RelationDef { Relation :: Products . def () } } impl Related<super::shipping_options::Entity> for Entity {
fn to() -> RelationDef {
impl Related < super :: shipping_options :: Entity > for Entity { fn to () -> RelationDef { Relation :: ShippingOptions . def () } } Relation::ShippingOptions.def()
}
}
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,29 +1,92 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `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;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"shipping_tax_rates"
}
}
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub shipping_option_id: String,
pub rate_id: String,
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
pub metadata: Option<Json>,
}
impl EntityName for Entity { fn table_name (& self) -> & str { "shipping_tax_rates" } } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
ShippingOptionId,
RateId,
CreatedAt,
UpdatedAt,
Metadata,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub shipping_option_id : String , pub rate_id : String , pub created_at : DateTimeWithTimeZone , pub updated_at : DateTimeWithTimeZone , pub metadata : Option < Json > , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
ShippingOptionId,
RateId,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { ShippingOptionId , RateId , CreatedAt , UpdatedAt , Metadata , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = (String, String);
fn auto_increment() -> bool {
false
}
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { ShippingOptionId , RateId , } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
ShippingOptions,
TaxRates,
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = (String , String) ; fn auto_increment () -> bool { false } } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::ShippingOptionId => ColumnType::String(None).def(),
Self::RateId => ColumnType::String(None).def(),
Self::CreatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::UpdatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::Metadata => ColumnType::JsonBinary.def().null(),
}
}
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { ShippingOptions , TaxRates , } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
match self {
Self::ShippingOptions => Entity::belongs_to(super::shipping_options::Entity)
.from(Column::ShippingOptionId)
.to(super::shipping_options::Column::Id)
.into(),
Self::TaxRates => Entity::belongs_to(super::tax_rates::Entity)
.from(Column::RateId)
.to(super::tax_rates::Column::Id)
.into(),
}
}
}
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: ShippingOptionId => ColumnType :: String (None) . def () , Self :: RateId => ColumnType :: String (None) . def () , Self :: CreatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: UpdatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: Metadata => ColumnType :: JsonBinary . def () . null () , } } } impl Related<super::shipping_options::Entity> for Entity {
fn to() -> RelationDef {
Relation::ShippingOptions.def()
}
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: ShippingOptions => Entity :: belongs_to (super :: shipping_options :: Entity) . from (Column :: ShippingOptionId) . to (super :: shipping_options :: Column :: Id) . into () , Self :: TaxRates => Entity :: belongs_to (super :: tax_rates :: Entity) . from (Column :: RateId) . to (super :: tax_rates :: Column :: Id) . into () , } } } impl Related<super::tax_rates::Entity> for Entity {
fn to() -> RelationDef {
impl Related < super :: shipping_options :: Entity > for Entity { fn to () -> RelationDef { Relation :: ShippingOptions . def () } } Relation::TaxRates.def()
}
impl Related < super :: tax_rates :: Entity > for Entity { fn to () -> RelationDef { Relation :: TaxRates . def () } } }
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,25 +1,64 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `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;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"staged_jobs"
}
}
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub id: String,
pub event_name: String,
pub data: Json,
pub options: Json,
}
impl EntityName for Entity { fn table_name (& self) -> & str { "staged_jobs" } } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
Id,
EventName,
Data,
Options,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub id : String , pub event_name : String , pub data : Json , pub options : Json , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
Id,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { Id , EventName , Data , Options , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = String;
fn auto_increment() -> bool {
false
}
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { Id , } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = String ; fn auto_increment () -> bool { false } } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::Id => ColumnType::String(None).def(),
Self::EventName => ColumnType::String(None).def(),
Self::Data => ColumnType::JsonBinary.def(),
Self::Options => ColumnType::JsonBinary.def(),
}
}
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: Id => ColumnType :: String (None) . def () , Self :: EventName => ColumnType :: String (None) . def () , Self :: Data => ColumnType :: JsonBinary . def () , Self :: Options => ColumnType :: JsonBinary . def () , } } } panic!("No RelationDef")
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { panic ! ("No RelationDef") } } }
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,29 +1,83 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `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;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"store_currencies"
}
}
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub store_id: String,
pub currency_code: String,
}
impl EntityName for Entity { fn table_name (& self) -> & str { "store_currencies" } } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
StoreId,
CurrencyCode,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub store_id : String , pub currency_code : String , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
StoreId,
CurrencyCode,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { StoreId , CurrencyCode , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = (String, String);
fn auto_increment() -> bool {
false
}
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { StoreId , CurrencyCode , } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
Currencies,
Stores,
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = (String , String) ; fn auto_increment () -> bool { false } } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::StoreId => ColumnType::String(None).def(),
Self::CurrencyCode => ColumnType::String(None).def(),
}
}
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { Currencies , Stores , } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
match self {
Self::Currencies => Entity::belongs_to(super::currencies::Entity)
.from(Column::CurrencyCode)
.to(super::currencies::Column::Code)
.into(),
Self::Stores => Entity::belongs_to(super::stores::Entity)
.from(Column::StoreId)
.to(super::stores::Column::Id)
.into(),
}
}
}
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: StoreId => ColumnType :: String (None) . def () , Self :: CurrencyCode => ColumnType :: String (None) . def () , } } } impl Related<super::currencies::Entity> for Entity {
fn to() -> RelationDef {
Relation::Currencies.def()
}
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: Currencies => Entity :: belongs_to (super :: currencies :: Entity) . from (Column :: CurrencyCode) . to (super :: currencies :: Column :: Code) . into () , Self :: Stores => Entity :: belongs_to (super :: stores :: Entity) . from (Column :: StoreId) . to (super :: stores :: Column :: Id) . into () , } } } impl Related<super::stores::Entity> for Entity {
fn to() -> RelationDef {
impl Related < super :: currencies :: Entity > for Entity { fn to () -> RelationDef { Relation :: Currencies . def () } } Relation::Stores.def()
}
impl Related < super :: stores :: Entity > for Entity { fn to () -> RelationDef { Relation :: Stores . def () } } }
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,29 +1,112 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `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;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"stores"
}
}
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub id: String,
pub name: String,
pub default_currency_code: String,
pub swap_link_template: Option<String>,
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
pub metadata: Option<Json>,
pub payment_link_template: Option<String>,
pub invite_link_template: Option<String>,
pub default_sales_channel_id: Option<String>,
pub default_location_id: Option<String>,
}
impl EntityName for Entity { fn table_name (& self) -> & str { "stores" } } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
Id,
Name,
DefaultCurrencyCode,
SwapLinkTemplate,
CreatedAt,
UpdatedAt,
Metadata,
PaymentLinkTemplate,
InviteLinkTemplate,
DefaultSalesChannelId,
DefaultLocationId,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub id : String , pub name : String , pub default_currency_code : String , pub swap_link_template : Option < String > , pub created_at : DateTimeWithTimeZone , pub updated_at : DateTimeWithTimeZone , pub metadata : Option < Json > , pub payment_link_template : Option < String > , pub invite_link_template : Option < String > , pub default_sales_channel_id : Option < String > , pub default_location_id : Option < String > , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
Id,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { Id , Name , DefaultCurrencyCode , SwapLinkTemplate , CreatedAt , UpdatedAt , Metadata , PaymentLinkTemplate , InviteLinkTemplate , DefaultSalesChannelId , DefaultLocationId , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = String;
fn auto_increment() -> bool {
false
}
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { Id , } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
Currencies,
SalesChannels,
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = String ; fn auto_increment () -> bool { false } } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::Id => ColumnType::String(None).def(),
Self::Name => ColumnType::String(None).def(),
Self::DefaultCurrencyCode => ColumnType::String(None).def(),
Self::SwapLinkTemplate => ColumnType::String(None).def().null(),
Self::CreatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::UpdatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::Metadata => ColumnType::JsonBinary.def().null(),
Self::PaymentLinkTemplate => ColumnType::String(None).def().null(),
Self::InviteLinkTemplate => ColumnType::String(None).def().null(),
Self::DefaultSalesChannelId => ColumnType::String(None).def().null().unique(),
Self::DefaultLocationId => ColumnType::String(None).def().null(),
}
}
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { Currencies , SalesChannels , } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
match self {
Self::Currencies => Entity::belongs_to(super::currencies::Entity)
.from(Column::DefaultCurrencyCode)
.to(super::currencies::Column::Code)
.into(),
Self::SalesChannels => Entity::belongs_to(super::sales_channels::Entity)
.from(Column::DefaultSalesChannelId)
.to(super::sales_channels::Column::Id)
.into(),
}
}
}
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: Id => ColumnType :: String (None) . def () , Self :: Name => ColumnType :: String (None) . def () , Self :: DefaultCurrencyCode => ColumnType :: String (None) . def () , Self :: SwapLinkTemplate => ColumnType :: String (None) . def () . null () , Self :: CreatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: UpdatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: Metadata => ColumnType :: JsonBinary . def () . null () , Self :: PaymentLinkTemplate => ColumnType :: String (None) . def () . null () , Self :: InviteLinkTemplate => ColumnType :: String (None) . def () . null () , Self :: DefaultSalesChannelId => ColumnType :: String (None) . def () . null () . unique () , Self :: DefaultLocationId => ColumnType :: String (None) . def () . null () , } } } impl Related<super::sales_channels::Entity> for Entity {
fn to() -> RelationDef {
Relation::SalesChannels.def()
}
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: Currencies => Entity :: belongs_to (super :: currencies :: Entity) . from (Column :: DefaultCurrencyCode) . to (super :: currencies :: Column :: Code) . into () , Self :: SalesChannels => Entity :: belongs_to (super :: sales_channels :: Entity) . from (Column :: DefaultSalesChannelId) . to (super :: sales_channels :: Column :: Id) . into () , } } } impl Related<super::currencies::Entity> for Entity {
fn to() -> RelationDef {
impl Related < super :: sales_channels :: Entity > for Entity { fn to () -> RelationDef { Relation :: SalesChannels . def () } } super::store_currencies::Relation::Currencies.def()
}
impl Related < super :: currencies :: Entity > for Entity { fn to () -> RelationDef { super :: store_currencies :: Relation :: Currencies . def () } fn via () -> Option < RelationDef > { Some (super :: store_currencies :: Relation :: Stores . def () . rev ()) } } fn via() -> Option<RelationDef> {
Some(super::store_currencies::Relation::Stores.def().rev())
}
}
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,41 +1,177 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
use super::sea_orm_active_enums::{SwapFulfillmentStatuses, SwapPaymentStatuses};
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; use super :: sea_orm_active_enums :: SwapFulfillmentStatuses ; use super :: sea_orm_active_enums :: SwapPaymentStatuses ; #[derive(Copy, Clone, Default, Debug, DeriveEntity)]
pub struct Entity;
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"swaps"
}
}
impl EntityName for Entity { fn table_name (& self) -> & str { "swaps" } } #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub id: String,
pub fulfillment_status: SwapFulfillmentStatuses,
pub payment_status: SwapPaymentStatuses,
pub order_id: String,
pub difference_due: Option<i32>,
pub shipping_address_id: Option<String>,
pub cart_id: Option<String>,
pub confirmed_at: Option<DateTimeWithTimeZone>,
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
pub deleted_at: Option<DateTimeWithTimeZone>,
pub metadata: Option<Json>,
pub idempotency_key: Option<String>,
pub no_notification: Option<bool>,
pub canceled_at: Option<DateTimeWithTimeZone>,
pub allow_backorder: bool,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub id : String , pub fulfillment_status : SwapFulfillmentStatuses , pub payment_status : SwapPaymentStatuses , pub order_id : String , pub difference_due : Option < i32 > , pub shipping_address_id : Option < String > , pub cart_id : Option < String > , pub confirmed_at : Option < DateTimeWithTimeZone > , pub created_at : DateTimeWithTimeZone , pub updated_at : DateTimeWithTimeZone , pub deleted_at : Option < DateTimeWithTimeZone > , pub metadata : Option < Json > , pub idempotency_key : Option < String > , pub no_notification : Option < bool > , pub canceled_at : Option < DateTimeWithTimeZone > , pub allow_backorder : bool , } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
Id,
FulfillmentStatus,
PaymentStatus,
OrderId,
DifferenceDue,
ShippingAddressId,
CartId,
ConfirmedAt,
CreatedAt,
UpdatedAt,
DeletedAt,
Metadata,
IdempotencyKey,
NoNotification,
CanceledAt,
AllowBackorder,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { Id , FulfillmentStatus , PaymentStatus , OrderId , DifferenceDue , ShippingAddressId , CartId , ConfirmedAt , CreatedAt , UpdatedAt , DeletedAt , Metadata , IdempotencyKey , NoNotification , CanceledAt , AllowBackorder , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
Id,
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { Id , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = String;
fn auto_increment() -> bool {
false
}
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = String ; fn auto_increment () -> bool { false } } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
Addresses,
Carts,
Fulfillments,
LineItems,
Orders,
Payments,
Returns,
ShippingMethods,
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { Addresses , Carts , Fulfillments , LineItems , Orders , Payments , Returns , ShippingMethods , } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::Id => ColumnType::String(None).def(),
Self::FulfillmentStatus => SwapFulfillmentStatuses::db_type().def(),
Self::PaymentStatus => SwapPaymentStatuses::db_type().def(),
Self::OrderId => ColumnType::String(None).def(),
Self::DifferenceDue => ColumnType::Integer.def().null(),
Self::ShippingAddressId => ColumnType::String(None).def().null(),
Self::CartId => ColumnType::String(None).def().null().unique(),
Self::ConfirmedAt => ColumnType::TimestampWithTimeZone.def().null(),
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(),
Self::NoNotification => ColumnType::Boolean.def().null(),
Self::CanceledAt => ColumnType::TimestampWithTimeZone.def().null(),
Self::AllowBackorder => ColumnType::Boolean.def(),
}
}
}
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: Id => ColumnType :: String (None) . def () , Self :: FulfillmentStatus => SwapFulfillmentStatuses :: db_type () . def () , Self :: PaymentStatus => SwapPaymentStatuses :: db_type () . def () , Self :: OrderId => ColumnType :: String (None) . def () , Self :: DifferenceDue => ColumnType :: Integer . def () . null () , Self :: ShippingAddressId => ColumnType :: String (None) . def () . null () , Self :: CartId => ColumnType :: String (None) . def () . null () . unique () , Self :: ConfirmedAt => ColumnType :: TimestampWithTimeZone . def () . null () , 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 () , Self :: NoNotification => ColumnType :: Boolean . def () . null () , Self :: CanceledAt => ColumnType :: TimestampWithTimeZone . def () . null () , Self :: AllowBackorder => ColumnType :: Boolean . def () , } } } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
match self {
Self::Addresses => Entity::belongs_to(super::addresses::Entity)
.from(Column::ShippingAddressId)
.to(super::addresses::Column::Id)
.into(),
Self::Carts => Entity::belongs_to(super::carts::Entity)
.from(Column::CartId)
.to(super::carts::Column::Id)
.into(),
Self::Fulfillments => Entity::has_many(super::fulfillments::Entity).into(),
Self::LineItems => Entity::has_many(super::line_items::Entity).into(),
Self::Orders => Entity::belongs_to(super::orders::Entity)
.from(Column::OrderId)
.to(super::orders::Column::Id)
.into(),
Self::Payments => Entity::has_one(super::payments::Entity).into(),
Self::Returns => Entity::has_one(super::returns::Entity).into(),
Self::ShippingMethods => Entity::has_many(super::shipping_methods::Entity).into(),
}
}
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: Addresses => Entity :: belongs_to (super :: addresses :: Entity) . from (Column :: ShippingAddressId) . to (super :: addresses :: Column :: Id) . into () , Self :: Carts => Entity :: belongs_to (super :: carts :: Entity) . from (Column :: CartId) . to (super :: carts :: Column :: Id) . into () , Self :: Fulfillments => Entity :: has_many (super :: fulfillments :: Entity) . into () , Self :: LineItems => Entity :: has_many (super :: line_items :: Entity) . into () , Self :: Orders => Entity :: belongs_to (super :: orders :: Entity) . from (Column :: OrderId) . to (super :: orders :: Column :: Id) . into () , Self :: Payments => Entity :: has_one (super :: payments :: Entity) . into () , Self :: Returns => Entity :: has_one (super :: returns :: Entity) . into () , Self :: ShippingMethods => Entity :: has_many (super :: shipping_methods :: Entity) . into () , } } } impl Related<super::addresses::Entity> for Entity {
fn to() -> RelationDef {
Relation::Addresses.def()
}
}
impl Related < super :: addresses :: Entity > for Entity { fn to () -> RelationDef { Relation :: Addresses . def () } } impl Related<super::carts::Entity> for Entity {
fn to() -> RelationDef {
Relation::Carts.def()
}
}
impl Related < super :: carts :: Entity > for Entity { fn to () -> RelationDef { Relation :: Carts . def () } } impl Related<super::fulfillments::Entity> for Entity {
fn to() -> RelationDef {
Relation::Fulfillments.def()
}
}
impl Related < super :: fulfillments :: Entity > for Entity { fn to () -> RelationDef { Relation :: Fulfillments . def () } } impl Related<super::line_items::Entity> for Entity {
fn to() -> RelationDef {
Relation::LineItems.def()
}
}
impl Related < super :: line_items :: Entity > for Entity { fn to () -> RelationDef { Relation :: LineItems . def () } } impl Related<super::orders::Entity> for Entity {
fn to() -> RelationDef {
Relation::Orders.def()
}
}
impl Related < super :: orders :: Entity > for Entity { fn to () -> RelationDef { Relation :: Orders . def () } } impl Related<super::payments::Entity> for Entity {
fn to() -> RelationDef {
Relation::Payments.def()
}
}
impl Related < super :: payments :: Entity > for Entity { fn to () -> RelationDef { Relation :: Payments . def () } } impl Related<super::returns::Entity> for Entity {
fn to() -> RelationDef {
Relation::Returns.def()
}
}
impl Related < super :: returns :: Entity > for Entity { fn to () -> RelationDef { Relation :: Returns . def () } } impl Related<super::shipping_methods::Entity> for Entity {
fn to() -> RelationDef {
impl Related < super :: shipping_methods :: Entity > for Entity { fn to () -> RelationDef { Relation :: ShippingMethods . def () } } Relation::ShippingMethods.def()
}
}
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,27 +1,68 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `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;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"tax_providers"
}
}
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub id: String,
pub is_installed: bool,
}
impl EntityName for Entity { fn table_name (& self) -> & str { "tax_providers" } } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
Id,
IsInstalled,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub id : String , pub is_installed : bool , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
Id,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { Id , IsInstalled , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = String;
fn auto_increment() -> bool {
false
}
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { Id , } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
Regions,
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = String ; fn auto_increment () -> bool { false } } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::Id => ColumnType::String(None).def(),
Self::IsInstalled => ColumnType::Boolean.def(),
}
}
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { Regions , } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
match self {
Self::Regions => Entity::has_many(super::regions::Entity).into(),
}
}
}
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: Id => ColumnType :: String (None) . def () , Self :: IsInstalled => ColumnType :: Boolean . def () , } } } impl Related<super::regions::Entity> for Entity {
fn to() -> RelationDef {
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: Regions => Entity :: has_many (super :: regions :: Entity) . into () , } } } Relation::Regions.def()
}
impl Related < super :: regions :: Entity > for Entity { fn to () -> RelationDef { Relation :: Regions . def () } } }
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,33 +1,120 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `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;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"tax_rates"
}
}
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Serialize, Deserialize)]
pub struct Model {
pub id: String,
pub rate: Option<f32>,
pub code: Option<String>,
pub name: String,
pub region_id: String,
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
pub metadata: Option<Json>,
}
impl EntityName for Entity { fn table_name (& self) -> & str { "tax_rates" } } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
Id,
Rate,
Code,
Name,
RegionId,
CreatedAt,
UpdatedAt,
Metadata,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Serialize , Deserialize)] pub struct Model { pub id : String , pub rate : Option < f32 > , pub code : Option < String > , pub name : String , pub region_id : String , pub created_at : DateTimeWithTimeZone , pub updated_at : DateTimeWithTimeZone , pub metadata : Option < Json > , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
Id,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { Id , Rate , Code , Name , RegionId , CreatedAt , UpdatedAt , Metadata , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = String;
fn auto_increment() -> bool {
false
}
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { Id , } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
Regions,
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = String ; fn auto_increment () -> bool { false } } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::Id => ColumnType::String(None).def(),
Self::Rate => ColumnType::Float.def().null(),
Self::Code => ColumnType::String(None).def().null(),
Self::Name => ColumnType::String(None).def(),
Self::RegionId => ColumnType::String(None).def(),
Self::CreatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::UpdatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::Metadata => ColumnType::JsonBinary.def().null(),
}
}
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { Regions , } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
match self {
Self::Regions => Entity::belongs_to(super::regions::Entity)
.from(Column::RegionId)
.to(super::regions::Column::Id)
.into(),
}
}
}
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: Id => ColumnType :: String (None) . def () , Self :: Rate => ColumnType :: Float . def () . null () , Self :: Code => ColumnType :: String (None) . def () . null () , Self :: Name => ColumnType :: String (None) . def () , Self :: RegionId => ColumnType :: String (None) . def () , Self :: CreatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: UpdatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: Metadata => ColumnType :: JsonBinary . def () . null () , } } } impl Related<super::regions::Entity> for Entity {
fn to() -> RelationDef {
Relation::Regions.def()
}
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: Regions => Entity :: belongs_to (super :: regions :: Entity) . from (Column :: RegionId) . to (super :: regions :: Column :: Id) . into () , } } } impl Related<super::products::Entity> for Entity {
fn to() -> RelationDef {
super::product_tax_rates::Relation::Products.def()
}
fn via() -> Option<RelationDef> {
Some(super::product_tax_rates::Relation::TaxRates.def().rev())
}
}
impl Related < super :: regions :: Entity > for Entity { fn to () -> RelationDef { Relation :: Regions . def () } } impl Related<super::product_types::Entity> for Entity {
fn to() -> RelationDef {
super::product_type_tax_rates::Relation::ProductTypes.def()
}
fn via() -> Option<RelationDef> {
Some(
super::product_type_tax_rates::Relation::TaxRates
.def()
.rev(),
)
}
}
impl Related < super :: products :: Entity > for Entity { fn to () -> RelationDef { super :: product_tax_rates :: Relation :: Products . def () } fn via () -> Option < RelationDef > { Some (super :: product_tax_rates :: Relation :: TaxRates . def () . rev ()) } } impl Related<super::shipping_options::Entity> for Entity {
fn to() -> RelationDef {
impl Related < super :: product_types :: Entity > for Entity { fn to () -> RelationDef { super :: product_type_tax_rates :: Relation :: ProductTypes . def () } fn via () -> Option < RelationDef > { Some (super :: product_type_tax_rates :: Relation :: TaxRates . def () . rev ()) } } super::shipping_tax_rates::Relation::ShippingOptions.def()
}
impl Related < super :: shipping_options :: Entity > for Entity { fn to () -> RelationDef { super :: shipping_tax_rates :: Relation :: ShippingOptions . def () } fn via () -> Option < RelationDef > { Some (super :: shipping_tax_rates :: Relation :: TaxRates . def () . rev ()) } } fn via() -> Option<RelationDef> {
Some(super::shipping_tax_rates::Relation::TaxRates.def().rev())
}
}
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,27 +1,92 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `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;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"tracking_links"
}
}
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; #[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>,
}
impl EntityName for Entity { fn table_name (& self) -> & str { "tracking_links" } } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
Id,
Url,
TrackingNumber,
FulfillmentId,
CreatedAt,
UpdatedAt,
DeletedAt,
Metadata,
IdempotencyKey,
}
# [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, DerivePrimaryKey)]
pub enum PrimaryKey {
Id,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { Id , Url , TrackingNumber , FulfillmentId , CreatedAt , UpdatedAt , DeletedAt , Metadata , IdempotencyKey , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = String;
fn auto_increment() -> bool {
false
}
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { Id , } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
Fulfillments,
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = String ; fn auto_increment () -> bool { false } } 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(),
}
}
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { Fulfillments , } 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 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 Related<super::fulfillments::Entity> for Entity {
fn to() -> RelationDef {
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 () , } } } Relation::Fulfillments.def()
}
impl Related < super :: fulfillments :: Entity > for Entity { fn to () -> RelationDef { Relation :: Fulfillments . def () } } }
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -1,27 +1,97 @@
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3 //! `SeaORM` Entity. Generated by sea-orm-codegen 0.11.3
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
use super::sea_orm_active_enums::UserRoles;
use sea_orm :: entity :: prelude :: * ; use serde :: { Deserialize , Serialize } ; use super :: sea_orm_active_enums :: UserRoles ; #[derive(Copy, Clone, Default, Debug, DeriveEntity)]
pub struct Entity;
# [derive (Copy , Clone , Default , Debug , DeriveEntity)] pub struct Entity ; impl EntityName for Entity {
fn table_name(&self) -> &str {
"users"
}
}
impl EntityName for Entity { fn table_name (& self) -> & str { "users" } } #[derive(Clone, Debug, PartialEq, DeriveModel, DeriveActiveModel, Eq, Serialize, Deserialize)]
pub struct Model {
pub id: String,
pub email: String,
pub first_name: Option<String>,
pub last_name: Option<String>,
pub password_hash: Option<String>,
pub api_token: Option<String>,
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
pub deleted_at: Option<DateTimeWithTimeZone>,
pub metadata: Option<Json>,
pub role: Option<UserRoles>,
}
# [derive (Clone , Debug , PartialEq , DeriveModel , DeriveActiveModel , Eq , Serialize , Deserialize)] pub struct Model { pub id : String , pub email : String , pub first_name : Option < String > , pub last_name : Option < String > , pub password_hash : Option < String > , pub api_token : Option < String > , pub created_at : DateTimeWithTimeZone , pub updated_at : DateTimeWithTimeZone , pub deleted_at : Option < DateTimeWithTimeZone > , pub metadata : Option < Json > , pub role : Option < UserRoles > , } #[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
pub enum Column {
Id,
Email,
FirstName,
LastName,
PasswordHash,
ApiToken,
CreatedAt,
UpdatedAt,
DeletedAt,
Metadata,
Role,
}
# [derive (Copy , Clone , Debug , EnumIter , DeriveColumn)] pub enum Column { Id , Email , FirstName , LastName , PasswordHash , ApiToken , CreatedAt , UpdatedAt , DeletedAt , Metadata , Role , } #[derive(Copy, Clone, Debug, EnumIter, DerivePrimaryKey)]
pub enum PrimaryKey {
Id,
}
# [derive (Copy , Clone , Debug , EnumIter , DerivePrimaryKey)] pub enum PrimaryKey { Id , } impl PrimaryKeyTrait for PrimaryKey {
type ValueType = String;
fn auto_increment() -> bool {
false
}
}
impl PrimaryKeyTrait for PrimaryKey { type ValueType = String ; fn auto_increment () -> bool { false } } #[derive(Copy, Clone, Debug, EnumIter)]
pub enum Relation {
BatchJobs,
}
# [derive (Copy , Clone , Debug , EnumIter)] pub enum Relation { BatchJobs , } impl ColumnTrait for Column {
type EntityName = Entity;
fn def(&self) -> ColumnDef {
match self {
Self::Id => ColumnType::String(None).def(),
Self::Email => ColumnType::String(None).def(),
Self::FirstName => ColumnType::String(None).def().null(),
Self::LastName => ColumnType::String(None).def().null(),
Self::PasswordHash => ColumnType::String(None).def().null(),
Self::ApiToken => ColumnType::String(None).def().null(),
Self::CreatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::UpdatedAt => ColumnType::TimestampWithTimeZone.def(),
Self::DeletedAt => ColumnType::TimestampWithTimeZone.def().null(),
Self::Metadata => ColumnType::JsonBinary.def().null(),
Self::Role => UserRoles::db_type().def().null(),
}
}
}
impl ColumnTrait for Column { type EntityName = Entity ; fn def (& self) -> ColumnDef { match self { Self :: Id => ColumnType :: String (None) . def () , Self :: Email => ColumnType :: String (None) . def () , Self :: FirstName => ColumnType :: String (None) . def () . null () , Self :: LastName => ColumnType :: String (None) . def () . null () , Self :: PasswordHash => ColumnType :: String (None) . def () . null () , Self :: ApiToken => ColumnType :: String (None) . def () . null () , Self :: CreatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: UpdatedAt => ColumnType :: TimestampWithTimeZone . def () , Self :: DeletedAt => ColumnType :: TimestampWithTimeZone . def () . null () , Self :: Metadata => ColumnType :: JsonBinary . def () . null () , Self :: Role => UserRoles :: db_type () . def () . null () , } } } impl RelationTrait for Relation {
fn def(&self) -> RelationDef {
match self {
Self::BatchJobs => Entity::has_many(super::batch_jobs::Entity).into(),
}
}
}
impl RelationTrait for Relation { fn def (& self) -> RelationDef { match self { Self :: BatchJobs => Entity :: has_many (super :: batch_jobs :: Entity) . into () , } } } impl Related<super::batch_jobs::Entity> for Entity {
fn to() -> RelationDef {
impl Related < super :: batch_jobs :: Entity > for Entity { fn to () -> RelationDef { Relation :: BatchJobs . def () } } Relation::BatchJobs.def()
}
}
impl ActiveModelBehavior for ActiveModel {} impl ActiveModelBehavior for ActiveModel {}

View File

@ -99,16 +99,17 @@ impl Migration {
m.create_constraint( m.create_constraint(
LineItems, LineItems,
Check::less_eq(ShippedQuantity, FulfilledQuantity), Check::less_eq(ShippedQuantity, FulfilledQuantity),
None,
) )
.await?; .await?;
m.create_constraint(LineItems, Check::greater(Quantity, 0.iden())) m.create_constraint(LineItems, Check::greater(Quantity, 0.iden()), None)
.await?; .await?;
m.create_constraint(LineItems, Check::less_eq(ReturnedQuantity, Quantity)) m.create_constraint(LineItems, Check::less_eq(ReturnedQuantity, Quantity), None)
.await?; .await?;
m.create_constraint(LineItems, Check::less_eq(FulfilledQuantity, Quantity)) m.create_constraint(LineItems, Check::less_eq(FulfilledQuantity, Quantity), None)
.await?; .await?;
Ok(()) Ok(())

View File

@ -253,7 +253,12 @@ impl Display for Constraint {
#[async_trait] #[async_trait]
pub trait CreateConstraint { pub trait CreateConstraint {
async fn create_constraint<T, C>(&self, table: T, c: C) -> Result<(), DbErr> async fn create_constraint<T, C>(
&self,
table: T,
c: C,
name: Option<String>,
) -> Result<(), DbErr>
where where
T: Iden + Send, T: Iden + Send,
C: Into<Constraint> + Send; C: Into<Constraint> + Send;
@ -261,7 +266,12 @@ pub trait CreateConstraint {
#[async_trait] #[async_trait]
impl CreateConstraint for SchemaManager<'_> { impl CreateConstraint for SchemaManager<'_> {
async fn create_constraint<T, C>(&self, table: T, c: C) -> Result<(), DbErr> async fn create_constraint<T, C>(
&self,
table: T,
c: C,
name: Option<String>,
) -> Result<(), DbErr>
where where
T: Iden + Send, T: Iden + Send,
C: Into<Constraint> + Send, C: Into<Constraint> + Send,
@ -271,7 +281,7 @@ impl CreateConstraint for SchemaManager<'_> {
.execute_unprepared(&format!( .execute_unprepared(&format!(
"ALTER TABLE {} ADD CONSTRAINT {} {}", "ALTER TABLE {} ADD CONSTRAINT {} {}",
table.to_string(), table.to_string(),
c.to_name(), name.unwrap_or_else(|| c.to_name()),
c c
)) ))
.await?; .await?;
@ -288,15 +298,10 @@ mod tests {
#[derive(Iden)] #[derive(Iden)]
pub enum ShippingMethod { pub enum ShippingMethod {
ShippingMethods,
Id,
ShippingOptionId,
OrderId, OrderId,
CartId, CartId,
SwapId, SwapId,
ReturnId, ReturnId,
Price,
Data,
ClaimOrderId, ClaimOrderId,
} }

View File

@ -1,8 +1,10 @@
use sea_orm_migration::prelude::*; use sea_orm_migration::prelude::*;
use crate::constraint::Check; use crate::constraint::Check;
use crate::sea_orm::Iterable;
use crate::{ use crate::{
auto_uuid_not_null, ts_def_now_not_null, AsIden, CreateConstraint, DropTable, IntoColumnDef, auto_uuid_not_null, ts_def_now_not_null, AsIden, CreateConstraint, CreateIndexExt, DropTable,
IntoColumnDef,
}; };
#[derive(DeriveMigrationName)] #[derive(DeriveMigrationName)]
@ -48,18 +50,20 @@ impl Migration {
/// ); /// );
/// ``` /// ```
async fn create_tracking_links(m: &SchemaManager<'_>) -> Result<(), DbErr> { async fn create_tracking_links(m: &SchemaManager<'_>) -> Result<(), DbErr> {
use TrackingLink::*;
m.create_table( m.create_table(
Table::create() Table::create()
.table(TrackingLink::TrackingLinks) .table(TrackingLinks)
.col(auto_uuid_not_null!(TrackingLink::Id)) .col(auto_uuid_not_null!(Id))
.col(TrackingLink::Url.col().string()) .col(Url.col().string())
.col(TrackingLink::TrackingNumber.col().string().not_null()) .col(TrackingNumber.col().string().not_null())
.col(TrackingLink::FulfillmentId.col().uuid().not_null()) .col(FulfillmentId.col().uuid().not_null())
.col(ts_def_now_not_null!(TrackingLink::CreatedAt)) .col(ts_def_now_not_null!(CreatedAt))
.col(ts_def_now_not_null!(TrackingLink::UpdatedAt)) .col(ts_def_now_not_null!(UpdatedAt))
.col(TrackingLink::DeletedAt.col().timestamp()) .col(DeletedAt.col().timestamp())
.col(TrackingLink::Metadata.col().json_binary()) .col(Metadata.col().json_binary())
.col(TrackingLink::IdempotencyKey.col().uuid()) .col(IdempotencyKey.col().uuid())
.to_owned(), .to_owned(),
) )
.await?; .await?;
@ -80,30 +84,25 @@ impl Migration {
/// ); /// );
/// ``` /// ```
async fn create_custom_shipping_options(m: &SchemaManager<'_>) -> Result<(), DbErr> { async fn create_custom_shipping_options(m: &SchemaManager<'_>) -> Result<(), DbErr> {
use CustomShippingOption::*;
m.create_table( m.create_table(
Table::create() Table::create()
.table(CustomShippingOption::CustomShippingOptions) .table(CustomShippingOptions)
.col(auto_uuid_not_null!(CustomShippingOption::Id)) .col(auto_uuid_not_null!(Id))
.col(CustomShippingOption::Price.col().integer().not_null()) .col(Price.col().integer().not_null())
.col( .col(ShippingOptionId.col().uuid().not_null())
CustomShippingOption::ShippingOptionId .col(CartId.col().uuid().not_null())
.col() .col(ts_def_now_not_null!(CreatedAt))
.uuid() .col(ts_def_now_not_null!(UpdatedAt))
.not_null(), .col(DeletedAt.col().timestamp())
) .col(Metadata.col().json_binary())
.col(CustomShippingOption::CartId.col().uuid().not_null())
.col(ts_def_now_not_null!(CustomShippingOption::CreatedAt))
.col(ts_def_now_not_null!(CustomShippingOption::UpdatedAt))
.col(CustomShippingOption::DeletedAt.col().timestamp())
.col(CustomShippingOption::Metadata.col().json_binary())
.to_owned(), .to_owned(),
) )
.await?; .await?;
Ok(()) Ok(())
} }
//###########################################
/// ```sql /// ```sql
/// CREATE TABLE shipping_methods /// CREATE TABLE shipping_methods
/// ( /// (
@ -129,19 +128,35 @@ impl Migration {
/// ); /// );
/// ``` /// ```
async fn create_shipping_methods(m: &SchemaManager<'_>) -> Result<(), DbErr> { async fn create_shipping_methods(m: &SchemaManager<'_>) -> Result<(), DbErr> {
m.create_constraint( use ShippingMethod::*;
ShippingMethod::ShippingMethods,
Check::greater_eq(ShippingMethod::Price, 0.iden()), m.create_table(
Table::create()
.table(ShippingMethods)
.col(auto_uuid_not_null!(Id))
.col(ShippingOptionId.col().uuid().not_null())
.col(OrderId.col().uuid())
.col(CartId.col().uuid())
.col(SwapId.col().uuid())
.col(ReturnId.col().uuid())
.col(Price.col().integer().not_null())
.col(Data.col().json_binary().not_null())
.col(ClaimOrderId.col().uuid())
.to_owned(),
) )
.await?; .await?;
m.create_constraint(ShippingMethods, Check::greater_eq(Price, 0.iden()), None)
.await?;
m.create_constraint( m.create_constraint(
ShippingMethod::ShippingMethods, ShippingMethods,
Check::not_null(ShippingMethod::ClaimOrderId) Check::not_null(ClaimOrderId)
| Check::not_null(ShippingMethod::OrderId) | Check::not_null(OrderId)
| Check::not_null(ShippingMethod::CartId) | Check::not_null(CartId)
| Check::not_null(ShippingMethod::SwapId) | Check::not_null(SwapId)
| Check::not_null(ShippingMethod::ReturnId), | Check::not_null(ReturnId),
None,
) )
.await?; .await?;
Ok(()) Ok(())
@ -161,6 +176,23 @@ impl Migration {
/// ); /// );
/// ``` /// ```
async fn create_shipping_method_tax_lines(m: &SchemaManager<'_>) -> Result<(), DbErr> { async fn create_shipping_method_tax_lines(m: &SchemaManager<'_>) -> Result<(), DbErr> {
use ShippingMethodTaxLine::*;
m.create_table(
Table::create()
.table(ShippingMethodTaxLines)
.col(auto_uuid_not_null!(Id))
.col(Rate.col().double().not_null())
.col(Name.col().string().not_null())
.col(Code.col().string())
.col(ts_def_now_not_null!(CreatedAt))
.col(ts_def_now_not_null!(UpdatedAt))
.col(Metadata.col().json_binary())
.col(ShippingMethodId.col().uuid().not_null())
.to_owned(),
)
.await?;
Ok(()) Ok(())
} }
@ -185,11 +217,40 @@ impl Migration {
/// ); /// );
/// ```` /// ````
async fn create_shipping_options(m: &SchemaManager<'_>) -> Result<(), DbErr> { async fn create_shipping_options(m: &SchemaManager<'_>) -> Result<(), DbErr> {
m.create_constraint( use ShippingOption::*;
ShippingOption::ShippingOptions,
Check::greater_eq(ShippingOption::Amount, 0.iden()), m.create_table(
Table::create()
.table(ShippingOptions)
.col(auto_uuid_not_null!(Id))
.col(Name.col().string().not_null())
.col(RegionId.col().uuid().not_null())
.col(ProfileId.col().uuid().not_null())
.col(ProviderId.col().uuid().not_null())
.col(
PriceType
.col()
.enumeration(
crate::types::ShippingOptionPriceType::ShippingOptionPriceTypes,
crate::types::ShippingOptionPriceType::iter().skip(1),
)
.not_null(),
)
.col(Amount.col().integer())
.col(IsReturn.col().boolean().default(false).not_null())
.col(Data.col().json_binary().not_null())
.col(ts_def_now_not_null!(CreatedAt))
.col(ts_def_now_not_null!(UpdatedAt))
.col(DeletedAt.col().timestamp())
.col(Metadata.col().json_binary())
.col(AdminOnly.col().boolean().default(false).not_null())
.to_owned(),
) )
.await?; .await?;
m.create_constraint(ShippingOptions, Check::greater_eq(Amount, 0.iden()), None)
.await?;
Ok(()) Ok(())
} }
@ -204,6 +265,28 @@ impl Migration {
/// ); /// );
/// ``` /// ```
async fn create_shipping_option_requirements(m: &SchemaManager<'_>) -> Result<(), DbErr> { async fn create_shipping_option_requirements(m: &SchemaManager<'_>) -> Result<(), DbErr> {
use ShippingOptionRequirement::*;
m.create_table(
Table::create()
.table(ShippingOptionRequirements)
.col(auto_uuid_not_null!(Id))
.col(ShippingOptionId.col().uuid().not_null())
.col(
ShippingOptionRequirementType
.col()
.enumeration(
crate::types::ShippingOptionRequirementType::ShippingOptionRequirementTypes,
crate::types::ShippingOptionRequirementType::iter().skip(1)
)
.not_null(),
)
.col(Amount.col().integer().not_null())
.col(DeletedAt.col().timestamp())
.to_owned(),
)
.await?;
Ok(()) Ok(())
} }
@ -220,6 +303,30 @@ impl Migration {
/// ); /// );
/// ``` /// ```
async fn create_shipping_profiles(m: &SchemaManager<'_>) -> Result<(), DbErr> { async fn create_shipping_profiles(m: &SchemaManager<'_>) -> Result<(), DbErr> {
use ShippingProfile::*;
m.create_table(
Table::create()
.table(ShippingProfiles)
.col(auto_uuid_not_null!(Id))
.col(Name.col().string().not_null())
.col(
ShippingProfileType
.col()
.enumeration(
crate::types::ShippingProfileType::ShippingProfileTypes,
crate::types::ShippingProfileType::iter().skip(1),
)
.not_null(),
)
.col(ts_def_now_not_null!(CreatedAt))
.col(ts_def_now_not_null!(UpdatedAt))
.col(DeletedAt.col().timestamp())
.col(Metadata.col().json_binary())
.to_owned(),
)
.await?;
Ok(()) Ok(())
} }
@ -234,6 +341,23 @@ impl Migration {
/// ); /// );
/// ``` /// ```
async fn create_shipping_tax_rates(m: &SchemaManager<'_>) -> Result<(), DbErr> { async fn create_shipping_tax_rates(m: &SchemaManager<'_>) -> Result<(), DbErr> {
use ShippingTaxRate::*;
m.create_table(
Table::create()
.table(ShippingTaxRates)
.col(ShippingOptionId.col().uuid().not_null())
.col(RateId.col().uuid().not_null())
.col(ts_def_now_not_null!(CreatedAt))
.col(ts_def_now_not_null!(UpdatedAt))
.col(Metadata.col().json_binary())
.to_owned(),
)
.await?;
m.create_2col_idx(ShippingTaxRates, ShippingOptionId, RateId)
.await?;
Ok(()) Ok(())
} }
} }
@ -265,8 +389,6 @@ pub enum CustomShippingOption {
Metadata, Metadata,
} }
//#############################
#[derive(Iden)] #[derive(Iden)]
pub enum ShippingMethod { pub enum ShippingMethod {
ShippingMethods, ShippingMethods,
@ -329,7 +451,14 @@ pub enum ShippingProfile {
Id, Id,
Name, Name,
ShippingProfileType, ShippingProfileType,
CreatedAt,
UpdatedAt,
DeletedAt, DeletedAt,
Metadata,
}
#[derive(Iden, Copy, Clone)]
pub enum ShippingTaxRate {
ShippingTaxRates, ShippingTaxRates,
ShippingOptionId, ShippingOptionId,
RateId, RateId,