Add payment method selection

Adds a payment method selection (Credit Card, Cash) to the expense form and includes a line separator. Also requests to add a graph showing the proportion of credit card and cash usage in expense analytics, but this part is not implemented in this commit.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-22 07:08:02 +00:00
parent 60ef765380
commit aa8381a823
12 changed files with 489 additions and 23 deletions

View File

@@ -31,6 +31,7 @@ export const useTransactionEdit = (
title: transaction.title,
amount: formatWithCommas(transaction.amount.toString()),
category: mapCategoryToNew(transaction.category),
paymentMethod: transaction.paymentMethod || '신용카드', // 지출 방법 추가, 기본값은 신용카드
},
});
@@ -41,6 +42,7 @@ export const useTransactionEdit = (
title: transaction.title,
amount: formatWithCommas(transaction.amount.toString()),
category: mapCategoryToNew(transaction.category),
paymentMethod: transaction.paymentMethod || '신용카드', // 지출 방법 기본값
});
}
}, [open, transaction, form]);
@@ -61,6 +63,7 @@ export const useTransactionEdit = (
title: values.title,
amount: Number(cleanAmount),
category: values.category,
paymentMethod: values.paymentMethod, // 지출 방법 업데이트
};
// 컨텍스트를 통해 트랜잭션 업데이트