pub struct SqliteInventoryRepository { /* private fields */ }Available on crate feature
sqlite only.Expand description
SQLite implementation of InventoryRepository
Implementations§
Source§impl SqliteInventoryRepository
impl SqliteInventoryRepository
pub const fn new(pool: Pool<SqliteConnectionManager>) -> Self
Trait Implementations§
Source§impl Debug for SqliteInventoryRepository
impl Debug for SqliteInventoryRepository
Source§impl InventoryRepository for SqliteInventoryRepository
impl InventoryRepository for SqliteInventoryRepository
Source§fn create_item(&self, input: CreateInventoryItem) -> Result<InventoryItem>
fn create_item(&self, input: CreateInventoryItem) -> Result<InventoryItem>
Create a new inventory item
Source§fn get_item_by_sku(&self, sku: &str) -> Result<Option<InventoryItem>>
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>>
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>>
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>
fn adjust(&self, input: AdjustInventory) -> Result<InventoryTransaction>
Adjust inventory quantity
Source§fn reserve(&self, input: ReserveInventory) -> Result<InventoryReservation>
fn reserve(&self, input: ReserveInventory) -> Result<InventoryReservation>
Reserve inventory
Source§fn get_reservation(
&self,
reservation_id: Uuid,
) -> Result<Option<InventoryReservation>>
fn get_reservation( &self, reservation_id: Uuid, ) -> Result<Option<InventoryReservation>>
Get a reservation by ID
Source§fn confirm_reservation(&self, reservation_id: Uuid) -> Result<()>
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>>
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>>
fn list(&self, filter: InventoryFilter) -> Result<Vec<InventoryItem>>
List inventory items with filter
Source§fn get_reorder_needed(&self) -> Result<Vec<StockLevel>>
fn get_reorder_needed(&self) -> Result<Vec<StockLevel>>
Get items below reorder point
Source§fn record_transaction(
&self,
transaction: InventoryTransaction,
) -> Result<InventoryTransaction>
fn record_transaction( &self, transaction: InventoryTransaction, ) -> Result<InventoryTransaction>
Record transaction
Source§fn get_transactions(
&self,
item_id: i64,
limit: u32,
) -> Result<Vec<InventoryTransaction>>
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>>
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>>
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>>
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>>
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>>
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>>
fn get_stock_batch(&self, skus: Vec<String>) -> Result<Vec<StockLevel>>
Get stock levels for multiple SKUs
Auto Trait Implementations§
impl !RefUnwindSafe for SqliteInventoryRepository
impl !UnwindSafe for SqliteInventoryRepository
impl Freeze for SqliteInventoryRepository
impl Send for SqliteInventoryRepository
impl Sync for SqliteInventoryRepository
impl Unpin for SqliteInventoryRepository
impl UnsafeUnpin for SqliteInventoryRepository
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