Skip to main content

SqliteInventoryRepository

Struct SqliteInventoryRepository 

Source
pub struct SqliteInventoryRepository { /* private fields */ }
Available on crate feature sqlite only.
Expand description

SQLite implementation of InventoryRepository

Implementations§

Trait Implementations§

Source§

impl Debug for SqliteInventoryRepository

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl InventoryRepository for SqliteInventoryRepository

Source§

fn create_item(&self, input: CreateInventoryItem) -> Result<InventoryItem>

Create a new inventory item
Source§

fn get_item(&self, id: i64) -> Result<Option<InventoryItem>>

Get inventory item by ID
Source§

fn get_item_by_sku(&self, sku: &str) -> Result<Option<InventoryItem>>

Get inventory item by SKU
Source§

fn get_stock(&self, sku: &str) -> Result<Option<StockLevel>>

Get stock level for SKU (aggregated across locations)
Source§

fn get_balance( &self, item_id: i64, location_id: i32, ) -> Result<Option<InventoryBalance>>

Get balance at specific location
Source§

fn adjust(&self, input: AdjustInventory) -> Result<InventoryTransaction>

Adjust inventory quantity
Source§

fn reserve(&self, input: ReserveInventory) -> Result<InventoryReservation>

Reserve inventory
Source§

fn get_reservation( &self, reservation_id: Uuid, ) -> Result<Option<InventoryReservation>>

Get a reservation by ID
Source§

fn release_reservation(&self, reservation_id: Uuid) -> Result<()>

Release reservation
Source§

fn confirm_reservation(&self, reservation_id: Uuid) -> Result<()>

Confirm reservation (convert to allocation)
Source§

fn list_reservations_by_reference( &self, reference_type: &str, reference_id: &str, ) -> Result<Vec<InventoryReservation>>

List reservations by reference (e.g., order id)
Source§

fn list(&self, filter: InventoryFilter) -> Result<Vec<InventoryItem>>

List inventory items with filter
Source§

fn get_reorder_needed(&self) -> Result<Vec<StockLevel>>

Get items below reorder point
Source§

fn record_transaction( &self, transaction: InventoryTransaction, ) -> Result<InventoryTransaction>

Record transaction
Source§

fn get_transactions( &self, item_id: i64, limit: u32, ) -> Result<Vec<InventoryTransaction>>

Get transaction history
Source§

fn create_item_batch( &self, inputs: Vec<CreateInventoryItem>, ) -> Result<BatchResult<InventoryItem>>

Create multiple inventory items - partial success allowed
Source§

fn create_item_batch_atomic( &self, inputs: Vec<CreateInventoryItem>, ) -> Result<Vec<InventoryItem>>

Create multiple inventory items - atomic (all-or-nothing)
Source§

fn adjust_batch( &self, adjustments: Vec<AdjustInventory>, ) -> Result<BatchResult<InventoryTransaction>>

Adjust multiple inventory quantities - partial success allowed
Source§

fn adjust_batch_atomic( &self, adjustments: Vec<AdjustInventory>, ) -> Result<Vec<InventoryTransaction>>

Adjust multiple inventory quantities - atomic (all-or-nothing)
Source§

fn get_item_batch(&self, ids: Vec<i64>) -> Result<Vec<InventoryItem>>

Get multiple inventory items by ID
Source§

fn get_stock_batch(&self, skus: Vec<String>) -> Result<Vec<StockLevel>>

Get stock levels for multiple SKUs

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more