/**
 * @ai-summary Type definitions for Stripe API responses
 * @ai-context Simplified types for the Stripe API responses we care about
 */

// Stripe Customer
export interface StripeCustomer {
  id: string;
  email: string;
  name?: string;
  created: number;
  metadata?: Record<string, string>;
}

// Stripe Subscription
export interface StripeSubscription {
  id: string;
  customer: string;
  status: 'incomplete' | 'incomplete_expired' | 'trialing' | 'active' | 'past_due' | 'canceled' | 'unpaid' | 'paused';
  items: unknown;
  currentPeriodStart: number;
  currentPeriodEnd: number;
  cancelAtPeriodEnd: boolean;
  canceledAt?: number;
  created: number;
  metadata?: Record<string, string>;
}

// Stripe Payment Method
export interface StripePaymentMethod {
  id: string;
  type: string;
  card?: {
    brand: string;
    last4: string;
    exp_month: number;
    exp_year: number;
  };
}

// Stripe Payment Intent (for donations)
export interface StripePaymentIntent {
  id: string;
  amount: number;
  currency: string;
  status: 'requires_payment_method' | 'requires_confirmation' | 'requires_action' | 'processing' | 'requires_capture' | 'canceled' | 'succeeded';
  customer?: string;
  payment_method?: string;
  client_secret: string | null;
  created: number;
  metadata?: Record<string, string>;
}

// Stripe Webhook Event
export interface StripeWebhookEvent {
  id: string;
  type: string;
  data: {
    object: any;
  };
  created: number;
}

// Stripe Price (for subscription plans)
export interface StripePrice {
  id: string;
  product: string;
  unit_amount: number;
  currency: string;
  recurring?: {
    interval: 'day' | 'week' | 'month' | 'year';
    interval_count: number;
  };
  metadata?: Record<string, string>;
}

// Stripe Error
export interface StripeError {
  type: string;
  code?: string;
  message: string;
  param?: string;
}
