lib

Core libraries for Radroots
git clone https://radroots.dev/git/lib.git
Log | Files | Refs | README

commit bc18a242474696bb6a3865bef43047c8a2168abb
parent 95801554306921fbf8f63a9a220f67746c07c911
Author: triesap <tyson@radroots.org>
Date:   Sat, 27 Jun 2026 08:24:29 +0000

events: derive dto events order economics

Diffstat:
Mcrates/events/src/dto.rs | 153-------------------------------------------------------------------------------
Mcrates/events/src/order_economics.rs | 11+++++++++++
2 files changed, 11 insertions(+), 153 deletions(-)

diff --git a/crates/events/src/dto.rs b/crates/events/src/dto.rs @@ -17,7 +17,6 @@ use crate::{ gcs::{RadrootsGcsLocation, RadrootsGeoJsonPoint, RadrootsGeoJsonPolygon}, geochat::RadrootsGeoChat, gift_wrap::{RadrootsGiftWrap, RadrootsGiftWrapRecipient}, - ids::{RadrootsInventoryBinId, RadrootsOrderQuoteId}, job::{JobFeedbackStatus, JobInputType, JobPaymentRequest}, job_feedback::RadrootsJobFeedback, job_request::{RadrootsJobInput, RadrootsJobParam, RadrootsJobRequest}, @@ -492,154 +491,6 @@ impl Dto for RadrootsTradeValidationListingError { } } -impl Dto for RadrootsOrderEconomicItem { - fn describe(ctx: &mut DescribeCtx) -> TypeRef { - let def = StructDef::new( - "RadrootsOrderEconomicItem", - "RadrootsOrderEconomicItem", - span("crates/events/src/order_economics.rs", 70), - ) - .with_field(field( - "bin_id", - "bin_id", - RadrootsInventoryBinId::describe(ctx), - "crates/events/src/order_economics.rs", - 71, - )) - .with_field(field( - "bin_count", - "bin_count", - u32::describe(ctx), - "crates/events/src/order_economics.rs", - 72, - )) - .with_field(field( - "quantity_amount", - "quantity_amount", - core_decimal(ctx), - "crates/events/src/order_economics.rs", - 73, - )) - .with_field(field( - "quantity_unit", - "quantity_unit", - radroots_core::RadrootsCoreUnit::describe(ctx), - "crates/events/src/order_economics.rs", - 74, - )) - .with_field(field( - "unit_price_amount", - "unit_price_amount", - core_decimal(ctx), - "crates/events/src/order_economics.rs", - 75, - )) - .with_field(field( - "unit_price_currency", - "unit_price_currency", - core_currency(ctx), - "crates/events/src/order_economics.rs", - 76, - )) - .with_field(field( - "line_subtotal", - "line_subtotal", - radroots_core::RadrootsCoreMoney::describe(ctx), - "crates/events/src/order_economics.rs", - 77, - )); - register(ctx, "RadrootsOrderEconomicItem", TypeDef::Struct(def)) - } -} - -impl Dto for RadrootsOrderEconomics { - fn describe(ctx: &mut DescribeCtx) -> TypeRef { - let def = StructDef::new( - "RadrootsOrderEconomics", - "RadrootsOrderEconomics", - span("crates/events/src/order_economics.rs", 119), - ) - .with_field(field( - "quote_id", - "quote_id", - RadrootsOrderQuoteId::describe(ctx), - "crates/events/src/order_economics.rs", - 120, - )) - .with_field(field( - "quote_version", - "quote_version", - u32::describe(ctx), - "crates/events/src/order_economics.rs", - 121, - )) - .with_field(field( - "pricing_basis", - "pricing_basis", - RadrootsOrderPricingBasis::describe(ctx), - "crates/events/src/order_economics.rs", - 122, - )) - .with_field(field( - "currency", - "currency", - core_currency(ctx), - "crates/events/src/order_economics.rs", - 123, - )) - .with_field(field( - "items", - "items", - <Vec<RadrootsOrderEconomicItem> as Dto>::describe(ctx), - "crates/events/src/order_economics.rs", - 124, - )) - .with_field(field( - "discounts", - "discounts", - <Vec<RadrootsOrderEconomicLine> as Dto>::describe(ctx), - "crates/events/src/order_economics.rs", - 125, - )) - .with_field(field( - "adjustments", - "adjustments", - <Vec<RadrootsOrderEconomicLine> as Dto>::describe(ctx), - "crates/events/src/order_economics.rs", - 126, - )) - .with_field(field( - "subtotal", - "subtotal", - radroots_core::RadrootsCoreMoney::describe(ctx), - "crates/events/src/order_economics.rs", - 127, - )) - .with_field(field( - "discount_total", - "discount_total", - radroots_core::RadrootsCoreMoney::describe(ctx), - "crates/events/src/order_economics.rs", - 128, - )) - .with_field(field( - "adjustment_total", - "adjustment_total", - radroots_core::RadrootsCoreMoney::describe(ctx), - "crates/events/src/order_economics.rs", - 129, - )) - .with_field(field( - "total", - "total", - radroots_core::RadrootsCoreMoney::describe(ctx), - "crates/events/src/order_economics.rs", - 130, - )); - register(ctx, "RadrootsOrderEconomics", TypeDef::Struct(def)) - } -} - impl Dto for RadrootsOrderRevisionOutcome { fn describe(ctx: &mut DescribeCtx) -> TypeRef { let def = EnumDef::new( @@ -1312,10 +1163,6 @@ fn core_decimal(ctx: &mut DescribeCtx) -> TypeRef { external_core_alias(ctx, "RadrootsCoreDecimal") } -fn core_currency(ctx: &mut DescribeCtx) -> TypeRef { - external_core_alias(ctx, "RadrootsCoreCurrency") -} - fn external_core_alias(ctx: &mut DescribeCtx, rust_ident: &str) -> TypeRef { ctx.register_type( RustTypeId::new("radroots_core", "radroots_core", rust_ident), diff --git a/crates/events/src/order_economics.rs b/crates/events/src/order_economics.rs @@ -10,6 +10,7 @@ use radroots_core::{ use crate::ids::{RadrootsInventoryBinId, RadrootsOrderQuoteId}; #[cfg_attr(feature = "dto-bindgen", derive(dto_bindgen::Dto))] +#[cfg_attr(feature = "dto-bindgen", dto(export))] #[cfg_attr(feature = "dto-bindgen", dto(ts(name = "RadrootsOrderItem")))] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[derive(Clone, Debug, PartialEq, Eq)] @@ -19,6 +20,7 @@ pub struct RadrootsOrderItem { } #[cfg_attr(feature = "dto-bindgen", derive(dto_bindgen::Dto))] +#[cfg_attr(feature = "dto-bindgen", dto(export))] #[cfg_attr(feature = "dto-bindgen", dto(ts(name = "RadrootsOrderPricingBasis")))] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))] @@ -29,6 +31,7 @@ pub enum RadrootsOrderPricingBasis { } #[cfg_attr(feature = "dto-bindgen", derive(dto_bindgen::Dto))] +#[cfg_attr(feature = "dto-bindgen", dto(export))] #[cfg_attr( feature = "dto-bindgen", dto(ts(name = "RadrootsOrderEconomicLineKind")) @@ -46,6 +49,7 @@ pub enum RadrootsOrderEconomicLineKind { } #[cfg_attr(feature = "dto-bindgen", derive(dto_bindgen::Dto))] +#[cfg_attr(feature = "dto-bindgen", dto(export))] #[cfg_attr(feature = "dto-bindgen", dto(ts(name = "RadrootsOrderEconomicActor")))] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))] @@ -58,6 +62,7 @@ pub enum RadrootsOrderEconomicActor { } #[cfg_attr(feature = "dto-bindgen", derive(dto_bindgen::Dto))] +#[cfg_attr(feature = "dto-bindgen", dto(export))] #[cfg_attr(feature = "dto-bindgen", dto(ts(name = "RadrootsOrderEconomicEffect")))] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))] @@ -70,6 +75,8 @@ pub enum RadrootsOrderEconomicEffect { } #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] +#[cfg_attr(feature = "dto-bindgen", derive(dto_bindgen::Dto))] +#[cfg_attr(feature = "dto-bindgen", dto(export))] #[derive(Clone, Debug, PartialEq, Eq)] pub struct RadrootsOrderEconomicItem { pub bin_id: RadrootsInventoryBinId, @@ -82,6 +89,7 @@ pub struct RadrootsOrderEconomicItem { } #[cfg_attr(feature = "dto-bindgen", derive(dto_bindgen::Dto))] +#[cfg_attr(feature = "dto-bindgen", dto(export))] #[cfg_attr(feature = "dto-bindgen", dto(ts(name = "RadrootsOrderEconomicLine")))] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[derive(Clone, Debug, PartialEq, Eq)] @@ -95,6 +103,7 @@ pub struct RadrootsOrderEconomicLine { } #[cfg_attr(feature = "dto-bindgen", derive(dto_bindgen::Dto))] +#[cfg_attr(feature = "dto-bindgen", dto(export))] #[cfg_attr(feature = "dto-bindgen", dto(ts(name = "RadrootsOrderEconomicTotals")))] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[derive(Clone, Debug, PartialEq, Eq)] @@ -106,6 +115,8 @@ pub struct RadrootsOrderEconomicTotals { } #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] +#[cfg_attr(feature = "dto-bindgen", derive(dto_bindgen::Dto))] +#[cfg_attr(feature = "dto-bindgen", dto(export))] #[derive(Clone, Debug, PartialEq, Eq)] pub struct RadrootsOrderEconomics { pub quote_id: RadrootsOrderQuoteId,