pub struct ScopedAvailability {
pub item_id: Uuid,
pub on_hand_qty: Decimal,
pub reserved_qty: Decimal,
pub available_qty: Decimal,
pub externally_held_qty: Decimal,
}Expand description
One item’s fresh availability at the pivot warehouse.
Fields§
§item_id: Uuid§on_hand_qty: DecimalSUM(quantity) over the pivot warehouse’s internal quant rows.
reserved_qty: DecimalSUM(reserved_quantity) over the same rows — the authoritative reservation counter, read off.
available_qty: Decimalon_hand_qty − reserved_qty, computed per call. Never read off the
stored available_quantity column — freshness over cheapness.
externally_held_qty: DecimalThe checkout-intent ledger’s held sum at this warehouse (active
holds from the reservation surface), already subtracted from
available_qty — surfaced so a screen can say “2 free, 1 held by
other carts” instead of an unexplained number.
Trait Implementations§
Source§impl Clone for ScopedAvailability
impl Clone for ScopedAvailability
Source§impl Debug for ScopedAvailability
impl Debug for ScopedAvailability
Source§impl<'de> Deserialize<'de> for ScopedAvailability
impl<'de> Deserialize<'de> for ScopedAvailability
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
Source§impl PartialEq for ScopedAvailability
impl PartialEq for ScopedAvailability
Source§impl Serialize for ScopedAvailability
impl Serialize for ScopedAvailability
impl StructuralPartialEq for ScopedAvailability
Auto Trait Implementations§
impl Freeze for ScopedAvailability
impl RefUnwindSafe for ScopedAvailability
impl Send for ScopedAvailability
impl Sync for ScopedAvailability
impl Unpin for ScopedAvailability
impl UnsafeUnpin for ScopedAvailability
impl UnwindSafe for ScopedAvailability
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more