about summary refs log tree commit diff stats
path: root/crates/rocie-server/src/storage/sql/unit_property.rs
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-10-08 11:54:04 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-10-08 11:54:04 +0200
commit08cf86a44a9a7c513cd12cbc4a0bac7c029b9ded (patch)
tree88b202b25ec22b86f3b4df9f2022b7b23ec3cba1 /crates/rocie-server/src/storage/sql/unit_property.rs
parentchore(crates/rocie-client): Regenerate (diff)
downloadserver-08cf86a44a9a7c513cd12cbc4a0bac7c029b9ded.zip
feat(crates/rocie-server/unit-property): Init
Diffstat (limited to 'crates/rocie-server/src/storage/sql/unit_property.rs')
-rw-r--r--crates/rocie-server/src/storage/sql/unit_property.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/crates/rocie-server/src/storage/sql/unit_property.rs b/crates/rocie-server/src/storage/sql/unit_property.rs
new file mode 100644
index 0000000..9da2d2e
--- /dev/null
+++ b/crates/rocie-server/src/storage/sql/unit_property.rs
@@ -0,0 +1,23 @@
+use serde::{Deserialize, Serialize};
+use utoipa::ToSchema;
+
+use crate::storage::sql::{mk_id, unit::UnitId};
+
+/// An unit property describes a property that can be measured by units.
+/// For example velocity, mass or volume.
+#[derive(ToSchema, Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Serialize, Deserialize)]
+pub(crate) struct UnitProperty {
+    /// The unique ID for this unit property.
+    pub(crate) id: UnitPropertyId,
+
+    /// The user-displayed name of this property.
+    pub(crate) name: String,
+
+    /// The units with are measuring this property.
+    pub(crate) units: Vec<UnitId>,
+
+    /// An description of this property.
+    pub(crate) description: Option<String>,
+}
+
+mk_id!(UnitPropertyId and UnitPropertyIdStub);