Files
kompress_eshop/src/models/_entities/discount_profiles.rs
Priec 3f798432a0
Some checks failed
CI / Check Style (push) Has been cancelled
CI / Run Clippy (push) Has been cancelled
CI / Run Tests (push) Has been cancelled
now products have different options, like different parameters
2026-06-22 15:44:02 +02:00

53 lines
1.5 KiB
Rust

//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.19
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[sea_orm(table_name = "discount_profiles")]
pub struct Model {
pub created_at: DateTimeWithTimeZone,
pub updated_at: DateTimeWithTimeZone,
#[sea_orm(primary_key)]
pub id: i32,
pub name: String,
pub percent_bp: i32,
pub scope_type: String,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(has_many = "super::account_discount_profiles::Entity")]
AccountDiscountProfiles,
#[sea_orm(has_many = "super::account_product_resolutions::Entity")]
AccountProductResolutions,
#[sea_orm(has_many = "super::audience_discount_profiles::Entity")]
AudienceDiscountProfiles,
#[sea_orm(has_many = "super::discount_profile_products::Entity")]
DiscountProfileProducts,
}
impl Related<super::account_discount_profiles::Entity> for Entity {
fn to() -> RelationDef {
Relation::AccountDiscountProfiles.def()
}
}
impl Related<super::account_product_resolutions::Entity> for Entity {
fn to() -> RelationDef {
Relation::AccountProductResolutions.def()
}
}
impl Related<super::audience_discount_profiles::Entity> for Entity {
fn to() -> RelationDef {
Relation::AudienceDiscountProfiles.def()
}
}
impl Related<super::discount_profile_products::Entity> for Entity {
fn to() -> RelationDef {
Relation::DiscountProfileProducts.def()
}
}