45 lines
1.3 KiB
Rust
45 lines
1.3 KiB
Rust
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.20
|
|
|
|
use sea_orm::entity::prelude::*;
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
|
|
#[sea_orm(table_name = "orders")]
|
|
pub struct Model {
|
|
pub created_at: DateTimeWithTimeZone,
|
|
pub updated_at: DateTimeWithTimeZone,
|
|
#[sea_orm(primary_key)]
|
|
pub id: i32,
|
|
#[sea_orm(unique)]
|
|
pub order_number: String,
|
|
pub email: String,
|
|
pub customer_name: Option<String>,
|
|
pub status: String,
|
|
pub total_cents: i64,
|
|
pub currency: String,
|
|
pub address: Option<String>,
|
|
pub city: Option<String>,
|
|
pub zip: Option<String>,
|
|
pub country: Option<String>,
|
|
#[sea_orm(column_type = "Text", nullable)]
|
|
pub note: Option<String>,
|
|
pub payment_method: Option<String>,
|
|
pub carrier_code: Option<String>,
|
|
pub carrier_name: Option<String>,
|
|
pub shipping_cents: i64,
|
|
pub pickup_point_id: Option<String>,
|
|
pub pickup_point_name: Option<String>,
|
|
}
|
|
|
|
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
|
pub enum Relation {
|
|
#[sea_orm(has_many = "super::order_items::Entity")]
|
|
OrderItems,
|
|
}
|
|
|
|
impl Related<super::order_items::Entity> for Entity {
|
|
fn to() -> RelationDef {
|
|
Relation::OrderItems.def()
|
|
}
|
|
}
|