commit 947114ee0542e77ebb07941f5dd1ae03db20146b
parent 8101c9ae14012f2b1e22a0d6db25b2302e54385c
Author: triesap <tyson@radroots.org>
Date: Tue, 26 May 2026 05:01:35 +0000
market: expose primary bin id in output
Diffstat:
4 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/src/domain/runtime.rs b/src/domain/runtime.rs
@@ -2972,6 +2972,8 @@ pub struct ListingGetView {
#[serde(skip_serializing_if = "Option::is_none")]
pub listing_addr: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
+ pub primary_bin_id: Option<String>,
+ #[serde(skip_serializing_if = "Option::is_none")]
pub title: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub category: Option<String>,
@@ -3165,6 +3167,8 @@ pub struct FindResultView {
pub readiness: MarketReadinessView,
#[serde(skip_serializing_if = "Option::is_none")]
pub listing_addr: Option<String>,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub primary_bin_id: Option<String>,
pub title: String,
pub category: String,
#[serde(skip_serializing_if = "Option::is_none")]
diff --git a/src/operation_market.rs b/src/operation_market.rs
@@ -440,6 +440,7 @@ mod tests {
product_key: "eggs".to_owned(),
readiness: readiness_enabled(),
listing_addr: Some(LISTING_ADDR.to_owned()),
+ primary_bin_id: Some("bin-1".to_owned()),
title: "Eggs".to_owned(),
category: "eggs".to_owned(),
summary: None,
@@ -470,6 +471,7 @@ mod tests {
listing_id: Some("listing_eggs".to_owned()),
product_key: Some("eggs".to_owned()),
listing_addr: Some(LISTING_ADDR.to_owned()),
+ primary_bin_id: Some("bin-1".to_owned()),
title: Some("Eggs".to_owned()),
category: Some("eggs".to_owned()),
description: None,
@@ -506,6 +508,7 @@ mod tests {
product_key: "eggs".to_owned(),
readiness: readiness_disabled(),
listing_addr: Some(LISTING_ADDR.to_owned()),
+ primary_bin_id: Some("bin-1".to_owned()),
title: "Eggs".to_owned(),
category: "eggs".to_owned(),
summary: None,
@@ -533,6 +536,7 @@ mod tests {
listing_id: Some("listing_eggs".to_owned()),
product_key: Some("eggs".to_owned()),
listing_addr: Some(LISTING_ADDR.to_owned()),
+ primary_bin_id: Some("bin-1".to_owned()),
title: Some("Eggs".to_owned()),
category: Some("eggs".to_owned()),
description: None,
diff --git a/src/runtime/find.rs b/src/runtime/find.rs
@@ -99,6 +99,7 @@ pub fn search(config: &RuntimeConfig, args: &FindQueryArgs) -> Result<FindView,
product_key: row.key,
readiness,
listing_addr,
+ primary_bin_id: row.primary_bin_id.and_then(non_empty),
title: row.title,
category: row.category,
summary: non_empty(row.summary),
diff --git a/src/runtime/listing.rs b/src/runtime/listing.rs
@@ -1611,6 +1611,7 @@ pub fn get(
listing_id: None,
product_key: None,
listing_addr: None,
+ primary_bin_id: None,
title: None,
category: None,
description: None,
@@ -1634,6 +1635,7 @@ pub fn get(
listing_id: None,
product_key: None,
listing_addr: None,
+ primary_bin_id: None,
title: None,
category: None,
description: None,
@@ -1675,6 +1677,7 @@ pub fn get(
listing_id: Some(row.id),
product_key: Some(row.key),
listing_addr,
+ primary_bin_id: row.primary_bin_id.and_then(non_empty),
title: Some(row.title),
category: Some(row.category),
description: non_empty(row.summary),