refactor(LOY-175): rewrite reward types according to new api endpoints

This commit is contained in:
Christian Andolf
2025-03-11 16:09:15 +01:00
parent 0ae4c5db17
commit b86347b4f4
15 changed files with 196 additions and 246 deletions

View File

@@ -3,10 +3,7 @@ import type { z } from "zod"
import type { DynamicContent } from "@/types/trpc/routers/contentstack/blocks"
import type { blocksSchema } from "@/server/routers/contentstack/accountPage/output"
import type {
Reward,
RewardWithRedeem,
} from "@/server/routers/contentstack/reward/output"
import type { Reward, RewardWithRedeem } from "../rewards"
export interface AccountPageContentProps
extends Pick<DynamicContent, "dynamic_content"> {}
@@ -35,8 +32,7 @@ export interface RedeemProps {
}
export interface ScriptedRewardTextProps {
rewardType?: string
rewardTierLevel?: string
reward: Reward | RewardWithRedeem
}
export type RedeemModalState = "unmounted" | "hidden" | "visible"

View File

@@ -1,11 +1,19 @@
import {
type RESTAURANT_REWARD_IDS,
type REWARD_CATEGORIES,
type REWARD_IDS,
type REWARD_TYPES,
} from "@/constants/rewards"
import type { IconProps } from "@/types/components/icon"
import type { MembershipLevelEnum } from "@/constants/membershipLevels"
import type {
RESTAURANT_REWARD_IDS,
REWARD_CATEGORIES,
REWARD_IDS,
REWARD_TYPES,
} from "@/constants/rewards"
ApiReward,
CMSReward,
CMSRewardWithRedeem,
} from "@/server/routers/contentstack/reward/output"
export { type Reward, type RewardWithRedeem }
export interface RewardIconProps extends IconProps {
rewardId: string
@@ -28,3 +36,10 @@ export interface FilterRewardsModalProps {
availableTierLevels: MembershipLevelEnum[]
availableCategories: RewardCategory[]
}
interface Reward extends CMSReward {
data: ApiReward
}
interface RewardWithRedeem extends CMSRewardWithRedeem {
data: ApiReward
}

View File

@@ -1,6 +1,6 @@
import { MembershipLevel } from "@/constants/membershipLevels"
import { LoyaltyLevel } from "@/server/routers/contentstack/loyaltyLevel/output"
import { Reward } from "@/server/routers/contentstack/reward/output"
import type { MembershipLevel } from "@/constants/membershipLevels"
import type { LoyaltyLevel } from "@/server/routers/contentstack/loyaltyLevel/output"
import type { Reward } from "./myPages/rewards"
export type OverviewTableClientProps = {
activeMembership: MembershipLevel | null