Struct square_api_client::models::OrderReturnDiscount
source · [−]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
sourceimpl Clone for OrderReturnDiscount
impl Clone for OrderReturnDiscount
sourcefn clone(&self) -> OrderReturnDiscount
fn clone(&self) -> OrderReturnDiscount
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for OrderReturnDiscount
impl Debug for OrderReturnDiscount
sourceimpl Default for OrderReturnDiscount
impl Default for OrderReturnDiscount
sourcefn default() -> OrderReturnDiscount
fn default() -> OrderReturnDiscount
sourceimpl<'de> Deserialize<'de> for OrderReturnDiscount
impl<'de> Deserialize<'de> for OrderReturnDiscount
sourcefn 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>,
sourceimpl PartialEq<OrderReturnDiscount> for OrderReturnDiscount
impl PartialEq<OrderReturnDiscount> for OrderReturnDiscount
sourcefn eq(&self, other: &OrderReturnDiscount) -> bool
fn eq(&self, other: &OrderReturnDiscount) -> bool
sourceimpl Serialize for OrderReturnDiscount
impl Serialize for OrderReturnDiscount
impl Eq for OrderReturnDiscount
impl StructuralEq for OrderReturnDiscount
impl StructuralPartialEq for OrderReturnDiscount
Auto Trait Implementations
impl RefUnwindSafe for OrderReturnDiscount
impl Send for OrderReturnDiscount
impl Sync for OrderReturnDiscount
impl Unpin for OrderReturnDiscount
impl UnwindSafe for OrderReturnDiscount
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.