Skip to main content

SqliteLotRepository

Struct SqliteLotRepository 

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

Implementations§

Trait Implementations§

Source§

impl Debug for SqliteLotRepository

Source§

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

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

impl LotRepository for SqliteLotRepository

Source§

fn create(&self, input: CreateLot) -> Result<Lot>

Create a new lot
Source§

fn get(&self, id: Uuid) -> Result<Option<Lot>>

Get lot by ID
Source§

fn get_by_number(&self, lot_number: &str) -> Result<Option<Lot>>

Get lot by lot number
Source§

fn update(&self, id: Uuid, input: UpdateLot) -> Result<Lot>

Update a lot
Source§

fn list(&self, filter: LotFilter) -> Result<Vec<Lot>>

List lots with filter
Source§

fn delete(&self, id: Uuid) -> Result<()>

Delete a lot (only if no transactions)
Source§

fn adjust(&self, input: AdjustLot) -> Result<LotTransaction>

Adjust lot quantity
Source§

fn consume(&self, input: ConsumeLot) -> Result<LotTransaction>

Consume from a lot
Source§

fn reserve(&self, input: ReserveLot) -> Result<Uuid>

Reserve quantity from a lot
Source§

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

Release a reservation
Source§

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

Confirm a reservation (convert to consumption)
Source§

fn transfer(&self, input: TransferLot) -> Result<LotTransaction>

Transfer lot between locations
Source§

fn split(&self, input: SplitLot) -> Result<Lot>

Split a lot into two
Source§

fn merge(&self, input: MergeLots) -> Result<Lot>

Merge multiple lots into one
Source§

fn quarantine(&self, id: Uuid, reason: &str) -> Result<Lot>

Quarantine a lot
Source§

fn release_quarantine(&self, id: Uuid) -> Result<Lot>

Release from quarantine
Source§

fn get_transactions( &self, lot_id: Uuid, limit: u32, ) -> Result<Vec<LotTransaction>>

Get lot transactions
Source§

fn get_quantity_at_location( &self, lot_id: Uuid, location_id: i32, ) -> Result<Option<Decimal>>

Get lot quantity at a location (None if no location record exists)
Source§

fn get_lot_locations(&self, lot_id: Uuid) -> Result<Vec<LotLocation>>

Get all locations for a lot
Source§

fn add_certificate(&self, input: AddLotCertificate) -> Result<LotCertificate>

Add certificate to lot
Source§

fn get_certificates(&self, lot_id: Uuid) -> Result<Vec<LotCertificate>>

Get certificates for lot
Source§

fn delete_certificate(&self, certificate_id: Uuid) -> Result<()>

Delete certificate
Source§

fn get_expiring_lots(&self, days: i32) -> Result<Vec<Lot>>

Get expiring lots
Source§

fn get_expired_lots(&self) -> Result<Vec<Lot>>

Get expired lots
Source§

fn get_available_lots_for_sku(&self, sku: &str) -> Result<Vec<Lot>>

Get lots with available quantity for SKU
Source§

fn trace(&self, lot_id: Uuid) -> Result<TraceabilityResult>

Trace lot (upstream and downstream)
Source§

fn count(&self, filter: LotFilter) -> Result<u64>

Count lots
Source§

fn create_batch(&self, inputs: Vec<CreateLot>) -> Result<BatchResult<Lot>>

Create multiple lots
Source§

fn get_batch(&self, ids: Vec<Uuid>) -> Result<Vec<Lot>>

Get multiple lots by ID

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