about summary refs log tree commit diff stats
path: root/crates/rocie-client/src/models
diff options
context:
space:
mode:
Diffstat (limited to 'crates/rocie-client/src/models')
-rw-r--r--crates/rocie-client/src/models/barcode.rs2
-rw-r--r--crates/rocie-client/src/models/barcode_id.rs2
-rw-r--r--crates/rocie-client/src/models/mod.rs6
-rw-r--r--crates/rocie-client/src/models/product.rs14
-rw-r--r--crates/rocie-client/src/models/product_amount.rs2
-rw-r--r--crates/rocie-client/src/models/product_id.rs2
-rw-r--r--crates/rocie-client/src/models/product_stub.rs11
-rw-r--r--crates/rocie-client/src/models/unit.rs13
-rw-r--r--crates/rocie-client/src/models/unit_amount.rs2
-rw-r--r--crates/rocie-client/src/models/unit_id.rs2
-rw-r--r--crates/rocie-client/src/models/unit_property.rs42
-rw-r--r--crates/rocie-client/src/models/unit_property_id.rs27
-rw-r--r--crates/rocie-client/src/models/unit_property_stub.rs30
-rw-r--r--crates/rocie-client/src/models/unit_stub.rs7
14 files changed, 148 insertions, 14 deletions
diff --git a/crates/rocie-client/src/models/barcode.rs b/crates/rocie-client/src/models/barcode.rs
index 76661dc..f44caa9 100644
--- a/crates/rocie-client/src/models/barcode.rs
+++ b/crates/rocie-client/src/models/barcode.rs
@@ -1,7 +1,7 @@
 /*
  * rocie-server
  *
- * An enterprise grocery management system
+ * An enterprise grocery management system - server
  *
  * The version of the OpenAPI document: 0.1.0
  * Contact: benedikt.peetz@b-peetz.de
diff --git a/crates/rocie-client/src/models/barcode_id.rs b/crates/rocie-client/src/models/barcode_id.rs
index 2bd4775..a081913 100644
--- a/crates/rocie-client/src/models/barcode_id.rs
+++ b/crates/rocie-client/src/models/barcode_id.rs
@@ -1,7 +1,7 @@
 /*
  * rocie-server
  *
- * An enterprise grocery management system
+ * An enterprise grocery management system - server
  *
  * The version of the OpenAPI document: 0.1.0
  * Contact: benedikt.peetz@b-peetz.de
diff --git a/crates/rocie-client/src/models/mod.rs b/crates/rocie-client/src/models/mod.rs
index 6456de7..4eabdfc 100644
--- a/crates/rocie-client/src/models/mod.rs
+++ b/crates/rocie-client/src/models/mod.rs
@@ -16,5 +16,11 @@ pub mod unit_amount;
 pub use self::unit_amount::UnitAmount;
 pub mod unit_id;
 pub use self::unit_id::UnitId;
+pub mod unit_property;
+pub use self::unit_property::UnitProperty;
+pub mod unit_property_id;
+pub use self::unit_property_id::UnitPropertyId;
+pub mod unit_property_stub;
+pub use self::unit_property_stub::UnitPropertyStub;
 pub mod unit_stub;
 pub use self::unit_stub::UnitStub;
diff --git a/crates/rocie-client/src/models/product.rs b/crates/rocie-client/src/models/product.rs
index 8fe68ee..251046c 100644
--- a/crates/rocie-client/src/models/product.rs
+++ b/crates/rocie-client/src/models/product.rs
@@ -1,7 +1,7 @@
 /*
  * rocie-server
  *
- * An enterprise grocery management system
+ * An enterprise grocery management system - server
  *
  * The version of the OpenAPI document: 0.1.0
  * Contact: benedikt.peetz@b-peetz.de
@@ -11,25 +11,35 @@
 use crate::models;
 use serde::{Deserialize, Serialize};
 
+/// Product : The base of rocie.  Products can be bought and consumed and represent, what you actually have in storage. Not every product is bought, as some can also be obtained by cooking a recipe.
 #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
 pub struct Product {
+    /// Which barcodes are associated with this product.
     #[serde(rename = "associated_bar_codes")]
     pub associated_bar_codes: Vec<models::Barcode>,
+    /// An optional description of this product.
     #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
     pub description: Option<Option<String>>,
+    /// The id of the product.
     #[serde(rename = "id")]
     pub id: models::ProductId,
+    /// The name of the product.  This should be globally unique, to make searching easier for the user.
     #[serde(rename = "name")]
     pub name: String,
+    /// The property this product is measured in.  (This is probably always either Mass, Volume or Quantity).
+    #[serde(rename = "unit_property")]
+    pub unit_property: models::UnitPropertyId,
 }
 
 impl Product {
-    pub fn new(associated_bar_codes: Vec<models::Barcode>, id: models::ProductId, name: String) -> Product {
+    /// The base of rocie.  Products can be bought and consumed and represent, what you actually have in storage. Not every product is bought, as some can also be obtained by cooking a recipe.
+    pub fn new(associated_bar_codes: Vec<models::Barcode>, id: models::ProductId, name: String, unit_property: models::UnitPropertyId) -> Product {
         Product {
             associated_bar_codes,
             description: None,
             id,
             name,
+            unit_property,
         }
     }
 }
diff --git a/crates/rocie-client/src/models/product_amount.rs b/crates/rocie-client/src/models/product_amount.rs
index 1a2ed02..43ab725 100644
--- a/crates/rocie-client/src/models/product_amount.rs
+++ b/crates/rocie-client/src/models/product_amount.rs
@@ -1,7 +1,7 @@
 /*
  * rocie-server
  *
- * An enterprise grocery management system
+ * An enterprise grocery management system - server
  *
  * The version of the OpenAPI document: 0.1.0
  * Contact: benedikt.peetz@b-peetz.de
diff --git a/crates/rocie-client/src/models/product_id.rs b/crates/rocie-client/src/models/product_id.rs
index 021bd38..0f65bb8 100644
--- a/crates/rocie-client/src/models/product_id.rs
+++ b/crates/rocie-client/src/models/product_id.rs
@@ -1,7 +1,7 @@
 /*
  * rocie-server
  *
- * An enterprise grocery management system
+ * An enterprise grocery management system - server
  *
  * The version of the OpenAPI document: 0.1.0
  * Contact: benedikt.peetz@b-peetz.de
diff --git a/crates/rocie-client/src/models/product_stub.rs b/crates/rocie-client/src/models/product_stub.rs
index 40c1123..0328076 100644
--- a/crates/rocie-client/src/models/product_stub.rs
+++ b/crates/rocie-client/src/models/product_stub.rs
@@ -1,7 +1,7 @@
 /*
  * rocie-server
  *
- * An enterprise grocery management system
+ * An enterprise grocery management system - server
  *
  * The version of the OpenAPI document: 0.1.0
  * Contact: benedikt.peetz@b-peetz.de
@@ -13,20 +13,27 @@ use serde::{Deserialize, Serialize};
 
 #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
 pub struct ProductStub {
+    /// A description.
     #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
     pub description: Option<Option<String>>,
+    /// The name of the product
     #[serde(rename = "name")]
     pub name: String,
+    /// A parent of this product, otherwise the parent will be the root of the parent tree.
     #[serde(rename = "parent", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
     pub parent: Option<Option<models::ProductId>>,
+    /// The Unit Property to use for this product.
+    #[serde(rename = "unit_property")]
+    pub unit_property: models::UnitPropertyId,
 }
 
 impl ProductStub {
-    pub fn new(name: String) -> ProductStub {
+    pub fn new(name: String, unit_property: models::UnitPropertyId) -> ProductStub {
         ProductStub {
             description: None,
             name,
             parent: None,
+            unit_property,
         }
     }
 }
diff --git a/crates/rocie-client/src/models/unit.rs b/crates/rocie-client/src/models/unit.rs
index 760d532..6361a1c 100644
--- a/crates/rocie-client/src/models/unit.rs
+++ b/crates/rocie-client/src/models/unit.rs
@@ -1,7 +1,7 @@
 /*
  * rocie-server
  *
- * An enterprise grocery management system
+ * An enterprise grocery management system - server
  *
  * The version of the OpenAPI document: 0.1.0
  * Contact: benedikt.peetz@b-peetz.de
@@ -13,26 +13,35 @@ use serde::{Deserialize, Serialize};
 
 #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
 pub struct Unit {
+    /// Description of this unit.
     #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
     pub description: Option<Option<String>>,
+    /// The plural version of this unit's name. Is used by a value of two and more. (We do not support Slovenian dual numerus versions) E.g.:     Kilogram -> Kilograms     gram -> meters
     #[serde(rename = "full_name_plural")]
     pub full_name_plural: String,
+    /// The singular version of this unit's name. E.g.:     Kilogram     Gram
     #[serde(rename = "full_name_singular")]
     pub full_name_singular: String,
+    /// Unique id for this unit.
     #[serde(rename = "id")]
     pub id: models::UnitId,
+    /// Short name or abbreviation of this unit. E.g.:     kg for Kilogram     g for gram     m for meter
     #[serde(rename = "short_name")]
     pub short_name: String,
+    /// Which property is described by this unit. E.g.:     kg -> Mass     L -> Volume     m/s -> Speed     and so forth
+    #[serde(rename = "unit_property")]
+    pub unit_property: models::UnitPropertyId,
 }
 
 impl Unit {
-    pub fn new(full_name_plural: String, full_name_singular: String, id: models::UnitId, short_name: String) -> Unit {
+    pub fn new(full_name_plural: String, full_name_singular: String, id: models::UnitId, short_name: String, unit_property: models::UnitPropertyId) -> Unit {
         Unit {
             description: None,
             full_name_plural,
             full_name_singular,
             id,
             short_name,
+            unit_property,
         }
     }
 }
diff --git a/crates/rocie-client/src/models/unit_amount.rs b/crates/rocie-client/src/models/unit_amount.rs
index 928a6f4..e4b1a54 100644
--- a/crates/rocie-client/src/models/unit_amount.rs
+++ b/crates/rocie-client/src/models/unit_amount.rs
@@ -1,7 +1,7 @@
 /*
  * rocie-server
  *
- * An enterprise grocery management system
+ * An enterprise grocery management system - server
  *
  * The version of the OpenAPI document: 0.1.0
  * Contact: benedikt.peetz@b-peetz.de
diff --git a/crates/rocie-client/src/models/unit_id.rs b/crates/rocie-client/src/models/unit_id.rs
index ea1ef51..8b08d95 100644
--- a/crates/rocie-client/src/models/unit_id.rs
+++ b/crates/rocie-client/src/models/unit_id.rs
@@ -1,7 +1,7 @@
 /*
  * rocie-server
  *
- * An enterprise grocery management system
+ * An enterprise grocery management system - server
  *
  * The version of the OpenAPI document: 0.1.0
  * Contact: benedikt.peetz@b-peetz.de
diff --git a/crates/rocie-client/src/models/unit_property.rs b/crates/rocie-client/src/models/unit_property.rs
new file mode 100644
index 0000000..f62012b
--- /dev/null
+++ b/crates/rocie-client/src/models/unit_property.rs
@@ -0,0 +1,42 @@
+/*
+ * rocie-server
+ *
+ * An enterprise grocery management system - server
+ *
+ * The version of the OpenAPI document: 0.1.0
+ * Contact: benedikt.peetz@b-peetz.de
+ * Generated by: https://openapi-generator.tech
+ */
+
+use crate::models;
+use serde::{Deserialize, Serialize};
+
+/// UnitProperty : An unit property describes a property that can be measured by units. For example velocity, mass or volume.
+#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
+pub struct UnitProperty {
+    /// An description of this property.
+    #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
+    pub description: Option<Option<String>>,
+    /// The unique ID for this unit property.
+    #[serde(rename = "id")]
+    pub id: models::UnitPropertyId,
+    /// The user-displayed name of this property.
+    #[serde(rename = "name")]
+    pub name: String,
+    /// The units with are measuring this property.
+    #[serde(rename = "units")]
+    pub units: Vec<models::UnitId>,
+}
+
+impl UnitProperty {
+    /// An unit property describes a property that can be measured by units. For example velocity, mass or volume.
+    pub fn new(id: models::UnitPropertyId, name: String, units: Vec<models::UnitId>) -> UnitProperty {
+        UnitProperty {
+            description: None,
+            id,
+            name,
+            units,
+        }
+    }
+}
+
diff --git a/crates/rocie-client/src/models/unit_property_id.rs b/crates/rocie-client/src/models/unit_property_id.rs
new file mode 100644
index 0000000..aca567c
--- /dev/null
+++ b/crates/rocie-client/src/models/unit_property_id.rs
@@ -0,0 +1,27 @@
+/*
+ * rocie-server
+ *
+ * An enterprise grocery management system - server
+ *
+ * The version of the OpenAPI document: 0.1.0
+ * Contact: benedikt.peetz@b-peetz.de
+ * Generated by: https://openapi-generator.tech
+ */
+
+use crate::models;
+use serde::{Deserialize, Serialize};
+
+#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
+pub struct UnitPropertyId {
+    #[serde(rename = "value")]
+    pub value: uuid::Uuid,
+}
+
+impl UnitPropertyId {
+    pub fn new(value: uuid::Uuid) -> UnitPropertyId {
+        UnitPropertyId {
+            value,
+        }
+    }
+}
+
diff --git a/crates/rocie-client/src/models/unit_property_stub.rs b/crates/rocie-client/src/models/unit_property_stub.rs
new file mode 100644
index 0000000..be2d31e
--- /dev/null
+++ b/crates/rocie-client/src/models/unit_property_stub.rs
@@ -0,0 +1,30 @@
+/*
+ * rocie-server
+ *
+ * An enterprise grocery management system - server
+ *
+ * The version of the OpenAPI document: 0.1.0
+ * Contact: benedikt.peetz@b-peetz.de
+ * Generated by: https://openapi-generator.tech
+ */
+
+use crate::models;
+use serde::{Deserialize, Serialize};
+
+#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
+pub struct UnitPropertyStub {
+    #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
+    pub description: Option<Option<String>>,
+    #[serde(rename = "name")]
+    pub name: String,
+}
+
+impl UnitPropertyStub {
+    pub fn new(name: String) -> UnitPropertyStub {
+        UnitPropertyStub {
+            description: None,
+            name,
+        }
+    }
+}
+
diff --git a/crates/rocie-client/src/models/unit_stub.rs b/crates/rocie-client/src/models/unit_stub.rs
index 03f81fd..aafad6c 100644
--- a/crates/rocie-client/src/models/unit_stub.rs
+++ b/crates/rocie-client/src/models/unit_stub.rs
@@ -1,7 +1,7 @@
 /*
  * rocie-server
  *
- * An enterprise grocery management system
+ * An enterprise grocery management system - server
  *
  * The version of the OpenAPI document: 0.1.0
  * Contact: benedikt.peetz@b-peetz.de
@@ -21,15 +21,18 @@ pub struct UnitStub {
     pub full_name_singular: String,
     #[serde(rename = "short_name")]
     pub short_name: String,
+    #[serde(rename = "unit_property")]
+    pub unit_property: models::UnitPropertyId,
 }
 
 impl UnitStub {
-    pub fn new(full_name_plural: String, full_name_singular: String, short_name: String) -> UnitStub {
+    pub fn new(full_name_plural: String, full_name_singular: String, short_name: String, unit_property: models::UnitPropertyId) -> UnitStub {
         UnitStub {
             description: None,
             full_name_plural,
             full_name_singular,
             short_name,
+            unit_property,
         }
     }
 }