export type CheckoutStepId = 'package' | 'auth' | 'payment' | 'confirmation';

export interface GoogleProfilePrefill {
  email?: string;
  name?: string;
  given_name?: string;
  family_name?: string;
  avatar?: string;
  locale?: string;
}

export interface CheckoutPackage {
  id: number;
  name: string;
  description: string;
  price: number;
  description_breakdown?: Array<{
    title?: string | null;
    value: string;
  }>;
  gallery_duration_label?: string | null;
  events?: number | null;
  currency?: string;
  type: 'endcustomer' | 'reseller';
  features: string[];
  limits?: Record<string, unknown>;
  paddle_price_id?: string | null;
  paddle_product_id?: string | null;
  activates_immediately?: boolean;
  [key: string]: unknown;
}

export interface CheckoutWizardState {
  currentStep: CheckoutStepId;
  selectedPackage: CheckoutPackage;
  packageOptions: CheckoutPackage[];
  isAuthenticated: boolean;
  authUser?: {
    id: number;
    email: string;
    name?: string;
    pending_purchase?: boolean;
  } | null;
  isProcessing?: boolean;
}

export interface CheckoutWizardContextValue extends CheckoutWizardState {
  setStep: (step: CheckoutStepId) => void;
  nextStep: () => void;
  previousStep: () => void;
  setSelectedPackage: (pkg: CheckoutPackage) => void;
  markAuthenticated: (user: CheckoutWizardState['authUser']) => void;
  resetPaymentState: () => void;
  cancelCheckout: () => void;
}
