pub struct RewardRecord {Show 23 fields
pub reward_type: RewardType,
pub reward_type_raw: Option<i32>,
pub detail_kind: RewardDetailKind,
pub record_id: String,
pub activity_title: String,
pub title: String,
pub description: String,
pub card_type: String,
pub card_status: CouponStatus,
pub card_status_raw: Option<i32>,
pub prize_type: Option<i32>,
pub amount: Option<Decimal>,
pub currency: String,
pub status: RewardStatus,
pub status_raw: Option<i32>,
pub deliver_status: RewardDeliverStatus,
pub deliver_status_raw: Option<i32>,
pub exit_status: i32,
pub send_time: Option<OffsetDateTime>,
pub start_time: Option<OffsetDateTime>,
pub end_time: Option<OffsetDateTime>,
pub effective_time: Option<OffsetDateTime>,
pub receive_deadline: Option<OffsetDateTime>,
}Expand description
A reward record from the reward center
The server nests the details in one of cash / card / prize; this
type flattens them. Prize redemption secrets (coupon_secret), cash card
codes (cash_card_code) and shipping contact details of prizes are
intentionally not modelled.
Fields§
§reward_type: RewardTypeReward type: named after the detail object the server sent (cash,
card or prize, checked in that order), or the server’s
reward_type code when it sent no detail object
reward_type_raw: Option<i32>The server’s numeric code of reward_type, also when it is a code this
SDK does not know (reward_type is then Unknown); None when the
value is missing or is not a code
detail_kind: RewardDetailKindThe detail object the fields below came from
record_id: StringRecord ID
activity_title: StringTitle of the activity that granted the reward
title: StringReward title
description: StringReward description
card_type: StringCoupon type (coupon rewards), e.g. commission
card_status: CouponStatusCoupon status (coupon rewards; CouponStatus::Unknown otherwise)
card_status_raw: Option<i32>The server’s numeric code of card_status, also when it is a code this
SDK does not know (card_status is then Unknown); None when the
value is missing or is not a code
prize_type: Option<i32>Prize type code (gift rewards; 0 = physical goods), None when not
set
amount: Option<Decimal>Amount
currency: StringCurrency
status: RewardStatusReward status
status_raw: Option<i32>The server’s numeric code of status, also when it is a code this SDK
does not know (status is then Unknown); None when the value is
missing or is not a code
deliver_status: RewardDeliverStatusDelivery status (issued gift rewards only). The server uses both 9
and 11 for RewardDeliverStatus::AddressFilled;
Self::deliver_status_raw tells them apart.
deliver_status_raw: Option<i32>The server’s numeric code of deliver_status (e.g. 11, which
deliver_status reads as AddressFilled, like 9), also when it is a
code this SDK does not know (deliver_status is then Unknown); None
when the value is missing or is not a code
exit_status: i32Exit status code, as returned by the server
send_time: Option<OffsetDateTime>Time the reward was sent
start_time: Option<OffsetDateTime>Start time
end_time: Option<OffsetDateTime>End time
effective_time: Option<OffsetDateTime>Effective time
receive_deadline: Option<OffsetDateTime>Deadline to claim the reward
Trait Implementations§
Source§impl Clone for RewardRecord
impl Clone for RewardRecord
Source§impl Debug for RewardRecord
impl Debug for RewardRecord
Source§impl Default for RewardRecord
impl Default for RewardRecord
Source§impl<'de> Deserialize<'de> for RewardRecord
impl<'de> Deserialize<'de> for RewardRecord
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>,
Auto Trait Implementations§
impl Freeze for RewardRecord
impl RefUnwindSafe for RewardRecord
impl Send for RewardRecord
impl Sync for RewardRecord
impl Unpin for RewardRecord
impl UnsafeUnpin for RewardRecord
impl UnwindSafe for RewardRecord
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more