
// 예산 관련 타입 정의
export type BudgetPeriod = 'daily' | 'weekly' | 'monthly';

export interface BudgetPeriodData {
  targetAmount: number;
  spentAmount: number;
  remainingAmount: number;
}

export interface BudgetData {
  daily: BudgetPeriodData;
  weekly: BudgetPeriodData;
  monthly: BudgetPeriodData;
}

export interface CategoryBudget {
  title: string;
  current: number;
  total: number;
}

// BudgetContext 타입 정의
export interface BudgetContextType {
  transactions: Transaction[];
  categoryBudgets: Record<string, number>;
  budgetData: BudgetData;
  selectedTab: BudgetPeriod;
  setSelectedTab: (tab: BudgetPeriod) => void;
  addTransaction: (transaction: Transaction) => void;
  updateTransaction: (updatedTransaction: Transaction) => void;
  deleteTransaction: (id: string) => void;
  handleBudgetGoalUpdate: (type: BudgetPeriod, amount: number, newCategoryBudgets?: Record<string, number>) => void;
  getCategorySpending: () => CategoryBudget[];
  getPaymentMethodStats: () => { method: string; amount: number; percentage: number }[];
  resetBudgetData?: () => void; // 선택적 필드로 유지
}

// Transaction 타입 (기존 TransactionCard에서 가져옴)
export interface Transaction {
  id: string;
  title: string;
  amount: number;
  date: string;
  category: string;
  type: 'income' | 'expense';
  paymentMethod?: '신용카드' | '현금'; // 지출 방법 추가
  notes?: string;
  localTimestamp?: string; // 로컬 수정 타임스탬프 추가
  serverTimestamp?: string; // 서버 타임스탬프 추가
}
