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
35
36
37
38
39
40
//! Model struct for InventoryTransfer type

use serde::{Deserialize, Serialize};

use super::{enums::InventoryState, SourceApplication};

/// Represents the transfer of a quantity of product inventory at a particular time from one location to another.
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct InventoryTransfer {
    /// A unique ID generated by Square for the InventoryTransfer.
    pub id: String,
    /// An optional ID provided by the application to tie the InventoryTransfer to an external system.
    pub reference_id: String,
    /// The current inventory state for the related quantity of items.
    pub state: InventoryState,
    /// The Square-generated ID of the Location where the related quantity of items is being tracked.
    pub from_location_id: String,
    /// The Square-generated ID of the Location where the related quantity of items is being tracked.
    pub to_location_id: String,
    /// The Square-generated ID of the CatalogObject being tracked.
    pub catalog_object_id: String,
    /// The type of the CatalogObject being tracked.
    /// The Inventory API supports setting and reading the "catalog_object_type": "ITEM_VARIATION"
    /// In addition, it can also read the "catalog_object_type": "ITEM"
    pub catalog_object_type: String,
    /// The number of items affected by the transfer as a decimal string.
    /// Can support up to 5 digits after the decimal point.
    pub quantity: String,
    /// Read only An RFC 3339-formatted timestamp that indicates when the most recent physical
    /// count or adjustment affecting the estimated count is received.
    pub occurred_at: String,
    /// Read only An RFC 3339-formatted timestamp that indicates when Square received the transfer request.
    pub created_at: String,
    /// Read only Information about the application that initiated the inventory transfer.
    pub source: SourceApplication,
    /// The Square-generated ID of the Employee responsible for the inventory transfer.
    pub employee_id: String,
    /// The Square-generated ID of the Team Member responsible for the inventory transfer.
    pub team_member_id: String,
}