import { MembershipVisualConfig } from "../membershipTheme/types.js"; import { OfferPassAccount } from "../../plus/pisellGlobalSearch/api/offerPassResult.js"; //#region src/components/membershipDetail/types.d.ts /** Endpoint identity is OfferPass.id, never a wallet account or Voucher identity. */ interface OfferPassRecord { id: number | string; shop_id?: number | string; customer_id?: number | string | null; customer_name?: string | null; is_bind?: boolean; offer_id?: number | string; offer_group_id?: number | string; code?: string | null; status?: string | null; starts_at?: string | null; expired_at?: string | null; offer?: { id?: number | string; name?: unknown; [field: string]: unknown; } | null; group?: { id?: number | string; name?: unknown; [field: string]: unknown; } | null; benefits?: OfferPassBenefit[] | null; metadata?: Record | null; } interface OfferPassBenefit { id?: number | string; name?: unknown; benefit_type?: string; benefit_config?: { grant_type?: string; params?: { target_ids?: unknown; target_model?: OfferPassVoucher[] | null; } | null; } | null; } /** The documented 20 basic Voucher fields. No computed balance or redeemable amount. */ interface OfferPassVoucher { id?: number | string; code?: string | null; encoded?: string | null; tag?: string | null; relation_type?: string | null; product_id?: number | string; product_name?: string | null; cover?: string | null; status?: string | null; limit_status?: string | null; sales_status?: number; par_value?: string | null; used_par_value?: string | null; start_date?: string | null; expire_date?: string | null; start_time?: string | null; end_time?: string | null; expire_time?: string | null; created_at?: string | null; metadata?: Record | null; } interface MembershipDetailRow { key: string; label: string; value: string; } interface MembershipBenefitVoucher { voucherId: string; name: string; typeLabel: string; cover?: string; rows: MembershipDetailRow[]; } interface MembershipBenefit { benefitId: string; title: string; /** Undefined is not yet supplied; [] explicitly means no associated cards. */ vouchers?: MembershipBenefitVoucher[]; expectsVouchers: boolean; } interface MembershipDetailData { offerPassId: string; account: OfferPassAccount; title: string; merchantLabel?: string; benefitTitle: string; cardNumber?: string; validityLabel?: string; status: { label: string; tone: 'neutral' | 'setup' | 'unavailable'; }; details: MembershipDetailRow[]; benefits?: MembershipBenefit[]; } type MembershipDetailPreview = 'ready' | 'empty' | 'multiple' | 'partial' | 'future' | 'expired' | 'error'; interface MembershipDetailProps { membershipConfig?: MembershipVisualConfig; /** Identity scopes only; the OfferPass request sends no business parameters. */ shopId?: number | string; customerId?: number | string; platform?: 'pc' | 'h5'; locale?: string; themeColor?: string; /** Injected explicitly by development hosts, never read from the material's URL. */ previewScenario?: MembershipDetailPreview; } //#endregion export { MembershipBenefit, MembershipBenefitVoucher, MembershipDetailData, MembershipDetailProps, OfferPassRecord };