Fix TypeScript errors

- Fix TS2353: Object literal may only specify known properties, and 'paymentMethod' does not exist in type 'Transaction'.
- Fix TS1205: Re-exporting a type when 'isolatedModules' is enabled requires using 'export type'.
- Fix TS2741: Property 'getPaymentMethodStats' is missing in type '{ transactions: Transaction[]; budgetData: BudgetData; categoryBudgets: Record<string, number>; selectedTab: BudgetPeriod; setSelectedTab: React.Dispatch<...>; ... 5 more ...; resetBudgetData: () => void; }' but required in type 'BudgetContextType'.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-22 07:16:33 +00:00
parent 2eff95908e
commit b00e27c1f0
3 changed files with 38 additions and 16 deletions

View File

@@ -1,4 +1,3 @@
import React, { useState, useEffect } from 'react';
import { PlusIcon } from 'lucide-react';
import { Dialog, DialogContent, DialogHeader, DialogTitle } from './ui/dialog';
@@ -7,7 +6,7 @@ import { useBudget } from '@/contexts/BudgetContext';
import { supabase } from '@/lib/supabase';
import { isSyncEnabled, setLastSyncTime, trySyncAllData } from '@/utils/syncUtils';
import ExpenseForm, { ExpenseFormValues } from './expenses/ExpenseForm';
import { Transaction } from '@/components/TransactionCard';
import { Transaction } from '@/contexts/budget/types';
import { normalizeDate } from '@/utils/sync/transaction/dateUtils';
import useNotifications from '@/hooks/useNotifications';
@@ -55,7 +54,7 @@ const AddTransactionButton = () => {
date: formattedDate,
category: data.category,
type: 'expense',
paymentMethod: data.paymentMethod // 추가된 필드
paymentMethod: data.paymentMethod // 지출 방법 필드 추가
};
console.log('새 지출 추가:', newExpense);

View File

@@ -1,22 +1,10 @@
import React, { useState } from 'react';
import { cn } from '@/lib/utils';
import TransactionEditDialog from './TransactionEditDialog';
import TransactionIcon from './transaction/TransactionIcon';
import TransactionDetails from './transaction/TransactionDetails';
import TransactionAmount from './transaction/TransactionAmount';
export type Transaction = {
id: string;
title: string;
amount: number;
date: string;
category: string;
type: 'expense' | 'income';
notes?: string; // notes 필드를 옵셔널로 추가
localTimestamp?: string; // 로컬 수정 타임스탬프 추가
serverTimestamp?: string; // 서버 타임스탬프 추가
};
import { Transaction } from '@/contexts/budget/types';
interface TransactionCardProps {
transaction: Transaction;