use chrono::NaiveDateTime; use petro::entity::SubentityList; use rust_decimal::Decimal; use petro::entity::Entity; use petro::entity::EntityId; use petro::entity::EntityRef; use super::Customer; #[derive(Entity, Debug, Clone)] #[petro(table = "sales_order", id = "id")] pub struct Order { pub id: EntityId, pub order_number: String, pub order_date: Option, pub customer: EntityRef, pub total_amount: Decimal, pub line_items: SubentityList, } #[derive(Entity, Debug, Clone)] #[petro(table = "line_item", id = "id")] pub struct LineItem { pub id: EntityId, pub order: EntityRef, pub description: String, pub line_total: Decimal, }