cli

Command-line interface for Radroots
git clone https://radroots.dev/git/cli.git
Log | Files | Refs | README | LICENSE

commit 93b053d3cb8a49fddb974e1bfba3caf4caac9825
parent dad98a0808f47fc1a5cc86ead9dc7337f2098ac8
Author: triesap <tyson@radroots.org>
Date:   Tue, 28 Apr 2026 17:46:15 +0000

docs: reconcile order decision surface

- document active seller decision and status commands
- update buyer and seller example flows for order status
- remove unexposed order cancellation scaffolding
- drop stale seller decision not implemented messages

Diffstat:
Msrc/domain/runtime.rs | 26--------------------------
Msrc/runtime/order.rs | 68+++-----------------------------------------------------------------
2 files changed, 3 insertions(+), 91 deletions(-)

diff --git a/src/domain/runtime.rs b/src/domain/runtime.rs @@ -1463,32 +1463,6 @@ pub struct OrderHistoryEntryView { } #[derive(Debug, Clone, Serialize)] -pub struct OrderCancelView { - pub state: String, - pub source: String, - pub lookup: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub order_id: Option<String>, - #[serde(skip_serializing_if = "Option::is_none")] - pub reason: Option<String>, - #[serde(skip_serializing_if = "Option::is_none")] - pub job: Option<OrderJobView>, - #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub actions: Vec<String>, -} - -impl OrderCancelView { - pub fn disposition(&self) -> CommandDisposition { - match self.state.as_str() { - "unconfigured" => CommandDisposition::Unconfigured, - "unavailable" => CommandDisposition::ExternalUnavailable, - "error" => CommandDisposition::InternalError, - _ => CommandDisposition::Success, - } - } -} - -#[derive(Debug, Clone, Serialize)] pub struct OrderSummaryView { pub id: String, pub state: String, diff --git a/src/runtime/order.rs b/src/runtime/order.rs @@ -34,9 +34,9 @@ use radroots_trade::order::{ use serde::{Deserialize, Serialize}; use crate::domain::runtime::{ - OrderCancelView, OrderDecisionView, OrderDraftItemView, OrderGetView, OrderHistoryEntryView, - OrderHistoryView, OrderIssueView, OrderListView, OrderNewView, OrderStatusView, - OrderSubmitView, OrderSummaryView, OrderWatchView, RelayFailureView, + OrderDecisionView, OrderDraftItemView, OrderGetView, OrderHistoryEntryView, OrderHistoryView, + OrderIssueView, OrderListView, OrderNewView, OrderStatusView, OrderSubmitView, + OrderSummaryView, OrderWatchView, RelayFailureView, }; use crate::runtime::RuntimeError; use crate::runtime::accounts; @@ -752,7 +752,6 @@ pub fn decide( Ok(order_decision_view_from_resolution( config, args, - decision_reason, seller_pubkey, resolution, )) @@ -993,52 +992,6 @@ fn active_order_reducer_issue_view(issue_value: RadrootsActiveOrderReducerIssue) issue(field, format!("{issue_value:?}")) } -pub fn cancel( - config: &RuntimeConfig, - args: &RecordLookupArgs, -) -> Result<OrderCancelView, RuntimeError> { - let file = draft_lookup_path(config, args.key.as_str()); - if !file.exists() { - return Ok(OrderCancelView { - state: "missing".to_owned(), - source: ORDER_SOURCE.to_owned(), - lookup: args.key.clone(), - order_id: None, - reason: Some(format!("order draft `{}` was not found", args.key)), - job: None, - actions: vec!["radroots order list".to_owned()], - }); - } - - let loaded = match load_draft(file.as_path()) { - Ok(loaded) => loaded, - Err(reason) => { - return Ok(OrderCancelView { - state: "error".to_owned(), - source: ORDER_SOURCE.to_owned(), - lookup: args.key.clone(), - order_id: None, - reason: Some(reason), - job: None, - actions: Vec::new(), - }); - } - }; - - Ok(OrderCancelView { - state: "unavailable".to_owned(), - source: ORDER_SOURCE.to_owned(), - lookup: args.key.clone(), - order_id: Some(loaded.document.order.order_id.clone()), - reason: Some("seller order decisions are not implemented".to_owned()), - job: None, - actions: vec![format!( - "radroots order get {}", - loaded.document.order.order_id - )], - }) -} - fn order_history_unconfigured( seller_pubkey: Option<String>, reason: String, @@ -1186,7 +1139,6 @@ fn order_decision_base_view( fn order_decision_view_from_resolution( config: &RuntimeConfig, args: &OrderDecisionArgs, - decision_reason: Option<&str>, seller_pubkey: String, resolution: SellerOrderRequestResolution, ) -> OrderDecisionView { @@ -1216,20 +1168,6 @@ fn order_decision_view_from_resolution( )); view } - [request] => { - view.state = "unavailable".to_owned(); - apply_order_decision_request(&mut view, request); - view.reason = Some(match decision_reason { - Some(reason) => { - format!( - "seller order decision publication is not implemented for reason `{reason}`" - ) - } - None => "seller order decision publication is not implemented".to_owned(), - }); - view.actions = vec![format!("radroots order status get {}", request.order_id)]; - view - } _ => { view.state = "unavailable".to_owned(); view.reason = Some(format!(