pub struct SerialNumber {Show 19 fields
pub id: Uuid,
pub serial: String,
pub sku: String,
pub status: SerialStatus,
pub lot_id: Option<Uuid>,
pub lot_number: Option<String>,
pub current_location_id: Option<i32>,
pub current_owner_id: Option<Uuid>,
pub current_owner_type: Option<String>,
pub warranty_id: Option<Uuid>,
pub manufactured_at: Option<DateTime<Utc>>,
pub received_at: Option<DateTime<Utc>>,
pub sold_at: Option<DateTime<Utc>>,
pub activated_at: Option<DateTime<Utc>>,
pub last_service_at: Option<DateTime<Utc>>,
pub notes: Option<String>,
pub attributes: Value,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
A uniquely serialized unit of inventory
Fields§
§id: Uuid§serial: String§sku: String§status: SerialStatus§lot_id: Option<Uuid>§lot_number: Option<String>§current_location_id: Option<i32>§current_owner_id: Option<Uuid>§current_owner_type: Option<String>§warranty_id: Option<Uuid>§manufactured_at: Option<DateTime<Utc>>§received_at: Option<DateTime<Utc>>§sold_at: Option<DateTime<Utc>>§activated_at: Option<DateTime<Utc>>§last_service_at: Option<DateTime<Utc>>§notes: Option<String>§attributes: Value§created_at: DateTime<Utc>§updated_at: DateTime<Utc>Implementations§
Source§impl SerialNumber
impl SerialNumber
Sourcepub fn is_available(&self) -> bool
pub fn is_available(&self) -> bool
Check if serial is available for sale
Sourcepub const fn is_with_customer(&self) -> bool
pub const fn is_with_customer(&self) -> bool
Check if serial is in customer’s possession
Sourcepub fn can_reserve(&self) -> bool
pub fn can_reserve(&self) -> bool
Check if serial can be reserved
Sourcepub const fn can_return(&self) -> bool
pub const fn can_return(&self) -> bool
Check if serial can be returned
Sourcepub const fn is_activated(&self) -> bool
pub const fn is_activated(&self) -> bool
Check if serial has been activated
Sourcepub fn days_since_sold(&self) -> Option<i64>
pub fn days_since_sold(&self) -> Option<i64>
Get days since sold
Trait Implementations§
Source§impl Clone for SerialNumber
impl Clone for SerialNumber
Source§fn clone(&self) -> SerialNumber
fn clone(&self) -> SerialNumber
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SerialNumber
impl Debug for SerialNumber
Source§impl<'de> Deserialize<'de> for SerialNumber
impl<'de> Deserialize<'de> for SerialNumber
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SerialNumber, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SerialNumber, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for SerialNumber
Source§impl PartialEq for SerialNumber
impl PartialEq for SerialNumber
Source§impl Serialize for SerialNumber
impl Serialize for SerialNumber
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for SerialNumber
Auto Trait Implementations§
impl Freeze for SerialNumber
impl RefUnwindSafe for SerialNumber
impl Send for SerialNumber
impl Sync for SerialNumber
impl Unpin for SerialNumber
impl UnsafeUnpin for SerialNumber
impl UnwindSafe for SerialNumber
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