Skip to main content

SqliteSerialRepository

Struct SqliteSerialRepository 

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

SQLite implementation of SerialRepository

Implementations§

Trait Implementations§

Source§

impl Debug for SqliteSerialRepository

Source§

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

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

impl SerialRepository for SqliteSerialRepository

Source§

fn create(&self, input: CreateSerialNumber) -> Result<SerialNumber>

Create a serial number
Source§

fn create_bulk( &self, input: CreateSerialNumbersBulk, ) -> Result<Vec<SerialNumber>>

Create multiple serial numbers in bulk
Source§

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

Get serial by ID
Source§

fn get_by_serial(&self, serial: &str) -> Result<Option<SerialNumber>>

Get serial by serial number string
Source§

fn update(&self, id: Uuid, input: UpdateSerialNumber) -> Result<SerialNumber>

Update a serial number
Source§

fn list(&self, filter: SerialFilter) -> Result<Vec<SerialNumber>>

List serials with filter
Source§

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

Delete a serial (only if never used)
Source§

fn change_status(&self, input: ChangeSerialStatus) -> Result<SerialNumber>

Change serial status with history tracking
Source§

fn reserve(&self, input: ReserveSerialNumber) -> Result<SerialReservation>

Reserve a serial
Source§

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

Release reservation
Source§

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

Confirm reservation
Source§

fn move_serial(&self, input: MoveSerial) -> Result<SerialNumber>

Move serial to new location
Source§

fn transfer_ownership( &self, input: TransferSerialOwnership, ) -> Result<SerialNumber>

Transfer ownership
Source§

fn mark_sold( &self, id: Uuid, customer_id: Uuid, order_id: Option<Uuid>, ) -> Result<SerialNumber>

Mark as sold
Source§

fn mark_shipped(&self, id: Uuid, shipment_id: Uuid) -> Result<SerialNumber>

Mark as shipped
Source§

fn mark_returned(&self, id: Uuid, return_id: Uuid) -> Result<SerialNumber>

Mark as returned
Source§

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

Activate serial (e.g., for warranty)
Source§

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

Quarantine serial
Source§

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

Release from quarantine
Source§

fn scrap(&self, id: Uuid, reason: &str) -> Result<SerialNumber>

Scrap serial
Source§

fn get_history( &self, serial_id: Uuid, filter: SerialHistoryFilter, ) -> Result<Vec<SerialHistory>>

Get serial history
Source§

fn lookup(&self, serial: &str) -> Result<Option<SerialLookupResult>>

Get full serial lookup with related data
Source§

fn validate(&self, serial: &str) -> Result<SerialValidation>

Validate serial number
Source§

fn get_available_for_sku( &self, sku: &str, limit: u32, ) -> Result<Vec<SerialNumber>>

Get available serials for SKU
Source§

fn get_for_lot(&self, lot_id: Uuid) -> Result<Vec<SerialNumber>>

Get serials for lot
Source§

fn get_for_customer(&self, customer_id: Uuid) -> Result<Vec<SerialNumber>>

Get serials for customer
Source§

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

Count serials
Source§

fn create_batch( &self, inputs: Vec<CreateSerialNumber>, ) -> Result<BatchResult<SerialNumber>>

Create multiple serials
Source§

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

Get multiple serials by ID
Source§

fn get_batch_by_serial(&self, serials: Vec<String>) -> Result<Vec<SerialNumber>>

Get multiple serials by serial string

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