cli

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

commit 3d552da5634d549bf7b3751a785c71893d88b771
parent b4852735871eb3fa7deb96eee8f3622656c90c71
Author: triesap <tyson@radroots.org>
Date:   Wed,  6 May 2026 13:50:57 +0000

cli: omit inactive payment status output

- keep future payment projection available to internal reducers
- hide not-recorded payment status from public initial workflow json
- preserve active payment details only when signed payment events exist
- keep deferred command behavior aligned with the no-payment spec

Diffstat:
Msrc/domain/runtime.rs | 12+++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/domain/runtime.rs b/src/domain/runtime.rs @@ -1831,7 +1831,7 @@ pub struct OrderStatusView { pub fulfillment: Option<OrderStatusFulfillmentView>, #[serde(skip_serializing_if = "Option::is_none")] pub lifecycle: Option<OrderStatusLifecycleView>, - #[serde(skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "inactive_status_payment")] pub payment: Option<OrderStatusPaymentView>, #[serde(default, skip_serializing_if = "Vec::is_empty")] pub reducer_issues: Vec<OrderIssueView>, @@ -1921,6 +1921,16 @@ pub struct OrderStatusPaymentView { pub issues: Vec<OrderIssueView>, } +fn inactive_status_payment(payment: &Option<OrderStatusPaymentView>) -> bool { + payment.as_ref().is_none_or(|payment| { + payment.state == "not_recorded" + && payment.settlement_state == "not_required" + && payment.payment_event_id.is_none() + && payment.settlement_event_id.is_none() + && payment.issues.is_empty() + }) +} + #[derive(Debug, Clone, Serialize)] pub struct OrderStatusLifecycleView { pub phase: String,