export interface User {
    id?: string;
    name?: string;
    email?: string;
    userName?: string;
    firstName?: string;
    lastName?: string;
    imageUrl?: string;
    roleName?: string[];
    accountBank?: string;
    accountNumber?: string;
    accountName?: string;
  }
  
export interface Transaction {
    transactionId: string;
    amount: number;
    transactionDate: string;
    transactionType: 'Credit' | 'Debit';
    description: string;
    firstName: string | null;
    walletId: string;
    walletAccountNumber: string;
    walletAccountName: string;
    walletBalance: string;
  }
  
 export interface UserTransactionsDetails {
    transactions?: Transaction[];
    totalBalance?: number;
    [key: string]: unknown;
  }
  export interface Loan {
    loanId: string;
    loanAmount: number;
    repaymentDuration: number;
    administrativeFee: number;
    interestRate: number;
    totalRepaymentAmount?: number;
    status?: string; // made optional
    dateApplied: string;
    dateApproved: string;
    dueDate: string;
  }
  
  export interface SavingsHistory {
    amountSaved: string;
    date: string;
    savingsCategory: string;
    savingsPlanId: string;
  }
  export interface InvestmentHistory {
    investmentId: string;
    amountEarned: number;
    createdOn: string;
    investmentCategory: string;
  }
  export interface LoanHistory{
    loanId: string;
    amount: number;
    status: string;
    createdOn: string;
    dueDate: string;
    dateApproved: string;
    dateRejected: string;
  }

 export  interface AuthContextType {
    token: string | null;
    setToken: (token: string | null) => void;
    user: User | null;
    setUser: React.Dispatch<React.SetStateAction<User | null>>;
    userTransactionsDetails: UserTransactionsDetails | null;
    setUserTransactionsDetails: React.Dispatch<React.SetStateAction<UserTransactionsDetails | null>>;
    investmentSummary: InvestmentSummary | null;
    setInvestmentSummary: (summary: InvestmentSummary | null) => void;
    userSavingsEarnings: UserSavingsEarnings[] | null;
    setUserSavingsEarnings: React.Dispatch<React.SetStateAction<UserSavingsEarnings[] | null>>;
    userLoanSummary: Loan | null;
    setUserLoanSummary: React.Dispatch<React.SetStateAction<Loan | null>>;
    savingsHistory: SavingsHistory | null;
    setSavingsHistory: React.Dispatch<React.SetStateAction<SavingsHistory | null>>;
    investmentHistory: InvestmentHistory | null;
    setInvestmentHistory: React.Dispatch<React.SetStateAction<InvestmentHistory | null>>;
    loanHistory: LoanHistory | null;
    setLoanHistory: React.Dispatch<React.SetStateAction<LoanHistory | null>>;
    logout: () => void; 
  }
  
export  interface UserSavingsEarnings { 
    dailyEarning: number;
    date: string;
  }

export interface InvestmentEarning {
    dailyEarnedAmount: number;
    date: string;
  }
  
  export interface InvestmentPlan {
    planId: string;
    planName: string;
    accruedEarnings: number;
    dailyEarnings: number;
    date: string;
    earning: InvestmentEarning[];
  }
  
  export interface InvestmentSummary {
    investmentPlansWithEarnings: InvestmentPlan[];
    totalInvestment: number;
    totalDailyEarningsAllInvestmentPlans: number;
    totalAccruedEarningsAllInvestmentPlans: number;
  }

  export interface Transaction {
    category: string;
    amount: number;
    date: string;
    status: string;
  }
  
  export interface TransactionRowProps {
      transaction: Transaction;
      index: number;
  }

 export interface ButtonProps {
    children: React.ReactNode;
    onClick?: () => void;
    bgColor?: string;
    textColor?: string;
    hover?: string;
    paddingVertical?: string;
    paddingHorizontal?: string;
    width?: string;
    border?: string;
    borderColor?: string;
    type?: "button" | "submit" | "reset";
    disabled?: boolean;
    marginBottom?: string;
    className?: string;
 }

 export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
   label: string;
   error?: string;
 }

export interface Option {
   value: string;
   label: string;
 }
  
export interface SelectProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'onChange'> {
   label: string;
   options: Option[];
   error?: string;
   placeholder?: string;
   onChange?: (value: string) => void;
}
 
export interface InitialSignupData {
  fullName: string;
  email: string;
  password: string;
  confirmPassword: string;
}

export interface CompleteSignupData {
  userName: string;
  firstName: string;
  lastName: string;
  occupation: string;
  gender: string;
}

  