import { CouponTemplate, FreebieItem } from "./WaysToRedeem"; export interface LoyaltyProfileProps { isMobile?: boolean; previewMode?: boolean; bannerBackground?: string; bannerBackgroundType?: 'shape' | 'static'; bannerImage?: string; bannerTextColor?: string; bannerTextAlignment?: 'start' | 'center' | 'end'; showWatermark?: boolean; watermarkColor?: string; themePrimaryColor?: string; themeContrastColor?: string; themeSecondaryColor?: string; themeSecondaryContrastColor?: string; themeBackgroundColor?: string; themeTextColor?: string; themeAccentColor?: string; widgetOpen?: boolean; widgetPosition?: 'start' | 'center' | 'end'; widgetRoundedCorners?: boolean; ctaPrimaryColor?: string; ctaPrimaryContrastColor?: string; ctaBorderColor?: string; ctaSecondaryColor?: string; ctaSecondaryContrastColor?: string; ctaShowIcon?: boolean; ctaBorderRadius?: string; showWaysToEarn?: boolean; showWaysToRedeem?: boolean; showWCoinValue?: boolean; showReferral?: boolean; referralLocked?: boolean; showTransactions?: boolean; showVipSection?: boolean; showLogo?: boolean; brandName?: string; headingEyebrow?: string; userGreeting?: string; balanceCoins?: number | string; maxRedeemableCoins?: number | string; redemptionMovRequired?: number | string; coinValInr?: number | string; coinIcon?: string; currencyCode?: string; tokenName?: string; brandLogoUrl?: string; rateTitle?: string; rateSub?: string; couponHeading?: string; couponCode?: string; couponImage?: string; onCouponAvail: (couponTemplateId: number) => Promise; /** Adds a claimed freebie's product to the cart (from Ways to Redeem). */ onFreebieAddToCart?: (freebie: FreebieItem) => Promise | void; couponList?: CouponTemplate[]; freebies?: FreebieItem[]; referralLink?: string; userRewardTier?: UserRewardTier; brandRewardTiers?: RewardTier[]; userData?: UserData; activityRewards?: BrandActivityRewardSettings; brandRewardProgram: BrandRewardProgram; recentTransactionsData?: RecentTransactionsData; customCss?: string; enableCustomCss?: boolean; /** Raw HTML string rendered as a block after all profile sections. */ customHTML?: string; onBirthdayUpdate: (date: string) => Promise; onSocialClick: (url: string, type: string) => Promise; onFeedbackRewardClick?: (url: string, type?: "feedback" | "image_feedback") => Promise; isLoading: boolean; onWaysToRedeem?: () => void; onClose?: () => void; onLogout?: () => void; } export interface RewardsModalProps { isLoading?: boolean; themeBackgroundColor?: string; themeTextColor?: string; themeAccentColor?: string; bannerBackground?: string; bannerBackgroundType?: 'shape' | 'static'; bannerImage?: string; bannerTextColor?: string; watermarkColor?: string; widgetRoundedCorners?: boolean; guestWidgetImage?: string; bannerTextAlignment?: 'start' | 'center' | 'end'; showWatermark?: boolean; showLogo?: boolean; logourl?: string; guestGreeting?: string; existingUserGreeting?: string; phone?: string; email?: string; emailRequired?: boolean; validatePhone?: (newVal: boolean) => void; setEmailRequired?: (newVal: boolean) => void; onPhoneChange?: (newVal: string) => void; onEmailChange?: (newVal: string) => void; onClose?: () => void; onRegister?: (val?: string) => Promise; handleChangeNumber?: () => void; handleResendOtp?: () => void; handleSessionDetected?: () => void; onSendOTP?: () => Promise; isSessionDetected?: boolean; authType?: 'default' | 'phone' | 'ytAuth' | 'email'; formFilled?: boolean; redirectUrl?: string; ctaTitle?: string; ctaMainColor?: string; ctaMainContrastColor?: string; ctaPrimaryColor?: string; ctaPrimaryContrastColor?: string; registerLink?: string; brandTitle?: string; brandLogoUrl?: string; widgetOpen?: boolean; heading?: string; subcopy?: string; termsHref?: string; privacyHref?: string; styleVars?: Record; countryCode?: string; isMobilePreview?: boolean; viewportMode?: "auto" | "mobile" | "desktop"; } export interface AvailableDiscount { discountCode: string; discountValueInInr: string; __entity?: 'Discount' | string; } export interface CatalogDealsProductsPayload { productGid: string; variantGid: string; } export interface CustomBenefitPayload { title: string; value?: string; description?: string; icon?: string; } export interface RewardTier { id: number; name: string; brandId: number; rewardMultiplier: number; redemptionMultiplier: number; rewardTierCriteria: "ltv" | "loyalty_points" | "payment" | null; minimumLtvRequired: number | null; minimumLoyaltyPointsRequired: number | null; loyaltyRewardMultiplier: number | null; birthdayRewardMultiplier: number | null; socialTwitterRewardMultiplier: number | null; socialInstagramRewardMultiplier: number | null; socialFacebookRewardMultiplier: number | null; socialYoutubeRewardMultiplier: number | null; referrerOrderRewardMultiplier: number | null; icon: string | null; benefits: Record; createdAt: string; updatedAt: string; expiresInDays: number | null; membershipEligibilityProductId: string | null; shopifyCustomerTags: { tags: string[]; }; isActive: boolean; couponTemplateId: number | null; purchaseValueMethod?: "order_count" | "purchase_value" | null; paidMethod?: "purchase_in_cash" | "purchase_in_points" | null; period?: "lifetime" | "annual" | "custom" | null; periodDurationInMonths?: number | null; continuationCriteria?: number | null; minimumOrderCountRequired?: number | null; minimumOrderValueRequired?: number | null; minimumCashRequired?: number | null; minimumPointsRequired?: number | null; tierThemeColor?: string | null; widgetVisibility?: boolean | null; membershipTierProductTitle?: string | null; membershipTierProductDescription?: string | null; membershipTierProductMedia?: string | null; customBenefits?: CustomBenefitPayload[] | null; catalogDealsProducts?: CatalogDealsProductsPayload[]; } export type UserRewardTier = { currentPoints?: number; totalOrders?: number; currentLtv?: number; currentTier: RewardTier | null; nextTier: RewardTier | null; }; export interface UserData { id: number; points: number; aggregatedPoints: number; previouslyOrdered: boolean; __entity?: 'UserBrandLink' | string; availableDiscount?: AvailableDiscount | null; hasSetBirthday: boolean; hasFollowedOnInstagram: boolean; hasLikedOnFacebook: boolean; hasSharedOnFacebook: boolean; hasFollowedOnTwitter: boolean; hasSubscribedOnYoutube: boolean; hasClickedOnCustomLink: boolean; hasAvailedFirstOrderReward: boolean; hasAvailedSecondOrderReward: boolean; } export interface BrandRewardProgram { id: number; brandId: number; programStatus: boolean; programIcon: string; programAuthType: string; programTitle: string; programVisibility: boolean; pointsValueInInr: number; coinName: string; organizationIdSync: boolean; orderCreditCriteria: string; orderCreditStatus: boolean; orderCreditType: string; orderCreditValue: number; orderCreditMethodRestriction: string; orderCreditProductRestriction: any[]; coinExpirationPeriod: number; redemptionMethod: string; redemptionValue: number; redemptionStatus: boolean; redemptionIcon: string; redemptionMaxPoints: number; redemptionMovRequired: number; redemptionMinimumOrderValue?: number; redemptionMinimumOrderValueStatus?: boolean; redemptionCodeCombination: boolean; orderRewardCreditReversal: boolean; orderRewardRedemtionReversal: boolean; createdAt: string; updatedAt: string; deletedAt: string | null; __entity: string; } export interface CreditOnActivitiesProperties { customLink: ActivityProperty; twitterLike: ActivityProperty; youtubeLike: ActivityProperty; facebookLike: ActivityProperty; referralRewardConfig?: ReferralRewardConfig; signUpReward: SignUpRewardProperty; twitterShare: ActivityProperty; youtubeShare: ActivityProperty; facebookShare: ActivityProperty; instagramLike: ActivityProperty; twitterFollow: ActivityProperty; birthdayReward: BirthdayRewardProperty; facebookFollow: ActivityProperty; feedbackReward: FeedbackRewardProperty; instagramFollow: ActivityProperty; firstOrderReward: FirstOrderRewardProperty; secondOrderReward: SecondOrderRewardProperty; youtubeSubscription: ActivityProperty; } export interface SignUpRewardProperty extends WidgetActivityProperty { restrictOnReferralReward?: boolean; } export interface FeedbackRewardProperty extends WidgetActivityProperty { creditCriteria?: string; url?: string; limitToOneTimePerOrder?: boolean; } export interface FirstOrderRewardProperty extends WidgetActivityProperty { type?: string; restrictFirstOrderReward?: boolean; restrictOnReferralReward?: boolean; } export interface SecondOrderRewardProperty extends WidgetActivityProperty { type?: string; restrictPurchaseReward?: boolean; } export interface BrandActivityRewardSettings { id: number; brandId: number; programId: number; creditOnActivitiesProperties: CreditOnActivitiesProperties; creditOnSignupValue: number | null; creditOnFirstOrderValue: number | null; creditOnSecondOrderValue: number | null; creditOnFeedbackValue: number | null; creditOnImageFeedbackValue?: number | null; creditOnBirthdayValue: number | null; creditOnInstagramFollowValue: number | null; creditOnInstagramShareValue: number | null; creditOnInstagramLikeValue: number | null; creditOnFacebookFollowValue: number | null; creditOnFacebookShareValue: number | null; creditOnFacebookLikeValue: number | null; creditOnTwitterFollowValue: number | null; creditOnTwitterShareValue: number | null; creditOnTwitterLikeValue: number | null; creditOnYouTubeSubscriptionValue: number | null; creditOnYouTubeLikeValue: number | null; creditOnYouTubeShareValue: number | null; creditOnCustomLinkValue: number | null; createdAt: string; updatedAt: string; deletedAt: string | null; __entity: string; } export interface ActivityProperty { url?: string; icon?: string; status?: boolean; enabled?: boolean; offerTitle?: string; } export interface WidgetActivityProperty { icon?: string; status?: boolean; enabled?: boolean; offerTitle?: string; widgetVisibility?: boolean; } export interface BirthdayRewardProperty extends WidgetActivityProperty { type?: string; } export interface ReferralRewardConfig { enabled?: boolean; shareMethod?: "referral_code" | "referral_url"; codePrefix?: string; campaignVisibility?: "ways_to_earn" | "details" | "both"; offerTitle?: string; offerIcon?: string; customizeReferralSectionContent?: boolean; referrerReward?: ReferralRewardDetails; refereeReward?: ReferralRewardDetails; } export interface ReferralRewardDetails { enabled?: boolean; method?: "points" | "discount_code" | "freebie"; completionCriteria?: "signup" | "purchase" | "first_order"; pointsConfig?: { points: number; } | null; discountConfig?: { type: "percentage_off" | "fixed_amount" | "referee_order_value"; value: number; expiresInDays?: number | null; appliesTo: { type: "all_products" | "collections"; collectionIds?: string[]; }; } | null; freebieConfig?: { freebieType?: string; } | null; } export type RecentTransactionType = "earned" | "expired" | "availed"; export type RecentTransactionActivityType = "order" | "first_order" | "second_order" | "signup" | "bulk_insert_signup" | "birthday" | "referral_signup" | "referral_first_order" | "referee_signup" | "referee_first_order" | "referee_order" | "social_instagram" | "social_facebook" | "social_facebook_like" | "social_facebook_share" | "social_twitter" | "social_youtube" | "social_custom_link" | "review_comment" | "segment_reward" | "admin_balance_update" | "consumer_balance_increase" | "consumer_balance_decrease" | "membership_tier_acquisition" | "catalog_offer_redemption" | "discount_creation" | "consumer_discount_creation" | "points_expiration"; export type RecentTransactionCriteria = "payment" | "shipment" | "delivery" | "payment+shipment" | "payment+delivery"; export type RecentTransactionOrderStatus = "awaiting_payment" | "confirmed" | "in_transit" | "delivered" | "processing"; export interface RecentTransactionApiItem { id: string; type: RecentTransactionType; activityType: RecentTransactionActivityType; points: number; createdAt: string; } export interface RecentTransactionPendingItem { id: string; points: number; activityType: RecentTransactionActivityType; orderId?: string; criteria?: RecentTransactionCriteria; orderStatus?: RecentTransactionOrderStatus; createdAt: string; } export interface RecentTransactionSummary { totalSaved: number; totalEarned: number; totalAvailed: number; totalExpired: number; } export interface RecentTransactionsData { summary: RecentTransactionSummary; pending?: RecentTransactionPendingItem[]; transactions: RecentTransactionApiItem[]; } export interface CouponAvailResponse { discountCode: string; discountValueInInr: number; expiresAt: string; shopifyStoreId: string; brandId: number; userId: number; couponTemplateId: number; discountType: string; shopifyDiscountCodeId: string; creationMethod: string; discountPercentage: number | null; expiredAt: string | null; discountUsageCount: number | null; isUsed: boolean; minPurchaseAmount: number | null; freeProductId: number | null; metafieldId: number | null; metafieldJsonValue: any | null; discountId: number; isActive: boolean; deletedAt: string | null; createdAt: string; updatedAt: string; }