1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
// rocie - An enterprise grocery management system
//
// Copyright (C) 2026 Benedikt Peetz <benedikt.peetz@b-peetz.de>
// SPDX-License-Identifier: GPL-3.0-or-later
//
// This file is part of Rocie.
//
// You should have received a copy of the License along with this program.
// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
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.
#[schema(nullable = false)]
pub(crate) description: Option<String>,
}
mk_id!(UnitPropertyId and UnitPropertyIdStub);
|