feat(LOY-154): add expiration date to rewards
This commit is contained in:
@@ -212,6 +212,7 @@ export type Reward = CMSReward & {
|
||||
rewardTierLevel: string | undefined
|
||||
operaRewardId: string
|
||||
couponCode: string | undefined
|
||||
coupons: Coupon[]
|
||||
}
|
||||
|
||||
export type RewardWithRedeem = CMSRewardWithRedeem & {
|
||||
@@ -221,10 +222,18 @@ export type RewardWithRedeem = CMSRewardWithRedeem & {
|
||||
rewardTierLevel: string | undefined
|
||||
operaRewardId: string
|
||||
couponCode: string | undefined
|
||||
coupons: Coupon[]
|
||||
}
|
||||
|
||||
export interface Coupon {
|
||||
couponCode?: string
|
||||
expiresAt?: string
|
||||
unwrapped: boolean
|
||||
state: "claimed" | "redeemed" | "viewed"
|
||||
}
|
||||
|
||||
export interface Surprise extends Omit<Reward, "operaRewardId" | "couponCode"> {
|
||||
coupons: { couponCode?: string | undefined; expiresAt?: string }[]
|
||||
coupons: Coupon[]
|
||||
}
|
||||
|
||||
// New endpoint related types and schemas.
|
||||
|
||||
@@ -287,6 +287,8 @@ export const rewardQueryRouter = router({
|
||||
? apiReward.operaRewardId
|
||||
: "",
|
||||
couponCode: firstRedeemableCouponToExpire,
|
||||
coupons:
|
||||
apiReward && "coupon" in apiReward ? apiReward.coupon || [] : [],
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user