pub struct InventoryBalance {
pub id: i64,
pub item_id: i64,
pub location_id: i32,
pub quantity_on_hand: Decimal,
pub quantity_allocated: Decimal,
pub quantity_available: Decimal,
pub reorder_point: Option<Decimal>,
pub safety_stock: Option<Decimal>,
pub version: i32,
pub last_counted_at: Option<DateTime<Utc>>,
pub updated_at: DateTime<Utc>,
}Expand description
Inventory balance at a location
Fields§
§id: i64§item_id: i64§location_id: i32§quantity_on_hand: Decimal§quantity_allocated: Decimal§quantity_available: Decimal§reorder_point: Option<Decimal>§safety_stock: Option<Decimal>§version: i32§last_counted_at: Option<DateTime<Utc>>§updated_at: DateTime<Utc>Implementations§
Source§impl InventoryBalance
impl InventoryBalance
Sourcepub fn needs_reorder(&self) -> bool
pub fn needs_reorder(&self) -> bool
Check if stock is below reorder point
Sourcepub fn calculate_available(&self) -> Decimal
pub fn calculate_available(&self) -> Decimal
Calculate available quantity
Sourcepub fn can_allocate(&self, quantity: Decimal) -> bool
pub fn can_allocate(&self, quantity: Decimal) -> bool
Check if requested quantity can be allocated
Trait Implementations§
Source§impl Clone for InventoryBalance
impl Clone for InventoryBalance
Source§fn clone(&self) -> InventoryBalance
fn clone(&self) -> InventoryBalance
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InventoryBalance
impl Debug for InventoryBalance
Source§impl<'de> Deserialize<'de> for InventoryBalance
impl<'de> Deserialize<'de> for InventoryBalance
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<InventoryBalance, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<InventoryBalance, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for InventoryBalance
Source§impl PartialEq for InventoryBalance
impl PartialEq for InventoryBalance
Source§impl Serialize for InventoryBalance
impl Serialize for InventoryBalance
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for InventoryBalance
Auto Trait Implementations§
impl Freeze for InventoryBalance
impl RefUnwindSafe for InventoryBalance
impl Send for InventoryBalance
impl Sync for InventoryBalance
impl Unpin for InventoryBalance
impl UnsafeUnpin for InventoryBalance
impl UnwindSafe for InventoryBalance
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more