square_api_client/models/catalog_measurement_unit.rs
1//! Model struct for CatalogMeasurementUnit type.
2
3use serde::{Deserialize, Serialize};
4
5use super::MeasurementUnit;
6
7/// Represents the unit used to measure a `CatalogItemVariation` and specifies the precision for
8/// decimal quantities.
9#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
10pub struct CatalogMeasurementUnit {
11 /// Indicates the unit used to measure the quantity of a catalog item variation.
12 pub measurement_unit: Option<MeasurementUnit>,
13 /// An integer between 0 and 5 that represents the maximum number of positions allowed after the
14 /// decimal in quantities measured with this unit. For example:
15 ///
16 /// * if the precision is 0, the quantity can be 1, 2, 3, etc.
17 /// * if the precision is 1, the quantity can be 0.1, 0.2, etc.
18 /// * if the precision is 2, the quantity can be 0.01, 0.12, etc.
19 /// Default: 3
20 pub precision: Option<i32>,
21}