/**
 * ProovIT API Types
 */

export interface ApiResponse<T> {
  data: T;
  links?: {
    first: string;
    last: string;
    prev: string | null;
    next: string | null;
  };
  meta?: {
    current_page: number;
    total: number;
    per_page: number;
  };
}

export interface CustomField {
  key: string;
  label: string;
  type: 'text' | 'textarea' | 'select' | 'number' | 'date' | 'toggle';
  required: boolean;
  options?: string; // Comma separated for 'select'
}

export interface ProofTemplate {
  id: string;
  name: string;
  slug: string;
  description: string;
  data_schema: {
    signature: boolean;
    customFields: CustomField[];
    requiredFiles: string[];
    preFilledFields: Record<string, string | null>;
  };
  metadata: any;
  is_active: boolean;
}

export interface Product {
  id: string;
  name: string;
  slug: string;
  price: string; // Format "2.50"
  token_quantity: number;
  description: string;
  stripe_product_id: string;
  stripe_price_id: string;
  is_active: boolean;
}

export interface UserProfile {
  id: string | number;
  email: string;
  name: string;
  is_active?: boolean;
}

export interface TokenBalance {
  balance: number;
}

export interface CheckoutResponse {
  url?: string;
  checkoutUrl?: string;
  data?: {
    url?: string;
    checkoutUrl?: string;
  };
}
