commit 30460646c84f3e588ad0e1705ab49ecd04dd2de3
parent 2290e05a0612fb7d844b3dd8f4f9c38494ee0058
Author: triesap <tyson@radroots.org>
Date: Fri, 19 Jun 2026 21:20:56 -0700
cli: rename market order readiness
- replace checkout readiness output with order request readiness
- rename disabled listing reason codes away from checkout language
- update market actions, docs, and tests for agreement-only wording
- validate formatting and the CLI Nix test lane
Diffstat:
3 files changed, 56 insertions(+), 41 deletions(-)
diff --git a/src/ops/exec/market.rs b/src/ops/exec/market.rs
@@ -104,7 +104,7 @@ fn market_product_search_view(mut view: FindView) -> FindView {
"radroots market listing get {}",
result.product_key
)];
- if result.readiness.checkout_enabled {
+ if result.readiness.order_request_enabled {
actions.push("radroots basket create".to_owned());
}
actions
@@ -126,7 +126,7 @@ fn market_product_search_view(mut view: FindView) -> FindView {
fn market_listing_get_view(mut view: ListingGetView) -> ListingGetView {
view.actions = match view.state.as_str() {
"ready" => {
- if view.readiness.checkout_enabled {
+ if view.readiness.order_request_enabled {
vec!["radroots basket create".to_owned()]
} else {
Vec::new()
@@ -494,7 +494,7 @@ mod tests {
}
#[test]
- fn market_ready_actions_require_checkout_enabled() {
+ fn market_ready_actions_require_order_request_enabled() {
let disabled_search = market_product_search_view(FindView {
state: "ready".to_owned(),
source: "test".to_owned(),
@@ -591,7 +591,7 @@ mod tests {
MarketReadinessView {
protocol_valid: true,
marketplace_eligible: true,
- checkout_enabled: true,
+ order_request_enabled: true,
primary_bin_verified: true,
reason_codes: Vec::new(),
}
@@ -601,10 +601,10 @@ mod tests {
MarketReadinessView {
protocol_valid: true,
marketplace_eligible: true,
- checkout_enabled: false,
+ order_request_enabled: false,
primary_bin_verified: true,
reason_codes: vec![
- "listing_checkout_disabled".to_owned(),
+ "listing_order_request_disabled".to_owned(),
"listing_inventory_unavailable".to_owned(),
],
}
diff --git a/src/view/runtime.rs b/src/view/runtime.rs
@@ -1124,7 +1124,7 @@ pub struct FindHyfView {
pub struct MarketReadinessView {
pub protocol_valid: bool,
pub marketplace_eligible: bool,
- pub checkout_enabled: bool,
+ pub order_request_enabled: bool,
pub primary_bin_verified: bool,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub reason_codes: Vec<String>,
@@ -1135,7 +1135,7 @@ impl MarketReadinessView {
Self {
protocol_valid: false,
marketplace_eligible: false,
- checkout_enabled: false,
+ order_request_enabled: false,
primary_bin_verified: false,
reason_codes: vec![reason_code.into()],
}
@@ -1179,7 +1179,7 @@ impl MarketReadinessView {
&& !price_currency.trim().is_empty()
&& price_per_amount.is_finite()
&& price_per_amount > 0.0;
- let checkout_enabled =
+ let order_request_enabled =
marketplace_eligible && inventory_available && primary_bin_verified && price_available;
let mut reason_codes = Vec::new();
if !protocol_valid {
@@ -1188,8 +1188,8 @@ impl MarketReadinessView {
if protocol_valid && !marketplace_eligible {
reason_codes.push("listing_marketplace_ineligible".to_owned());
}
- if marketplace_eligible && !checkout_enabled {
- reason_codes.push("listing_checkout_disabled".to_owned());
+ if marketplace_eligible && !order_request_enabled {
+ reason_codes.push("listing_order_request_disabled".to_owned());
if !inventory_available {
reason_codes.push("listing_inventory_unavailable".to_owned());
}
@@ -1205,7 +1205,7 @@ impl MarketReadinessView {
Self {
protocol_valid,
marketplace_eligible,
- checkout_enabled,
+ order_request_enabled,
primary_bin_verified,
reason_codes,
}
@@ -1219,7 +1219,7 @@ mod market_readiness_tests {
const LISTING_ADDR: &str = "30402:1111111111111111111111111111111111111111111111111111111111111111:AAAAAAAAAAAAAAAAAAAAAg";
#[test]
- fn market_readiness_separates_protocol_marketplace_and_checkout_state() {
+ fn market_readiness_separates_protocol_marketplace_and_order_request_state() {
let enabled = MarketReadinessView::from_market_projection(
Some(LISTING_ADDR),
Some("bin-1"),
@@ -1233,7 +1233,7 @@ mod market_readiness_tests {
);
assert!(enabled.protocol_valid);
assert!(enabled.marketplace_eligible);
- assert!(enabled.checkout_enabled);
+ assert!(enabled.order_request_enabled);
assert!(enabled.primary_bin_verified);
assert!(enabled.reason_codes.is_empty());
@@ -1250,7 +1250,7 @@ mod market_readiness_tests {
);
assert!(!invalid.protocol_valid);
assert!(!invalid.marketplace_eligible);
- assert!(!invalid.checkout_enabled);
+ assert!(!invalid.order_request_enabled);
assert!(!invalid.primary_bin_verified);
assert_eq!(invalid.reason_codes, vec!["listing_protocol_invalid"]);
@@ -1267,14 +1267,14 @@ mod market_readiness_tests {
);
assert!(ineligible.protocol_valid);
assert!(!ineligible.marketplace_eligible);
- assert!(!ineligible.checkout_enabled);
+ assert!(!ineligible.order_request_enabled);
assert!(ineligible.primary_bin_verified);
assert_eq!(
ineligible.reason_codes,
vec!["listing_marketplace_ineligible"]
);
- let checkout_disabled = MarketReadinessView::from_market_projection(
+ let order_request_disabled = MarketReadinessView::from_market_projection(
Some(LISTING_ADDR),
Some("bin-1"),
Some("bin-1"),
@@ -1285,13 +1285,16 @@ mod market_readiness_tests {
"USD",
1.0,
);
- assert!(checkout_disabled.protocol_valid);
- assert!(checkout_disabled.marketplace_eligible);
- assert!(!checkout_disabled.checkout_enabled);
- assert!(checkout_disabled.primary_bin_verified);
+ assert!(order_request_disabled.protocol_valid);
+ assert!(order_request_disabled.marketplace_eligible);
+ assert!(!order_request_disabled.order_request_enabled);
+ assert!(order_request_disabled.primary_bin_verified);
assert_eq!(
- checkout_disabled.reason_codes,
- vec!["listing_checkout_disabled", "listing_inventory_unavailable"]
+ order_request_disabled.reason_codes,
+ vec![
+ "listing_order_request_disabled",
+ "listing_inventory_unavailable"
+ ]
);
let primary_bin_missing = MarketReadinessView::from_market_projection(
@@ -1307,11 +1310,14 @@ mod market_readiness_tests {
);
assert!(primary_bin_missing.protocol_valid);
assert!(primary_bin_missing.marketplace_eligible);
- assert!(!primary_bin_missing.checkout_enabled);
+ assert!(!primary_bin_missing.order_request_enabled);
assert!(!primary_bin_missing.primary_bin_verified);
assert_eq!(
primary_bin_missing.reason_codes,
- vec!["listing_checkout_disabled", "listing_primary_bin_missing"]
+ vec![
+ "listing_order_request_disabled",
+ "listing_primary_bin_missing"
+ ]
);
let primary_bin_blank = MarketReadinessView::from_market_projection(
@@ -1327,7 +1333,10 @@ mod market_readiness_tests {
);
assert_eq!(
primary_bin_blank.reason_codes,
- vec!["listing_checkout_disabled", "listing_primary_bin_missing"]
+ vec![
+ "listing_order_request_disabled",
+ "listing_primary_bin_missing"
+ ]
);
let primary_bin_invalid = MarketReadinessView::from_market_projection(
@@ -1343,11 +1352,14 @@ mod market_readiness_tests {
);
assert!(primary_bin_invalid.protocol_valid);
assert!(primary_bin_invalid.marketplace_eligible);
- assert!(!primary_bin_invalid.checkout_enabled);
+ assert!(!primary_bin_invalid.order_request_enabled);
assert!(!primary_bin_invalid.primary_bin_verified);
assert_eq!(
primary_bin_invalid.reason_codes,
- vec!["listing_checkout_disabled", "listing_primary_bin_invalid"]
+ vec![
+ "listing_order_request_disabled",
+ "listing_primary_bin_invalid"
+ ]
);
}
}
diff --git a/tests/target_cli.rs b/tests/target_cli.rs
@@ -5595,7 +5595,7 @@ fn buyer_market_sync_basket_dry_runs_preflight_without_mutating_local_state() {
}
#[test]
-fn market_checkout_readiness_gates_buyer_intent_actions() {
+fn market_order_request_readiness_gates_buyer_intent_actions() {
let sandbox = RadrootsCliSandbox::new();
seed_orderable_listing(&sandbox, LISTING_ADDR);
@@ -5604,7 +5604,7 @@ fn market_checkout_readiness_gates_buyer_intent_actions() {
let result = &search["result"]["results"][0];
assert_eq!(result["protocol_valid"], true);
assert_eq!(result["marketplace_eligible"], true);
- assert_eq!(result["checkout_enabled"], true);
+ assert_eq!(result["order_request_enabled"], true);
assert_eq!(result["primary_bin_verified"], true);
assert!(result.get("reason_codes").is_none());
assert!(
@@ -5626,7 +5626,7 @@ fn market_checkout_readiness_gates_buyer_intent_actions() {
assert_eq!(listing["operation_id"], "market.listing.get");
assert_eq!(listing["result"]["protocol_valid"], true);
assert_eq!(listing["result"]["marketplace_eligible"], true);
- assert_eq!(listing["result"]["checkout_enabled"], true);
+ assert_eq!(listing["result"]["order_request_enabled"], true);
assert_eq!(listing["result"]["primary_bin_verified"], true);
assert!(
listing["result"]["actions"]
@@ -5643,11 +5643,11 @@ fn market_checkout_readiness_gates_buyer_intent_actions() {
let disabled_result = &disabled_search["result"]["results"][0];
assert_eq!(disabled_result["protocol_valid"], true);
assert_eq!(disabled_result["marketplace_eligible"], true);
- assert_eq!(disabled_result["checkout_enabled"], false);
+ assert_eq!(disabled_result["order_request_enabled"], false);
assert_eq!(disabled_result["primary_bin_verified"], true);
assert_eq!(
disabled_result["reason_codes"][0],
- "listing_checkout_disabled"
+ "listing_order_request_disabled"
);
assert_eq!(
disabled_result["reason_codes"][1],
@@ -5671,11 +5671,11 @@ fn market_checkout_readiness_gates_buyer_intent_actions() {
]);
assert_eq!(disabled_listing["result"]["protocol_valid"], true);
assert_eq!(disabled_listing["result"]["marketplace_eligible"], true);
- assert_eq!(disabled_listing["result"]["checkout_enabled"], false);
+ assert_eq!(disabled_listing["result"]["order_request_enabled"], false);
assert_eq!(disabled_listing["result"]["primary_bin_verified"], true);
assert_eq!(
disabled_listing["result"]["reason_codes"][0],
- "listing_checkout_disabled"
+ "listing_order_request_disabled"
);
assert!(
disabled_listing["result"]
@@ -5691,11 +5691,11 @@ fn market_checkout_readiness_gates_buyer_intent_actions() {
sandbox.json_success(&["--format", "json", "market", "product", "search", "eggs"]);
let no_bin_result = &no_bin_search["result"]["results"][0];
assert_eq!(no_bin_result["primary_bin_id"], Value::Null);
- assert_eq!(no_bin_result["checkout_enabled"], false);
+ assert_eq!(no_bin_result["order_request_enabled"], false);
assert_eq!(no_bin_result["primary_bin_verified"], false);
assert_eq!(
no_bin_result["reason_codes"][0],
- "listing_checkout_disabled"
+ "listing_order_request_disabled"
);
assert_eq!(
no_bin_result["reason_codes"][1],
@@ -5718,7 +5718,7 @@ fn market_checkout_readiness_gates_buyer_intent_actions() {
"pasture-eggs",
]);
assert_eq!(no_bin_listing["result"]["primary_bin_id"], Value::Null);
- assert_eq!(no_bin_listing["result"]["checkout_enabled"], false);
+ assert_eq!(no_bin_listing["result"]["order_request_enabled"], false);
assert_eq!(no_bin_listing["result"]["primary_bin_verified"], false);
assert_eq!(
no_bin_listing["result"]["reason_codes"][1],
@@ -5737,7 +5737,7 @@ fn market_checkout_readiness_gates_buyer_intent_actions() {
sandbox.json_success(&["--format", "json", "market", "product", "search", "eggs"]);
let invalid_bin_result = &invalid_bin_search["result"]["results"][0];
assert_eq!(invalid_bin_result["primary_bin_id"], "missing-bin");
- assert_eq!(invalid_bin_result["checkout_enabled"], false);
+ assert_eq!(invalid_bin_result["order_request_enabled"], false);
assert_eq!(invalid_bin_result["primary_bin_verified"], false);
assert_eq!(
invalid_bin_result["reason_codes"][1],
@@ -5763,7 +5763,10 @@ fn market_checkout_readiness_gates_buyer_intent_actions() {
invalid_bin_listing["result"]["primary_bin_id"],
"missing-bin"
);
- assert_eq!(invalid_bin_listing["result"]["checkout_enabled"], false);
+ assert_eq!(
+ invalid_bin_listing["result"]["order_request_enabled"],
+ false
+ );
assert_eq!(invalid_bin_listing["result"]["primary_bin_verified"], false);
assert_eq!(
invalid_bin_listing["result"]["reason_codes"][1],
@@ -5787,7 +5790,7 @@ fn market_checkout_readiness_gates_buyer_intent_actions() {
"pasture-eggs",
]);
assert_eq!(restored_listing["result"]["primary_bin_id"], "bin-1");
- assert_eq!(restored_listing["result"]["checkout_enabled"], true);
+ assert_eq!(restored_listing["result"]["order_request_enabled"], true);
assert_eq!(restored_listing["result"]["primary_bin_verified"], true);
assert!(
restored_listing["result"]