square_api_client/models/
inventory_adjustment.rs

1//! Model struct for InventoryAdjustment type
2
3use serde::{Deserialize, Serialize};
4
5use super::{enums::InventoryState, InventoryAdjustmentGroup, Money, SourceApplication};
6
7/// Represents a change in state or quantity of product inventory at a particular time and location.
8#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
9pub struct InventoryAdjustment {
10    /// A unique ID generated by Square for the InventoryAdjustment.
11    pub id: String,
12    /// An optional ID provided by the application to tie the InventoryAdjustment
13    pub reference_id: String,
14    /// The current inventory state for the related quantity of items.
15    pub from_state: InventoryState,
16    /// The current inventory state for the related quantity of items.
17    pub to_state: InventoryState,
18    /// The Square-generated ID of the Location where the related quantity of items is being tracked.
19    pub location_id: String,
20    /// The Square-generated ID of the CatalogObject being tracked.
21    pub catalog_object_id: String,
22    /// The type of the CatalogObject being tracked.
23    /// The Inventory API supports setting and reading the "catalog_object_type": "ITEM_VARIATION"
24    /// In addition, it can also read the "catalog_object_type": "ITEM"
25    pub catalog_object_type: String,
26    ///The number of items affected by the estimated count as a decimal string.
27    pub quantity: String,
28    /// Read only The total price paid for goods associated with the adjustment.
29    /// Present if and only if to_state is SOLD. Always non-negative.
30    pub total_price_money: Option<Money>,
31    /// Read only An RFC 3339-formatted timestamp that indicates when the most recent physical
32    /// count or adjustment affecting the estimated count is received.
33    pub occurred_at: String,
34    ///Read only RFC 3339-formatted timestamp that indicates when the inventory adjustment is received.
35    pub created_at: String,
36    /// The current inventory state for the related quantity of items.
37    pub source: SourceApplication,
38    /// The Square-generated ID of the Employee responsible for the inventory adjustment.
39    pub employee_id: String,
40    /// The Square-generated ID of the Team Member responsible for the inventory adjustment.
41    pub team_member_id: String,
42    /// Read only The Square-generated ID of the Transaction that caused the adjustment.
43    /// Only relevant for payment-related state transitions.
44    pub transaction_id: String,
45    /// Read only The Square-generated ID of the Refund that caused the adjustment.
46    /// Only relevant for refund-related state transitions.
47    pub refund_id: String,
48    /// Read only The Square-generated ID of the purchase order that caused the adjustment.
49    /// Only relevant for state transitions from the Square for Retail app.
50    pub purchase_order_id: String,
51    /// Read only The Square-generated ID of the goods receipt that caused the adjustment.
52    /// Only relevant for state transitions from the Square for Retail app.
53    pub goods_receipt_id: String,
54    /// Read only An adjustment group bundling the related adjustments of item variations
55    /// through stock conversions in a single inventory event.
56    pub adjustment_group: InventoryAdjustmentGroup,
57}