pub struct Return {Show 15 fields
pub id: ReturnId,
pub order_id: OrderId,
pub customer_id: CustomerId,
pub status: ReturnStatus,
pub reason: ReturnReason,
pub reason_details: Option<String>,
pub idempotency_key: Option<String>,
pub refund_amount: Option<Decimal>,
pub refund_method: Option<String>,
pub tracking_number: Option<String>,
pub items: Vec<ReturnItem>,
pub notes: Option<String>,
pub version: i32,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
Return entity
Fields§
§id: ReturnId§order_id: OrderId§customer_id: CustomerId§status: ReturnStatus§reason: ReturnReason§reason_details: Option<String>§idempotency_key: Option<String>§refund_amount: Option<Decimal>§refund_method: Option<String>§tracking_number: Option<String>§items: Vec<ReturnItem>§notes: Option<String>§version: i32Version for optimistic locking
created_at: DateTime<Utc>§updated_at: DateTime<Utc>Implementations§
Source§impl Return
impl Return
Sourcepub fn calculate_refund_total(&self) -> Decimal
pub fn calculate_refund_total(&self) -> Decimal
Calculate total refund amount from items
Sourcepub fn can_approve(&self) -> bool
pub fn can_approve(&self) -> bool
Check if return can be approved
Sourcepub const fn can_complete(&self) -> bool
pub const fn can_complete(&self) -> bool
Check if return can be completed
Sourcepub const fn is_refund_eligible(&self) -> bool
pub const fn is_refund_eligible(&self) -> bool
Check if refund is eligible based on reason
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Return
impl<'de> Deserialize<'de> for Return
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Return, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Return, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Return
Source§impl Serialize for Return
impl Serialize for Return
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 Return
Auto Trait Implementations§
impl Freeze for Return
impl RefUnwindSafe for Return
impl Send for Return
impl Sync for Return
impl Unpin for Return
impl UnsafeUnpin for Return
impl UnwindSafe for Return
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