pub struct OrderReturnDiscount {
pub uid: Option<String>,
pub source_discount_uid: Option<String>,
pub catalog_object_id: Option<String>,
pub catalog_version: Option<i64>,
pub name: Option<String>,
pub type: Option<OrderLineItemDiscountType>,
pub percentage: Option<String>,
pub amount_money: Option<Money>,
pub applied_money: Option<Money>,
pub scope: Option<OrderLineItemDiscountScope>,
}
Expand description
Represents a discount being returned that applies to one or more return line items in an order.
Fixed-amount, order-scoped discounts are distributed across all non-zero return line item totals. The amount distributed to each return line item is relative to that item’s contribution to the order subtotal.
Fields§
§uid: Option<String>
A unique ID that identifies the returned discount only within this order.
source_discount_uid: Option<String>
The discount uid
from the order that contains the original application of this discount.
catalog_object_id: Option<String>
The catalog object ID referencing [CatalogDiscount].
catalog_version: Option<i64>
The version of the catalog object that this discount references.
name: Option<String>
The discount’s name.
type: Option<OrderLineItemDiscountType>
The type of the discount. If it is created by the API, it is FIXED_PERCENTAGE
or
FIXED_AMOUNT
.
Discounts that do not reference a catalog object ID must have a type of FIXED_PERCENTAGE
or FIXED_AMOUNT
.
percentage: Option<String>
The percentage of the tax, as a string representation of a decimal number. A value of “7.25” corresponds to a percentage of 7.25%.
percentage
is not set for amount-based discounts.
amount_money: Option<Money>
The total declared monetary amount of the discount.
amount_money
is not set for percentage-based discounts.
applied_money: Option<Money>
The amount of discount actually applied to this line item. When an amount-based discount is
at the order level, this value is different from amount_money
because the discount is
distributed across the line items.
scope: Option<OrderLineItemDiscountScope>
Indicates the level at which the OrderReturnDiscount
applies. For ORDER
scoped
discounts, the server generates references in applied_discounts
on all
OrderReturnLineItems
. For LINE_ITEM
scoped discounts, the discount is only applied to
OrderReturnLineItems
with references in their applied_discounts
field.
Trait Implementations§
Source§impl Clone for OrderReturnDiscount
impl Clone for OrderReturnDiscount
Source§fn clone(&self) -> OrderReturnDiscount
fn clone(&self) -> OrderReturnDiscount
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for OrderReturnDiscount
impl Debug for OrderReturnDiscount
Source§impl Default for OrderReturnDiscount
impl Default for OrderReturnDiscount
Source§fn default() -> OrderReturnDiscount
fn default() -> OrderReturnDiscount
Source§impl<'de> Deserialize<'de> for OrderReturnDiscount
impl<'de> Deserialize<'de> for OrderReturnDiscount
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for OrderReturnDiscount
impl PartialEq for OrderReturnDiscount
Source§impl Serialize for OrderReturnDiscount
impl Serialize for OrderReturnDiscount
impl Eq for OrderReturnDiscount
impl StructuralPartialEq for OrderReturnDiscount
Auto Trait Implementations§
impl Freeze for OrderReturnDiscount
impl RefUnwindSafe for OrderReturnDiscount
impl Send for OrderReturnDiscount
impl Sync for OrderReturnDiscount
impl Unpin for OrderReturnDiscount
impl UnwindSafe for OrderReturnDiscount
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.