pub struct AvailabilityScopeRead { /* private fields */ }Expand description
The real, database-backed availability scope read. Implements
AvailabilityScopePort so a composition can hold the trait and swap
adapters (the refusing default in tests, this service in production).
Implementations§
Trait Implementations§
Source§impl AvailabilityScopePort for AvailabilityScopeRead
impl AvailabilityScopePort for AvailabilityScopeRead
Source§fn display_availability<'life0, 'life1, 'async_trait>(
&'life0 self,
item_ids: &'life1 [Uuid],
warehouse_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<ScopedAvailability>, AvailabilityScopeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn display_availability<'life0, 'life1, 'async_trait>(
&'life0 self,
item_ids: &'life1 [Uuid],
warehouse_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<ScopedAvailability>, AvailabilityScopeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Display scope: fresh per-item availability at the pivot warehouse,
complete over
item_ids in input order (absent items zeroed — an
unreceived item is unavailable, not an error).Source§fn checkout_free_qty<'life0, 'life1, 'async_trait>(
&'life0 self,
demands: &'life1 [CheckoutDemand],
warehouse_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<CheckoutFreeQty>, AvailabilityScopeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn checkout_free_qty<'life0, 'life1, 'async_trait>(
&'life0 self,
demands: &'life1 [CheckoutDemand],
warehouse_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<CheckoutFreeQty>, AvailabilityScopeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Checkout scope: fresh per-item availability at the (possibly
pickup-overridden) pivot warehouse minus the caller’s own held
quantities, floored at zero. Complete over the demand list’s items.
Source§fn sold_out<'life0, 'life1, 'async_trait>(
&'life0 self,
item_ids: &'life1 [Uuid],
warehouse_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<SoldOutVerdict, AvailabilityScopeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn sold_out<'life0, 'life1, 'async_trait>(
&'life0 self,
item_ids: &'life1 [Uuid],
warehouse_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<SoldOutVerdict, AvailabilityScopeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sold-out verdict over the WHOLE item set (WSC’s first-variant-only
template check is the bug class this refuses to re-express):
sold_out = no member has availability. Policy (may an out-of-stock
item still be ordered?) stays with the caller — this is raw stock
truth.Auto Trait Implementations§
impl !RefUnwindSafe for AvailabilityScopeRead
impl !UnwindSafe for AvailabilityScopeRead
impl Freeze for AvailabilityScopeRead
impl Send for AvailabilityScopeRead
impl Sync for AvailabilityScopeRead
impl Unpin for AvailabilityScopeRead
impl UnsafeUnpin for AvailabilityScopeRead
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,
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