///
import { BrandRewardProgram, CouponAvailResponse, RewardTier, UserRewardTier } from "./types";
import "./WaysToRedeem.css";
import "./styles/shared.css";
export interface IdsActive {
ids: number[];
active: boolean;
}
export interface IdsOnly {
ids: number[];
}
export interface ProductIds {
ids: number[];
active: boolean;
products: any[];
}
export interface AllowedProducts {
products: any[];
}
export interface CouponTemplate {
couponTemplateId: number;
name: string;
couponType: string;
discountPercentage: number;
discountValue: number;
minimumOrderValue: number;
pointsRequired: number;
createdAt: string;
updatedAt: string;
brandId: number;
expiresInMinutes: number;
couponTemplateConsumer: string;
quantityThreshold: number;
isActive: boolean;
combinesWithOrderDiscount: boolean;
combinesWithProductDiscount: boolean;
combinesWithShippingDiscount: boolean;
isDummyCouponTemplate: boolean;
customerBuysCollectionIds: IdsActive;
customerBuysProductIds: IdsActive;
customerGetsCollectionIds: IdsActive;
customerGetsProductIds: ProductIds;
automaticBXGYDiscount: boolean;
automaticBXGYDiscountId: number | null;
allowedCollections: IdsOnly;
excludedCollections: IdsOnly;
allowedProducts: AllowedProducts;
combinesWithOtherFreebies: boolean;
autoAddEnabled: boolean;
percentageOffOnCustomerGetsProducts: number | null;
customCartProgressBarCriteria: string;
discountId: number | null;
limitFreebieQuantity: number;
hideFromSEO: boolean;
freebieType: string | null;
oneTimeClaim?: boolean;
restrictTo?: "none" | "tier";
rewardTierIds?: number[];
startDate: string | null;
endDate: string | null;
scheduleIds: number[] | null;
scheduleType: string;
maxFreebiesInTier: number;
__entity: string;
}
export interface FreebieProduct {
image?: string;
title?: string;
productId?: string;
variantId?: string;
}
export interface FreebieCouponTemplate {
couponTemplateId: number;
name: string;
pointsRequired: number;
restrictTo: "none" | "tier";
rewardTierIds: number[];
minimumOrderValue: number;
}
export interface FreebieItem {
isActive: boolean;
discountCode?: string;
isInCart?: boolean;
couponTemplate: FreebieCouponTemplate;
product: FreebieProduct;
}
export interface WaysToRedeemProps {
couponList?: CouponTemplate[];
freebies?: FreebieItem[];
couponHeading?: string;
couponCode?: string;
currencyCode?: string;
onCouponAvail: (couponTemplateId: number) => Promise;
copyFunction?: (code: string) => void;
/** Adds the claimed freebie's product to the cart. */
onFreebieAddToCart?: (freebie: FreebieItem) => Promise | void;
themeSecondaryContrastColor?: string;
themeSecondaryColor?: string;
themeBackgroundColor?: string;
setScreenType?: (type: string) => void;
showCTA?: boolean;
balanceCoins: number;
ctaBorderRadius?: string;
brandRewardProgram?: BrandRewardProgram;
redemptionMovRequired?: number | string;
userRewardTier?: UserRewardTier;
brandRewardTiers?: RewardTier[];
}
export default function WaysToRedeem({ couponList, freebies, couponHeading, couponCode, currencyCode, onCouponAvail, copyFunction, onFreebieAddToCart, themeSecondaryContrastColor, themeSecondaryColor, themeBackgroundColor, setScreenType, showCTA, balanceCoins, ctaBorderRadius, brandRewardProgram, redemptionMovRequired, userRewardTier, brandRewardTiers, }: WaysToRedeemProps): JSX.Element;