BestReward
Ce contenu n’est pas encore disponible dans votre langue.
struct BestRewardThe single reward worth advertising, selected and formatted by the server, so every surface shows an identical number.
formatted contains a non-breaking space (U+00A0) before the currency symbol —
render it as-is, never compare it against an ordinary-space string.
Conforms to Swift.Equatable, Swift.Hashable, Swift.Sendable
Defined in: Sources/FrakSDK/Rewards/Rewards.swift:98
Properties
Section titled “Properties”formatted
Section titled “formatted”let formatted: StringisProductScoped
Section titled “isProductScoped”let isProductScoped: BoolWhether the selected campaign is gated to a productScope. The gate, not the reward’s
basis — a product-gated campaign can still pay a percentage of the whole basket.
Defaults to false so a backend that predates this field still decodes.
lockupDurationDays
Section titled “lockupDurationDays”let lockupDurationDays: Double?matchedProducts
Section titled “matchedProducts”let matchedProducts: [ProductDetails]?The subset of the products this call supplied that matched the winning campaign’s
scope. nil for an unscoped winner, or when no products were supplied.
minPurchaseAmount
Section titled “minPurchaseAmount”let minPurchaseAmount: String?minPurchaseValue
Section titled “minPurchaseValue”let minPurchaseValue: Double?payoutType
Section titled “payoutType”let payoutType: StringWhich shape formatted describes: fixed, percentage or tiered. A plain
String so a payout type newer than this binary still decodes.
Operators
Section titled “Operators”!=(::)
static func != (lhs: Self, rhs: Self) -> BoolReturns a Boolean value indicating whether two values are not equal.
Inequality is the inverse of equality. For any values a and b, a != b
implies that a == b is false.
This is the default implementation of the not-equal-to operator (!=)
for any type that conforms to Equatable.
- Parameters:
- lhs: A value to compare.
- rhs: Another value to compare.