From 08cf86a44a9a7c513cd12cbc4a0bac7c029b9ded Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Wed, 8 Oct 2025 11:54:04 +0200 Subject: feat(crates/rocie-server/unit-property): Init --- crates/rocie-server/src/api/set/product.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'crates/rocie-server/src/api/set/product.rs') 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, + + /// A parent of this product, otherwise the parent will be the root of the parent tree. parent: Option, } @@ -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, )] -- cgit 1.4.1