pub struct Position {
pub location_id: LocationId,
/* private fields */
}Expand description
Validated inventory position that guarantees reserved units do not exceed on-hand units.
Fields§
§location_id: LocationIdSource-derived location id carried by this retail contract.
Implementations§
Source§impl Position
impl Position
Sourcepub fn record(stock: Stock) -> Result<Self>
pub fn record(stock: Stock) -> Result<Self>
Records a stock position after rejecting impossible inventory math.
Sourcepub const fn on_hand(&self) -> OnHandUnits
pub const fn on_hand(&self) -> OnHandUnits
Returns the on hand evidence recorded on this retail contract.
Sourcepub const fn reserved(&self) -> ReservedUnits
pub const fn reserved(&self) -> ReservedUnits
Returns the reserved evidence recorded on this retail contract.
Sourcepub const fn reorder_at(&self) -> UnitCount
pub const fn reorder_at(&self) -> UnitCount
Returns the reorder at evidence recorded on this retail contract.
Sourcepub const fn available_units(&self) -> AvailableUnits
pub const fn available_units(&self) -> AvailableUnits
Computes sellable units so POS and recommendation workflows do not oversell stock.
Sourcepub const fn is_at_or_below_reorder_threshold(&self) -> bool
pub const fn is_at_or_below_reorder_threshold(&self) -> bool
Reports whether available inventory has fallen to the reorder threshold.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Position
impl<'de> Deserialize<'de> for Position
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Position
impl StructuralPartialEq for Position
Auto Trait Implementations§
impl Freeze for Position
impl RefUnwindSafe for Position
impl Send for Position
impl Sync for Position
impl Unpin for Position
impl UnsafeUnpin for Position
impl UnwindSafe for Position
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