about summary refs log tree commit diff stats
path: root/crates/rocie-server/src/api/set/product.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/rocie-server/src/api/set/product.rs')
-rw-r--r--crates/rocie-server/src/api/set/product.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/crates/rocie-server/src/api/set/product.rs b/crates/rocie-server/src/api/set/product.rs
index d347ee7..7372d23 100644
--- a/crates/rocie-server/src/api/set/product.rs
+++ b/crates/rocie-server/src/api/set/product.rs
@@ -9,13 +9,22 @@ use crate::{
         insert::Operations,
         product::{Product, ProductId, ProductIdStub},
         unit::Unit,
+        unit_property::UnitPropertyId,
     },
 };
 
 #[derive(Deserialize, ToSchema)]
 struct ProductStub {
+    /// The name of the product
     name: String,
+
+    /// The Unit Property to use for this product.
+    unit_property: UnitPropertyId,
+
+    /// A description.
     description: Option<String>,
+
+    /// A parent of this product, otherwise the parent will be the root of the parent tree.
     parent: Option<ProductId>,
 }
 
@@ -46,6 +55,7 @@ pub(crate) async fn register_product(
         product_stub.name.clone(),
         product_stub.description.clone(),
         product_stub.parent,
+        product_stub.unit_property,
         &mut ops,
     );
 
@@ -77,7 +87,10 @@ pub(crate) async fn register_product(
         )
     ),
     params (
-        ("id" = ProductId, description = "The id of the product to associated the barcode with"),
+        (
+            "id" = ProductId,
+            description = "The id of the product to associated the barcode with"
+        ),
     ),
     request_body = Barcode,
 )]