square_api_client/models/
catalog_stock_conversion.rs

1//! Model struct for CatalogStockConversion type.
2
3use serde::{Deserialize, Serialize};
4
5/// Represents the rule of conversion between a stockable [CatalogItemVariation] and a non-stockable
6/// sell-by or receive-by `CatalogItemVariation` that share the same underlying stock.
7#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
8pub struct CatalogStockConversion {
9    /// References to the stockable [CatalogItemVariation] for this stock conversion. Selling,
10    /// receiving or recounting the non-stockable `CatalogItemVariation` defined with a stock
11    /// conversion results in adjustments of this stockable `CatalogItemVariation`. This immutable
12    /// field must reference a stockable `CatalogItemVariation` that shares the parent [CatalogItem]
13    /// of the converted `CatalogItemVariation`.
14    ///
15    /// Min Length 1
16    pub stockable_item_variation_id: String,
17    /// The quantity of the stockable item variation (as identified by
18    /// `stockable_item_variation_id`) equivalent to the non-stockable item variation quantity (as
19    /// specified in `nonstockable_quantity`) as defined by this stock conversion. It accepts a
20    /// decimal number in a string format that can take up to 10 digits before the decimal point and
21    /// up to 5 digits after the decimal point.
22    ///
23    /// Min Length 1 Max Length 16
24    pub stockable_quantity: String,
25    /// The converted equivalent quantity of the non-stockable [CatalogItemVariation] in its
26    /// measurement unit. The `stockable_quantity` value and this `nonstockable_quantity` value
27    /// together define the conversion ratio between stockable item variation and the non-stockable
28    /// item variation. It accepts a decimal number in a string format that can take up to 10 digits
29    /// before the decimal point and up to 5 digits after the decimal point.
30    ///
31    /// Min Length 1 Max Length 16
32    pub nonstockable_quantity: String,
33}